Moved items to server
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
"use client"
|
||||||
|
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
import { useEffect, useState } from "react"
|
import { useEffect, useState } from "react"
|
||||||
import { Tooltip } from "react-tooltip"
|
import { Tooltip } from "react-tooltip"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { Button } from "@/components/ui/button"
|
||||||
import { Card, CardContent } from "@/components/ui/card"
|
import { Card, CardContent } from "@/components/ui/card"
|
||||||
import { Separator } from "@/components/ui/separator"
|
import { Separator } from "@/components/ui/separator"
|
||||||
import { getColor } from "@/lib/colors"
|
import { getColor } from "@/lib/colors"
|
||||||
@@ -143,6 +144,16 @@ export default function Sidebar({ level, ign, player, guild, rank, specialRank,
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function SkyblockButton() {
|
||||||
|
return (
|
||||||
|
<Button asChild variant="outline">
|
||||||
|
<Link href={`https://sky.shiiyu.moe/stats/${player.displayname}`}>
|
||||||
|
View SkyBlock Stats
|
||||||
|
</Link>
|
||||||
|
</Button>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
function GuildInfo() {
|
function GuildInfo() {
|
||||||
if (!guild) return null
|
if (!guild) return null
|
||||||
|
|
||||||
@@ -221,6 +232,8 @@ export default function Sidebar({ level, ign, player, guild, rank, specialRank,
|
|||||||
<Separator className="my-4" />
|
<Separator className="my-4" />
|
||||||
<Logins />
|
<Logins />
|
||||||
<Separator className="my-4" />
|
<Separator className="my-4" />
|
||||||
|
<SkyblockButton />
|
||||||
|
<Separator className="my-4" />
|
||||||
<GuildInfo />
|
<GuildInfo />
|
||||||
<SoicalLinks />
|
<SoicalLinks />
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
"use client"
|
|
||||||
|
|
||||||
import { Button } from "@/components/ui/button"
|
import { Button } from "@/components/ui/button"
|
||||||
import { CopyIcon } from "lucide-react"
|
|
||||||
import Link from "next/link"
|
import Link from "next/link"
|
||||||
import { CgWebsite } from "react-icons/cg"
|
import { CgWebsite } from "react-icons/cg"
|
||||||
import { FaDiscord, FaTwitch, FaYoutube } from "react-icons/fa"
|
import { FaTwitch, FaYoutube } from "react-icons/fa"
|
||||||
import { FiTwitter } from "react-icons/fi"
|
import { FiTwitter } from "react-icons/fi"
|
||||||
import { toast } from "sonner"
|
import { DiscordIcon } from "./client"
|
||||||
|
|
||||||
export default function SocialIcons(
|
export default function SocialIcons(
|
||||||
{ discord, twitch, youtube, twitter, hypixel }: {
|
{ discord, twitch, youtube, twitter, hypixel }: {
|
||||||
@@ -36,37 +33,6 @@ export default function SocialIcons(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function DiscordIcon({ username }: { username?: string }) {
|
|
||||||
if (!username) return null
|
|
||||||
|
|
||||||
function handleClick() {
|
|
||||||
toast(
|
|
||||||
<div className="flex gap-8">
|
|
||||||
<h1 className="text-2xl">{username}</h1>
|
|
||||||
<button
|
|
||||||
onClick={() => {
|
|
||||||
navigator.clipboard.writeText(username!)
|
|
||||||
toast.dismiss("discord-username")
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<CopyIcon />
|
|
||||||
</button>
|
|
||||||
</div>,
|
|
||||||
{
|
|
||||||
position: "bottom-center",
|
|
||||||
id: "discord-username",
|
|
||||||
className: "flex justify-center items-center gap-4"
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Button variant="ghost" className="transition-all hover:scale-125 hover:cursor-pointer" onClick={handleClick}>
|
|
||||||
<FaDiscord />
|
|
||||||
</Button>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
function SocialIcon({ href, children }: { href?: string, children: React.ReactNode }) {
|
function SocialIcon({ href, children }: { href?: string, children: React.ReactNode }) {
|
||||||
if (!href) return null
|
if (!href) return null
|
||||||
|
|
||||||
|
|||||||
37
src/app/(stats)/player/[ign]/_components/client.tsx
Normal file
37
src/app/(stats)/player/[ign]/_components/client.tsx
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
"use client"
|
||||||
|
|
||||||
|
import { Button } from "@/components/ui/button"
|
||||||
|
import { CopyIcon } from "lucide-react"
|
||||||
|
import { FaDiscord } from "react-icons/fa"
|
||||||
|
import { toast } from "sonner"
|
||||||
|
|
||||||
|
export function DiscordIcon({ username }: { username?: string }) {
|
||||||
|
if (!username) return null
|
||||||
|
|
||||||
|
function handleClick() {
|
||||||
|
toast(
|
||||||
|
<div className="flex gap-8">
|
||||||
|
<h1 className="text-2xl">{username}</h1>
|
||||||
|
<button
|
||||||
|
onClick={() => {
|
||||||
|
navigator.clipboard.writeText(username!)
|
||||||
|
toast.dismiss("discord-username")
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<CopyIcon />
|
||||||
|
</button>
|
||||||
|
</div>,
|
||||||
|
{
|
||||||
|
position: "bottom-center",
|
||||||
|
id: "discord-username",
|
||||||
|
className: "flex justify-center items-center gap-4"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Button variant="ghost" className="transition-all hover:scale-125 hover:cursor-pointer" onClick={handleClick}>
|
||||||
|
<FaDiscord />
|
||||||
|
</Button>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
"use client"
|
|
||||||
|
|
||||||
import { AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion"
|
import { AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion"
|
||||||
import { Card, CardContent } from "@/components/ui/card"
|
import { Card, CardContent } from "@/components/ui/card"
|
||||||
import { Separator } from "@/components/ui/separator"
|
import { Separator } from "@/components/ui/separator"
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
"use client"
|
|
||||||
|
|
||||||
import { AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion"
|
import { AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion"
|
||||||
import { Card, CardContent } from "@/components/ui/card"
|
import { Card, CardContent } from "@/components/ui/card"
|
||||||
import { Separator } from "@/components/ui/separator"
|
import { Separator } from "@/components/ui/separator"
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
"use client"
|
|
||||||
|
|
||||||
import * as SeparatorPrimitive from "@radix-ui/react-separator"
|
import * as SeparatorPrimitive from "@radix-ui/react-separator"
|
||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
"use client"
|
|
||||||
|
|
||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
|
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
|
|||||||
Reference in New Issue
Block a user