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

Commit

Permalink
Merge pull request #11 from XcavateBlockchain/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
izaakwalz authored Jul 10, 2024
2 parents 8dc79a7 + c9321d9 commit da58862
Show file tree
Hide file tree
Showing 12 changed files with 3,073 additions and 4,123 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"@types/node": "^20.14.9",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.19",
"braces": "^3.0.3",
"eslint": "^8.57.0",
"eslint-config-next": "14.2.3",
Expand Down
6,742 changes: 3,021 additions & 3,721 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};
8 changes: 0 additions & 8 deletions postcss.config.mjs

This file was deleted.

33 changes: 5 additions & 28 deletions src/app/(dashboard)/home/page.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,24 @@
'use client';
import { Card, CardWithoutHeading } from '@/components/cards/card';

import { Card, CardWithoutHeading, TaskCard } from '@/components/cards/card';
import { Shell } from '@/components/shell';
import { TaskCard } from '../tasks/page';

import Image from 'next/image';
// 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';
import LiveGamePlay from './_components/live-game-container';
import { getLeadBoards, getUserData } from '@/lib/queries';
import ProfileHeader from './_components/profile-header';
import { useSubstrateContext } from '@/context/polkadot-contex';
import { useCallback, useEffect, useState } from 'react';
import { fetchPropertyData } from '@/app/actions';

// type Player = {
// Player: 1;
// };

// type Practice = {
// Practice: 0;
// };

// type GameType = Player | Practice;

export default function App() {
export default function Page() {
const { address } = useSubstrateContext();
const [user, setUser] = useState<any>();
const [lists, setLists] = useState<any>([]);

async function fetchData(address: string) {
const boardList = await getLeadBoards();
// const property = await fetchPropertyData(139361966)
// console.log(property)
const userData = await getUserData(address);

if (userData !== null && boardList !== null) {
Expand All @@ -58,24 +42,17 @@ export default function App() {
<ProfileHeader points={user?.points} />
<section className=" flex w-full gap-[54px]">
<CardWithoutHeading className="w-2/5">
<PlayerStats title="Guesses" value={10} />
<PlayerStats title="Guesses" value={Number(user?.wins) + Number(user?.losses)} />
<PlayerStats title="Correct " value={user?.wins} />
<PlayerStats title="Failed " value={user?.losses} />
</CardWithoutHeading>

<div className="flex w-3/5 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">
<LiveGamePlay type={0} />

{/* <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">
<LiveGamePlay type={1} />
{/* <Button variant={'secondary'} size={'md'} onClick={() => playGame({ Player: 1 })}>
Live Mode
</Button> */}
</div>
</div>
</section>
Expand Down
22 changes: 2 additions & 20 deletions src/app/(dashboard)/tasks/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import { Card, CardWithoutHeading } from '@/components/cards/card';
import { Card, CardWithoutHeading, TaskCard } from '@/components/cards/card';
import { PlayerStats } from '@/components/cards/player-stats-card';
import { Icons } from '@/components/icons';
import { Shell } from '@/components/shell';

type TaskCardProps = {
type: string;
title: string;
description: string;
};

export default function Tasks() {
return (
<Shell>
Expand All @@ -30,6 +23,7 @@ export default function Tasks() {
title="Task"
description=" Select any quest below to add on your community’s main quest board, This will
enable your community to engage and provide continuous value."
orientation="vertical"
>
<div className="grid w-full grid-cols-3 gap-[14px]">
<TaskCard
Expand Down Expand Up @@ -82,15 +76,3 @@ export default function Tasks() {
</Shell>
);
}

export const TaskCard = ({ type, title, description }: TaskCardProps) => {
return (
<div className="flex flex-col items-start justify-start gap-4 rounded-lg bg-[#3E4F6D] px-6 py-10 backdrop-blur">
<dt className="flex items-start gap-2 ">
<Icons.xLogo className="size-6" />{' '}
<span className="font-heading text-[0.875rem]/[1.543m] font-medium">{title}</span>
</dt>
<dd className="text-[0.875rem]/[1.5rem] font-light">{description}</dd>
</div>
);
};
63 changes: 0 additions & 63 deletions src/app/(dashboard)/test/page.tsx

This file was deleted.

Loading

0 comments on commit da58862

Please sign in to comment.