Skip to content

Commit 76a7a04

Browse files
Token/NFT vault UI
1 parent 95526a7 commit 76a7a04

File tree

10 files changed

+122
-50
lines changed

10 files changed

+122
-50
lines changed

frontend/app/dapp/Tabs.tsx

Lines changed: 122 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,87 @@
22

33
import React, { useState } from 'react'
44
import Image from 'next/image'
5-
import { Button } from '@/components/shared/Button'
5+
import nft1 from '../../public/Images/nft1.png'
6+
import nft2 from '../../public/Images/nft2.png'
7+
import nft3 from '../../public/Images/nft3.png'
8+
import nft4 from '../../public/Images/nft4.png'
9+
import nft5 from '../../public/Images/nft5.png'
10+
import nft6 from '../../public/Images/nft6.png'
11+
import nft7 from '../../public/Images/nft7.png'
12+
import nft8 from '../../public/Images/nft8.png'
13+
import strk from '../../public/Images/strk.png'
614

715
export default function Tabs() {
816
const [activeTab, setActiveTab] = useState('Tokens')
17+
18+
// Token data matching the first image
19+
const tokens = [
20+
{
21+
coin: 'STRK',
22+
price: '$0.46',
23+
balance: '5',
24+
value: '$460.43',
25+
size: '25%'
26+
},
27+
{
28+
coin: 'STRK',
29+
price: '$0.46',
30+
balance: '2',
31+
value: '$700.20',
32+
size: '25%'
33+
},
34+
{
35+
coin: 'STRK',
36+
price: '$0.46',
37+
balance: '3',
38+
value: '$527.00',
39+
size: '50%'
40+
}
41+
]
42+
43+
// NFT data with correctly imported image objects
44+
const nfts = [
45+
{
46+
id: 1,
47+
image: nft1,
48+
},
49+
{
50+
id: 2,
51+
image: nft2,
52+
},
53+
{
54+
id: 3,
55+
image: nft3,
56+
},
57+
{
58+
id: 4,
59+
image: nft4,
60+
},
61+
{
62+
id: 5,
63+
image: nft5,
64+
},
65+
{
66+
id: 6,
67+
image: nft6,
68+
},
69+
{
70+
id: 7,
71+
image: nft7,
72+
},
73+
{
74+
id: 8,
75+
image: nft8,
76+
}
77+
]
78+
979
return (
10-
<>
80+
<div className=" text-white">
1181
<div className="flex border-b border-[#292929]">
1282
<button
1383
onClick={() => setActiveTab('Tokens')}
14-
className={`px-4 py-2 relative ${
15-
activeTab === 'Tokens' ? 'font-bold text-white' : 'text-[#8E9BAE]'
16-
}`}
84+
className={`px-4 py-2 relative ${activeTab === 'Tokens' ? 'font-bold text-white' : 'text-[#8E9BAE]'
85+
}`}
1786
>
1887
Tokens
1988
{activeTab === 'Tokens' && (
@@ -22,66 +91,69 @@ export default function Tabs() {
2291
</button>
2392
<button
2493
onClick={() => setActiveTab('NFT')}
25-
className={`px-4 py-2 relative ${
26-
activeTab === 'NFT' ? 'font-bold text-white' : 'text-[#8E9BAE]'
27-
}`}
94+
className={`px-4 py-2 relative ${activeTab === 'NFT' ? 'font-bold text-white' : 'text-[#8E9BAE]'
95+
}`}
2896
>
29-
NFT Values
97+
NFT Vaults
3098
{activeTab === 'NFT' && (
3199
<div className="absolute bottom-0 left-0 right-0 h-[.5px] bg-white"></div>
32100
)}
33101
</button>
34102
</div>
35103

36104
{activeTab === 'Tokens' && (
37-
<div className="p-[20px] relative flex justify-center items-center">
38-
<div className="flex text-center flex-col gap-y-5 max-w-[500px] items-center justify-center">
39-
<Image
40-
className="pt-1"
41-
height={225}
42-
width={287}
43-
src="empty_nft.svg"
44-
alt="Eye Icon"
45-
/>
46-
<h3 className="text-[#FFFFFF] font-bold text-[30px]">
47-
There are no NFTs available
48-
</h3>
49-
<p className="text-[#8E9BAE]">
50-
First make a trade or transaction to view, buy and sell NFTs. Just
51-
make a transaction by clicking the button.
52-
</p>
105+
<div className="my-2 px-8 py-4 rounded-lg">
106+
<div className="w-full">
107+
<div className="grid grid-cols-5 text-sm text-[#8E9BAE] pb-2">
108+
<div>Coin</div>
109+
<div>Price</div>
110+
<div>Balance</div>
111+
<div>Value</div>
112+
<div>Size</div>
113+
</div>
53114

54-
<Button variant="primary" icon="/arrows-exchange.svg">
55-
Trade
56-
</Button>
115+
{tokens.map((token, index) => (
116+
<div key={index} className="grid grid-cols-5 py-4">
117+
<div className="flex items-center gap-1">
118+
<Image src={strk} width={20} height={20} alt='starknet token icon' />
119+
<span>{token.coin}</span>
120+
</div>
121+
<div>{token.price}</div>
122+
<div>{token.balance}</div>
123+
<div>{token.value}</div>
124+
<div>
125+
<div className="relative w-full h-1 bg-[#292929] rounded-full">
126+
<div
127+
className="absolute top-0 left-0 h-1 bg-white rounded-full"
128+
style={{ width: token.size }}
129+
></div>
130+
</div>
131+
<div className="text-xs mt-1 text-right">{token.size}</div>
132+
</div>
133+
</div>
134+
))}
57135
</div>
58136
</div>
59137
)}
60138

61139
{activeTab === 'NFT' && (
62-
<div className="p-[20px] relative flex justify-center items-center">
63-
<div className="flex text-center flex-col gap-y-5 max-w-[500px] items-center justify-center">
64-
<Image
65-
className="pt-1"
66-
height={225}
67-
width={287}
68-
src="empty_nft.svg"
69-
alt="Eye Icon"
70-
/>
71-
<h3 className="text-[#FFFFFF] font-bold text-[30px]">
72-
There are no NFTs available
73-
</h3>
74-
<p className="text-[#8E9BAE]">
75-
First make a trade or transaction to view, buy and sell NFTs. Just
76-
make a transaction by clicking the button.
77-
</p>
78-
79-
<Button variant="primary" icon="/arrows-exchange.svg">
80-
Trade
81-
</Button>
140+
<div className="p-4">
141+
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
142+
{nfts.map((nft) => (
143+
<div key={nft.id} className="rounded-lg overflow-hidden bg-gray-800">
144+
<div className="aspect-square relative">
145+
<Image
146+
src={nft.image}
147+
alt={`NFT ${nft.id}`}
148+
fill
149+
className="object-cover"
150+
/>
151+
</div>
152+
</div>
153+
))}
82154
</div>
83155
</div>
84156
)}
85-
</>
157+
</div>
86158
)
87-
}
159+
}

frontend/public/Images/nft1.png

1.88 MB
Loading

frontend/public/Images/nft2.png

422 KB
Loading

frontend/public/Images/nft3.png

627 KB
Loading

frontend/public/Images/nft4.png

707 KB
Loading

frontend/public/Images/nft5.png

1.65 MB
Loading

frontend/public/Images/nft6.png

1.01 MB
Loading

frontend/public/Images/nft7.png

291 KB
Loading

frontend/public/Images/nft8.png

421 KB
Loading

frontend/public/Images/strk.png

5.46 KB
Loading

0 commit comments

Comments
 (0)