mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 22:30:23 +00:00
feat: redirecting to vanity url
This commit is contained in:
parent
d9c0bf232c
commit
556211d536
@ -1,4 +1,5 @@
|
|||||||
import { NextPage, NextPageContext } from 'next'
|
import { NextPage, NextPageContext } from 'next'
|
||||||
|
import { useRouter } from 'next/router'
|
||||||
import dynamic from 'next/dynamic'
|
import dynamic from 'next/dynamic'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { SnowflakeUtil } from 'discord.js'
|
import { SnowflakeUtil } from 'discord.js'
|
||||||
@ -23,10 +24,10 @@ const LongButton = dynamic(()=> import('@components/LongButton'))
|
|||||||
const Advertisement = dynamic(()=> import('@components/Advertisement'))
|
const Advertisement = dynamic(()=> import('@components/Advertisement'))
|
||||||
const Tooltip = dynamic(()=> import('@components/Tooltip'))
|
const Tooltip = dynamic(()=> import('@components/Tooltip'))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const Bots: NextPage<BotsProps> = ({ data, date }) => {
|
const Bots: NextPage<BotsProps> = ({ data, date }) => {
|
||||||
|
const router = useRouter()
|
||||||
if (!data || !data.id) return <NotFound />
|
if (!data || !data.id) return <NotFound />
|
||||||
|
if(data.vanity && data.vanity !== router.query.id) router.push(`/bots/${data.vanity}`)
|
||||||
return <Container paddingTop className='py-10'>
|
return <Container paddingTop className='py-10'>
|
||||||
<SEO
|
<SEO
|
||||||
title={data.name}
|
title={data.name}
|
||||||
@ -80,7 +81,7 @@ const Bots: NextPage<BotsProps> = ({ data, date }) => {
|
|||||||
<i className='fas fa-user-plus text-discord-blurple' /> 초대하기
|
<i className='fas fa-user-plus text-discord-blurple' /> 초대하기
|
||||||
</h4>
|
</h4>
|
||||||
</LongButton>
|
</LongButton>
|
||||||
<LongButton>
|
<LongButton href={`/bots/${router.query.id}/vote`}>
|
||||||
<h4>
|
<h4>
|
||||||
<i className='fas fa-heart text-red-600' /> 하트 추가
|
<i className='fas fa-heart text-red-600' /> 하트 추가
|
||||||
</h4>
|
</h4>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user