-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,484 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NEXT_PUBLIC_METAGAME_GRAPHQL_API=https://api.metagame.wtf/v1/graphql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
"use client" | ||
|
||
import React from 'react'; | ||
import { useQuery } from "@apollo/client"; | ||
import { profileQuery } from "@/services/apollo"; | ||
import { toHTTP } from '@/utils/ipfs'; | ||
import { useParams } from 'next/navigation'; | ||
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" | ||
import { | ||
Menubar, | ||
MenubarContent, | ||
MenubarItem, | ||
MenubarMenu, | ||
MenubarSeparator, | ||
MenubarShortcut, | ||
MenubarTrigger, | ||
} from "@/components/ui/menubar" | ||
|
||
const Page: React.FC = () => { | ||
// Get the address from the router params | ||
const router = useParams(); | ||
const address = router.address as string; | ||
|
||
// Fetch the profile data using Apollo useQuery hook | ||
const { loading, error, data } = useQuery(profileQuery, { | ||
variables: { address }, | ||
}); | ||
|
||
// Render loading state if data is still loading | ||
if (loading) { | ||
return <p>Loading...</p>; | ||
} | ||
|
||
// Render error message if user is not found | ||
if (error || !data?.player[0]) { | ||
return <p>Error: User not found</p>; | ||
} | ||
console.log(data?.player[0]) | ||
// Render the profile information | ||
return ( | ||
<main> | ||
<Menubar className='flex items-center justify-space-between height-10 w-full'> | ||
<Avatar> | ||
<AvatarImage src="https://i.imgur.com/tQfcTRL.png" /> | ||
<AvatarFallback>CN</AvatarFallback> | ||
</Avatar> | ||
<MenubarMenu> | ||
<MenubarTrigger>File</MenubarTrigger> | ||
<MenubarContent> | ||
<MenubarItem> | ||
New Tab <MenubarShortcut>⌘T</MenubarShortcut> | ||
</MenubarItem> | ||
<MenubarItem>New Window</MenubarItem> | ||
<MenubarSeparator /> | ||
<MenubarItem>Share</MenubarItem> | ||
<MenubarSeparator /> | ||
<MenubarItem>Print</MenubarItem> | ||
</MenubarContent> | ||
</MenubarMenu> | ||
</Menubar> | ||
<h1>MetaLink</h1> | ||
<img | ||
src={toHTTP(data?.player[0]?.profile.profileImageURL ?? '')} | ||
alt="Picture of the author" | ||
/> | ||
<h2>{data?.player[0]?.profile?.name ?? ''}</h2> | ||
<p>{data?.player[0]?.profile?.description ?? ''}</p> | ||
<ul> | ||
{data?.player[0]?.links.map((link: any, index: number) => ( | ||
<li key={index}> | ||
<a href={link.url}>{link.name}</a> | ||
</li> | ||
))} | ||
{data?.player[0]?.guilds.map((guild: any, index: number) => ( | ||
<li key={index}> | ||
<img src={toHTTP(guild.Guild.logo)} style={{ height: '50px', width: '50px' }} /> | ||
<a href="">{guild.Guild.guildname}</a> | ||
</li> | ||
))} | ||
</ul> | ||
</main> | ||
); | ||
}; | ||
|
||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,76 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
:root { | ||
--foreground-rgb: 0, 0, 0; | ||
--background-start-rgb: 214, 219, 220; | ||
--background-end-rgb: 255, 255, 255; | ||
} | ||
|
||
@media (prefers-color-scheme: dark) { | ||
|
||
@layer base { | ||
:root { | ||
--foreground-rgb: 255, 255, 255; | ||
--background-start-rgb: 0, 0, 0; | ||
--background-end-rgb: 0, 0, 0; | ||
} | ||
} | ||
--background: 0 0% 100%; | ||
--foreground: 224 71.4% 4.1%; | ||
|
||
body { | ||
color: rgb(var(--foreground-rgb)); | ||
background: linear-gradient( | ||
to bottom, | ||
transparent, | ||
rgb(var(--background-end-rgb)) | ||
) | ||
rgb(var(--background-start-rgb)); | ||
} | ||
--card: 0 0% 100%; | ||
--card-foreground: 224 71.4% 4.1%; | ||
|
||
--popover: 0 0% 100%; | ||
--popover-foreground: 224 71.4% 4.1%; | ||
|
||
--primary: 220.9 39.3% 11%; | ||
--primary-foreground: 210 20% 98%; | ||
|
||
--secondary: 220 14.3% 95.9%; | ||
--secondary-foreground: 220.9 39.3% 11%; | ||
|
||
--muted: 220 14.3% 95.9%; | ||
--muted-foreground: 220 8.9% 46.1%; | ||
|
||
--accent: 220 14.3% 95.9%; | ||
--accent-foreground: 220.9 39.3% 11%; | ||
|
||
--destructive: 0 84.2% 60.2%; | ||
--destructive-foreground: 210 20% 98%; | ||
|
||
@layer utilities { | ||
.text-balance { | ||
text-wrap: balance; | ||
--border: 220 13% 91%; | ||
--input: 220 13% 91%; | ||
--ring: 224 71.4% 4.1%; | ||
|
||
--radius: 0.5rem; | ||
} | ||
|
||
.dark { | ||
--background: 224 71.4% 4.1%; | ||
--foreground: 210 20% 98%; | ||
|
||
--card: 224 71.4% 4.1%; | ||
--card-foreground: 210 20% 98%; | ||
|
||
--popover: 224 71.4% 4.1%; | ||
--popover-foreground: 210 20% 98%; | ||
|
||
--primary: 210 20% 98%; | ||
--primary-foreground: 220.9 39.3% 11%; | ||
|
||
--secondary: 215 27.9% 16.9%; | ||
--secondary-foreground: 210 20% 98%; | ||
|
||
--muted: 215 27.9% 16.9%; | ||
--muted-foreground: 217.9 10.6% 64.9%; | ||
|
||
--accent: 215 27.9% 16.9%; | ||
--accent-foreground: 210 20% 98%; | ||
|
||
--destructive: 0 62.8% 30.6%; | ||
--destructive-foreground: 210 20% 98%; | ||
|
||
--border: 215 27.9% 16.9%; | ||
--input: 215 27.9% 16.9%; | ||
--ring: 216 12.2% 83.9%; | ||
} | ||
} | ||
|
||
@layer base { | ||
* { | ||
@apply border-border; | ||
} | ||
body { | ||
@apply bg-background text-foreground; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"$schema": "https://ui.shadcn.com/schema.json", | ||
"style": "new-york", | ||
"rsc": true, | ||
"tsx": true, | ||
"tailwind": { | ||
"config": "tailwind.config.ts", | ||
"css": "app/globals.css", | ||
"baseColor": "gray", | ||
"cssVariables": true, | ||
"prefix": "" | ||
}, | ||
"aliases": { | ||
"components": "@/components", | ||
"utils": "@/lib/utils" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"use client" | ||
|
||
import * as React from "react" | ||
import { ThemeProvider as NextThemesProvider } from "next-themes" | ||
import { type ThemeProviderProps } from "next-themes/dist/types" | ||
|
||
export function ThemeProvider({ children, ...props }: ThemeProviderProps) { | ||
return <NextThemesProvider {...props}>{children}</NextThemesProvider> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
"use client" | ||
|
||
import * as React from "react" | ||
import * as AvatarPrimitive from "@radix-ui/react-avatar" | ||
|
||
import { cn } from "@/lib/utils" | ||
|
||
const Avatar = React.forwardRef< | ||
React.ElementRef<typeof AvatarPrimitive.Root>, | ||
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> | ||
>(({ className, ...props }, ref) => ( | ||
<AvatarPrimitive.Root | ||
ref={ref} | ||
className={cn( | ||
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
)) | ||
Avatar.displayName = AvatarPrimitive.Root.displayName | ||
|
||
const AvatarImage = React.forwardRef< | ||
React.ElementRef<typeof AvatarPrimitive.Image>, | ||
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image> | ||
>(({ className, ...props }, ref) => ( | ||
<AvatarPrimitive.Image | ||
ref={ref} | ||
className={cn("aspect-square h-full w-full", className)} | ||
{...props} | ||
/> | ||
)) | ||
AvatarImage.displayName = AvatarPrimitive.Image.displayName | ||
|
||
const AvatarFallback = React.forwardRef< | ||
React.ElementRef<typeof AvatarPrimitive.Fallback>, | ||
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback> | ||
>(({ className, ...props }, ref) => ( | ||
<AvatarPrimitive.Fallback | ||
ref={ref} | ||
className={cn( | ||
"flex h-full w-full items-center justify-center rounded-full bg-muted", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
)) | ||
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName | ||
|
||
export { Avatar, AvatarImage, AvatarFallback } |
Oops, something went wrong.