This repository has been archived by the owner on Jul 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 212
/
Copy path[address].jsx
73 lines (69 loc) · 2.46 KB
/
[address].jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import {Tab} from "@headlessui/react"
import {useRouter} from "next/dist/client/router"
import Link from "next/link"
import {Fragment} from "react"
import Avatar from "src/components/Avatar"
import PageTitle from "src/components/PageTitle"
import ProfileAccountItems from "src/components/ProfileAccountItems"
import ProfileListings from "src/components/ProfileListings"
import ProfileQuestionPopover from "src/components/ProfileQuestionPopover"
import {CHAIN_ENV_TESTNET, paths} from "src/global/constants"
import publicConfig from "src/global/publicConfig"
const getTabClasses = selected =>
`text-3xl mx-4 text-gray-darkest border-b-2 pb-0.5 hover:opacity-80 ${
selected ? "border-green" : "border-transparent"
}`
export default function Profile() {
const router = useRouter()
const {address} = router.query
return (
<div className="main-container pt-12 pb-24" data-cy="profile">
<PageTitle>{address}</PageTitle>
<main>
<div className="bg-white border border-gray-200 p-6 mb-12 rounded-md flex flex-col items-center justify-center relative">
<div className="absolute top-5 right-5 w-full flex flex-row-reverse">
<ProfileQuestionPopover />
</div>
<div className="w-20 h-20 relative">
<Avatar address={address} />
</div>
<div className="font-mono text-gray mt-2">
{publicConfig.chainEnv === CHAIN_ENV_TESTNET ? (
<Link href={paths.flowscanAcct(address)} passHref>
<a className="hover:opacity-80" target="_blank">
{address}
</a>
</Link>
) : (
address
)}
</div>
</div>
<Tab.Group>
<Tab.List className="text-center mb-12">
<Tab as={Fragment}>
{({selected}) => (
<button className={getTabClasses(selected)}>My Items</button>
)}
</Tab>
<Tab as={Fragment}>
{({selected}) => (
<button className={getTabClasses(selected)}>
Listed Items
</button>
)}
</Tab>
</Tab.List>
<Tab.Panels>
<Tab.Panel>
<ProfileAccountItems address={address} />
</Tab.Panel>
<Tab.Panel>
<ProfileListings address={address} />
</Tab.Panel>
</Tab.Panels>
</Tab.Group>
</main>
</div>
)
}