Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ13th committed May 6, 2024
2 parents 0e2c10d + be4c3a9 commit 5775b29
Show file tree
Hide file tree
Showing 29 changed files with 62 additions and 18 deletions.
Binary file not shown.
Binary file not shown.
Binary file added public/images/Xblue_property_NFT31_house.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added public/images/Xcoral_property_NFT16_house.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added public/images/Xgreen_property_NFT4_house.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added public/images/Xpurple_property_NFT11_house.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
50 changes: 47 additions & 3 deletions src/app/(dashboard)/home/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import { Card, CardWithoutHeading } from '@/components/cards/card';
import { Shell } from '@/components/shell';
import { TaskCard } from '../tasks/page';
Expand All @@ -6,8 +7,43 @@ import { Button } from '@/components/ui/button';
import { PlayerStats } from '@/components/cards/player-stats-card';
import { LeadBoardCard } from '@/components/cards/leadboard-card';
import Link from 'next/link';
import { getApi } from '@/lib/polkadot';
import { web3Enable, web3FromAddress } from '@polkadot/extension-dapp';

type Player = {
Player: 1;
};

type Practice = {
Practice: 0;
};

type GameType = Player | Practice;

export default function App() {
const address = '5CSFhuBPkG1SDyHseSHh23Kg89oYVysjRmXH5ea3F3fzEyx5';
const playGame = async (gameType: GameType) => {
try {
const api = await getApi();
const extensions = await web3Enable('RealXDEal');
const injected = await web3FromAddress(address);
const extrinsic = api.tx.gameModule.playGame(gameType);
const signer = injected.signer;

const unsub = await extrinsic.signAndSend(address, { signer }, result => {
if (result.status.isInBlock) {
console.log(`Completed at block hash #${result.status.asInBlock.toString()}`);
} else if (result.status.isBroadcast) {
console.log('Broadcasting the guess...');
}
});

console.log('Transaction sent:', unsub);
} catch (error) {
console.error('Failed to submit guess:', error);
}
};

return (
<Shell>
<section className=" flex w-full gap-[54px]">
Expand All @@ -19,14 +55,16 @@ export default function App() {

<div className="flex w-[60%] items-start gap-[29px]">
<div className="flex h-full w-[172px] items-end justify-center rounded-lg border border-primary-400 bg-primary-400/[0.24] pb-2.5">
<Button href="/gameplay" variant={'warning'} size={'md'}>
<Button variant={'warning'} size={'md'} onClick={() => playGame({ Practice: 0 })}>
Demo Mode
</Button>
</div>
<div className="flex h-full w-[172px] items-end justify-center rounded-lg border border-primary-200 bg-primary-200/[0.24] pb-2.5">
<Button href="/gameplay" variant={'secondary'} size={'md'}>
{/* <Link href={`/gameplay`}> */}
<Button variant={'secondary'} size={'md'} onClick={() => playGame({ Player: 1 })}>
Live Mode
</Button>
{/* </Link> */}
</div>
</div>
</section>
Expand Down Expand Up @@ -80,7 +118,13 @@ export default function App() {
const NFTCard = () => {
return (
<div className="relative w-full border border-primary-200 p-[6px]">
<Image src={'/images/nft.png'} alt="nft" width={132} height={152} priority />{' '}
<Image
src={'/images/Xpurple_property_NFT9_apartment.webp'}
alt="nft"
width={132}
height={152}
priority
/>{' '}
<div className=" absolute bottom-0 left-[53px] flex items-center justify-center rounded-t bg-primary-200 px-2">
<span className="text-[1rem]/[1.2rem] font-light">10</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/(dashboard)/leaderboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default async function Page() {
src="/images/user.png"
alt="Rounded avatar"
/>
<p className=" ml-3">Nikku Dev</p>
<p className=" ml-3">Deal Real Dev</p>
<span className="me-2 rounded-xl bg-[#DC7DA63D] px-2.5 py-0.5 text-xs text-white shadow-none ">
1Ay00011DY...
</span>
Expand Down
4 changes: 2 additions & 2 deletions src/app/(dashboard)/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ProfileNFTCard = ({ isShadow, ...nft }: ProfileNFTCardProps) => {
>
<div className="relative h-[234px] w-full ">
<Image
src="/images/profile-nft.png"
src={nft.image}
alt="nft"
width={264}
height={234}
Expand Down Expand Up @@ -130,7 +130,7 @@ export default function Page({
style={{ boxShadow: '0px 0px 24px 0px #ECB278', border: '4px solid #DAB436' }}
/>
<div className="ml-3 mt-2 flex flex-col">
<p className="ml-1 font-bold">Nikku Dev</p>
<p className="ml-1 font-bold">Deal Real Dev</p>
<span className=" mt-3 rounded-xl bg-[#DC7DA63D] px-2.5 py-0.5 text-xs text-white shadow-none ">
1Ay00011DY...
</span>
Expand Down
2 changes: 1 addition & 1 deletion src/app/(page)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function Home() {
<div className="flex w-full max-w-[610px] flex-col items-start gap-6">
<div className="flex flex-col items-start gap-4">
<h1 className="font-heading text-[2.5rem]/[3rem] font-medium">
Think you are good at knowing real estate prices?
Think you are good at guessing real estate prices?
</h1>
<p className="text-[1rem]/[1.5rem] font-light">
Are you willing to stake your tokens on it? guess correct property prices and win
Expand Down
22 changes: 11 additions & 11 deletions src/config/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,59 +62,59 @@ export const siteConfig = {
},
nfts: [
{
image: '/images/nft-list.png',
image: '/images/Xblue_property_NFT29_apartment.webp',
nftId: 12,
owner: 'Alice',
type: 'Blue',
time: '2024-05-03 11:43:42'
},
{
image: '/images/nft-list.png',
image: '/images/Xcoral_property_NFT15_apartment.webp',
nftId: 1,
owner: 'Bob',
type: 'Green',
type: 'Coral',
time: '2024-05-03 11:43:43'
},
{
image: '/images/nft-list.png',
image: '/images/Xblue_property_NFT30_apartment.webp',
nftId: 2,
owner: 'Carol',
type: 'Blue',
time: '2024-05-03 11:43:44'
},
{
image: '/images/nft-list.png',
image: '/images/Xgreen_property_NFT2_apartment.webp',
nftId: 3,
owner: 'Dave',
type: 'Green',
time: '2024-05-03 11:43:45'
},
{
image: '/images/nft-list.png',
image: '/images/Xblue_property_NFT30_apartment.webp',
nftId: 4,
owner: 'Eve',
type: 'Blue',
time: '2024-05-03 11:43:46'
},
{
image: '/images/nft-list.png',
image: '/images/Xgreen_property_NFT3_apartment.webp',
nftId: 5,
owner: 'Frank',
type: 'Green',
time: '2024-05-03 11:43:47'
},
{
image: '/images/nft-list.png',
image: '/images/Xorange_property_NFT21_apartment.webp',
nftId: 6,
owner: 'Grace',
type: 'Blue',
type: 'Orange',
time: '2024-05-03 11:43:48'
},
{
image: '/images/nft-list.png',
image: '/images/Xpurple_property_NFT12_apartment.webp',
nftId: 13,
owner: 'Harry',
type: 'Green',
type: 'Purple',
time: '2024-05-03 11:43:49'
}
]
Expand Down

0 comments on commit 5775b29

Please sign in to comment.