Skip to content

Commit a74c047

Browse files
fnkkalex4506
authored andcommitted
feat: commit final Dapp from 100243171
1 parent abaf3f4 commit a74c047

21 files changed

+4200
-0
lines changed

100243171/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.aptos
2+
/move/build

100243171/client/.gitignore

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts

100243171/client/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
# or
14+
bun dev
15+
```
16+
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18+
19+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20+
21+
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
22+
23+
## Learn More
24+
25+
To learn more about Next.js, take a look at the following resources:
26+
27+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29+
30+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31+
32+
## Deploy on Vercel
33+
34+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35+
36+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
'use client'
2+
import { useEffect, useState } from "react";
3+
import { useWallet } from "@aptos-labs/wallet-adapter-react";
4+
import { Aptos, AptosConfig, Network, GetAccountOwnedTokensQueryResponse } from "@aptos-labs/ts-sdk";
5+
import Card from "../ui/collections/card";
6+
function Page() {
7+
const { account } = useWallet();
8+
const aptosConfig = new AptosConfig({ network: Network.TESTNET });
9+
const aptos = new Aptos(aptosConfig);
10+
const [tokenList, setTokenList] = useState<GetAccountOwnedTokensQueryResponse>([])
11+
const fetchList = async () => {
12+
if (!account) return [];
13+
try {
14+
const tokens = await aptos.getAccountOwnedTokens({ accountAddress: account?.address });
15+
console.log('tokens:', tokens)
16+
setTokenList(tokens)
17+
} catch (e: any) {
18+
}
19+
};
20+
useEffect(() => {
21+
fetchList();
22+
}, [account?.address]);
23+
return (
24+
<div className="flex justify-center mt-10">
25+
<div className="w-2/3 flex flex-wrap justify-start gap-4">
26+
{tokenList.map((item, index) => {
27+
return (
28+
<Card token={item} key={index} />
29+
)
30+
})}
31+
32+
</div>
33+
</div>
34+
)
35+
}
36+
export default Page;

100243171/client/app/favicon.ico

25.3 KB
Binary file not shown.

100243171/client/app/globals.css

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
:root {
6+
--foreground-rgb: 0, 0, 0;
7+
--background-start-rgb: 214, 219, 220;
8+
--background-end-rgb: 255, 255, 255;
9+
}
10+
11+
@media (prefers-color-scheme: dark) {
12+
:root {
13+
--foreground-rgb: 255, 255, 255;
14+
--background-start-rgb: 0, 0, 0;
15+
--background-end-rgb: 0, 0, 0;
16+
}
17+
}
18+
19+
/* body {
20+
color: rgb(var(--foreground-rgb));
21+
background: linear-gradient(
22+
to bottom,
23+
transparent,
24+
rgb(var(--background-end-rgb))
25+
)
26+
rgb(var(--background-start-rgb));
27+
} */
28+
29+
@layer utilities {
30+
.text-balance {
31+
text-wrap: balance;
32+
}
33+
}

100243171/client/app/layout.tsx

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import type { Metadata } from "next";
2+
import { Inter } from "next/font/google";
3+
import "./globals.css";
4+
import { Web3Modal } from '@/context/Web3Modal';
5+
import Navbar from "./ui/components/navbar";
6+
const inter = Inter({ subsets: ["latin"] });
7+
8+
export const metadata: Metadata = {
9+
title: "Create Next App",
10+
description: "Generated by create next app",
11+
};
12+
13+
export default function RootLayout({
14+
children,
15+
}: Readonly<{
16+
children: React.ReactNode;
17+
}>) {
18+
return (
19+
<html lang="en">
20+
<body className={inter.className}>
21+
<Web3Modal>
22+
<div>
23+
<Navbar />
24+
{children}
25+
</div>
26+
</Web3Modal>
27+
</body>
28+
</html>
29+
);
30+
}

0 commit comments

Comments
 (0)