mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 14:30:22 +00:00
feat: using absolute routes
This commit is contained in:
parent
f3d7dd19ee
commit
546c882413
@ -1,9 +1,16 @@
|
|||||||
import { NextPage } from 'next'
|
import { NextPage } from 'next'
|
||||||
import Notice from '../components/Notice'
|
import { ErrorText } from '@utils/Constants'
|
||||||
import { ErrorText } from '../utils/Constants'
|
|
||||||
|
|
||||||
const NotFound: NextPage = () => {
|
const NotFound: NextPage = () => {
|
||||||
return <Notice header='404' desc={ErrorText[404]} />
|
return <div className='h-screen flex md:flex-col items-center justify-center' style={{ background: 'url("https://cdn.discordapp.com/attachments/745844596176715806/799149423505440768/1590927393326.jpg")' }}>
|
||||||
|
<div className='text-center'>
|
||||||
|
<h1 className='w-inline-block text-4xl font-bold align-top border-none md:border-r md:border-solid md:border-current m-0 md:mr-10 py-10 md:pr-10'>404</h1>
|
||||||
|
|
||||||
|
<h2 className='inline-block text-2xl md:text-4xl font-semibold align-top m-0 py-10'>
|
||||||
|
{ ErrorText[404] }
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NotFound
|
export default NotFound
|
||||||
|
|||||||
@ -3,8 +3,8 @@ import type { AppProps } from 'next/app'
|
|||||||
import { ThemeProvider } from 'next-themes'
|
import { ThemeProvider } from 'next-themes'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
|
|
||||||
import Footer from '../components/Footer'
|
import Footer from '@components/Footer'
|
||||||
import Navbar from '../components/Navbar'
|
import Navbar from '@components/Navbar'
|
||||||
import Crypto from 'crypto'
|
import Crypto from 'crypto'
|
||||||
|
|
||||||
import secret from '../secret.json'
|
import secret from '../secret.json'
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
import { NextPage, NextPageContext } from 'next'
|
import { NextPage, NextPageContext } from 'next'
|
||||||
import Notice from '../components/Notice'
|
import { ErrorText } from '@utils/Constants'
|
||||||
import { ErrorText } from '../utils/Constants'
|
|
||||||
|
|
||||||
const CustomError:NextPage<ErrorProps> = ({ statusCode, statusText }) => {
|
const CustomError:NextPage<ErrorProps> = ({ statusCode, statusText }) => {
|
||||||
return <Notice header={String(statusCode)} desc={statusText} />
|
return <div className='h-screen flex flex-col items-center'></div>
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getServerSideProps = ({ res, err }:NextPageContext) => {
|
export const getServerSideProps = ({ res, err }:NextPageContext) => {
|
||||||
@ -30,5 +29,5 @@ export default CustomError
|
|||||||
|
|
||||||
interface ErrorProps {
|
interface ErrorProps {
|
||||||
statusCode: number
|
statusCode: number
|
||||||
statusText: string
|
statusText?: string
|
||||||
}
|
}
|
||||||
@ -1,13 +1,12 @@
|
|||||||
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next'
|
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next'
|
||||||
import { ResponseWrapper } from '../../../utils'
|
import ResponseWrapper from '@utils/ResponseWrapper'
|
||||||
|
|
||||||
const Deprecated: NextApiHandler = (_req: NextApiRequest, res: NextApiResponse) => {
|
const Deprecated: NextApiHandler = (_req: NextApiRequest, res: NextApiResponse):void => {
|
||||||
const response = ResponseWrapper(res, {
|
return ResponseWrapper(res, {
|
||||||
code: 406,
|
code: 406,
|
||||||
message: '해당 API 버전은 지원 종료되었습니다.',
|
message: '해당 API 버전은 지원 종료되었습니다.',
|
||||||
version: 1,
|
version: 1,
|
||||||
})
|
})
|
||||||
res.json(response)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Deprecated
|
export default Deprecated
|
||||||
|
|||||||
@ -1,24 +1,25 @@
|
|||||||
import { NextPage, NextPageContext } from 'next'
|
import { NextPage, NextPageContext } from 'next'
|
||||||
import { SnowflakeUtil } from 'discord.js'
|
|
||||||
import Day from '../../utils/Day'
|
|
||||||
import { ParsedUrlQuery } from 'querystring'
|
|
||||||
import { Bot, User } from '../../types'
|
|
||||||
|
|
||||||
import Container from '../../components/Container'
|
|
||||||
import DiscordAvatar from '../../components/DiscordAvatar'
|
|
||||||
import Divider from '../../components/Divider'
|
|
||||||
import Tag from '../../components/Tag'
|
|
||||||
import Owner from '../../components/Owner'
|
|
||||||
import Segment from '../../components/Segment'
|
|
||||||
import NotFound from '../404'
|
|
||||||
import SEO from '../../components/SEO'
|
|
||||||
import LongButton from '../../components/LongButton'
|
|
||||||
import { git, Status } from '../../utils/Constants'
|
|
||||||
import { Query } from '../../utils'
|
|
||||||
import { formatNumber } from '../../utils/Tools'
|
|
||||||
import Advertisement from '../../components/Advertisement'
|
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import Tooltip from '../../components/Tooltip'
|
import { SnowflakeUtil } from 'discord.js'
|
||||||
|
import { ParsedUrlQuery } from 'querystring'
|
||||||
|
import { Bot, User } from '@types'
|
||||||
|
|
||||||
|
import { git, Status } from '@utils/Constants'
|
||||||
|
import * as Query from '@utils/Query'
|
||||||
|
import Day from '@utils/Day'
|
||||||
|
import { formatNumber } from '@utils/Tools'
|
||||||
|
|
||||||
|
import Container from '@components/Container'
|
||||||
|
import DiscordAvatar from '@components/DiscordAvatar'
|
||||||
|
import Divider from '@components/Divider'
|
||||||
|
import Tag from '@components/Tag'
|
||||||
|
import Owner from '@components/Owner'
|
||||||
|
import Segment from '@components/Segment'
|
||||||
|
import SEO from '@components/SEO'
|
||||||
|
import LongButton from '@components/LongButton'
|
||||||
|
import Advertisement from '@components/Advertisement'
|
||||||
|
import Tooltip from '@components/Tooltip'
|
||||||
|
import NotFound from '../404'
|
||||||
|
|
||||||
const Bots: NextPage<BotsProps> = ({ data, date }) => {
|
const Bots: NextPage<BotsProps> = ({ data, date }) => {
|
||||||
if (!data || !data.id) return <NotFound />
|
if (!data || !data.id) return <NotFound />
|
||||||
|
|||||||
@ -1,14 +1,16 @@
|
|||||||
import { useTheme } from 'next-themes'
|
import { useTheme } from 'next-themes'
|
||||||
import { useFormik } from 'formik'
|
import { useFormik } from 'formik'
|
||||||
|
|
||||||
import Container from '../components/Container'
|
|
||||||
import Divider from '../components/Divider'
|
|
||||||
import Segment from '../components/Segment'
|
|
||||||
import Package from '../package.json'
|
|
||||||
import { anchorHeader, checkBrowser } from '../utils/Tools'
|
|
||||||
import MarkdownView from 'react-showdown'
|
import MarkdownView from 'react-showdown'
|
||||||
import sanitizeHtml from 'sanitize-html'
|
import sanitizeHtml from 'sanitize-html'
|
||||||
import { useEffect } from 'react'
|
|
||||||
|
import { anchorHeader, checkBrowser } from '@utils/Tools'
|
||||||
|
|
||||||
|
import Container from '@components/Container'
|
||||||
|
import Divider from '@components/Divider'
|
||||||
|
import Segment from '@components/Segment'
|
||||||
|
|
||||||
|
import Package from '../package.json'
|
||||||
|
|
||||||
|
|
||||||
const ClientInfo = ( ):JSX.Element => {
|
const ClientInfo = ( ):JSX.Element => {
|
||||||
const formik = useFormik({
|
const formik = useFormik({
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { NextPage } from 'next'
|
import { NextPage } from 'next'
|
||||||
import Docs from '../components/Docs'
|
import Docs from '@components/Docs'
|
||||||
|
|
||||||
const Privacy: NextPage = () => {
|
const Privacy: NextPage = () => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
import { NextPage } from 'next'
|
import { NextPage } from 'next'
|
||||||
import dynamic from 'next/dynamic'
|
import dynamic from 'next/dynamic'
|
||||||
import Paginator from '../components/Paginator'
|
import Paginator from '@components/Paginator'
|
||||||
import Search from '../components/Search'
|
import Search from '@components/Search'
|
||||||
import Tag from '../components/Tag'
|
import Tag from '@components/Tag'
|
||||||
|
|
||||||
import { BotList } from '../types'
|
import { BotList } from '@types'
|
||||||
import { Query } from '../utils'
|
import * as Query from '@utils/Query'
|
||||||
import { cats } from '../utils/Constants'
|
import { cats } from '@utils/Constants'
|
||||||
|
|
||||||
const Advertisement = dynamic(()=> import('../components/Advertisement'))
|
const Advertisement = dynamic(()=> import('@components/Advertisement'))
|
||||||
const Container = dynamic(()=> import('../components/Container'))
|
const Container = dynamic(()=> import('@components/Container'))
|
||||||
const BotCard = dynamic(()=> import('../components/BotCard'))
|
const BotCard = dynamic(()=> import('@components/BotCard'))
|
||||||
const Wave = dynamic(()=> import('../components/Wave'))
|
const Wave = dynamic(()=> import('@components/Wave'))
|
||||||
|
|
||||||
const Index: NextPage<IndexProps> = ({ votes, newBots, trusted }) => {
|
const Index: NextPage<IndexProps> = ({ votes, newBots, trusted }) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
import { NextPage, NextPageContext } from 'next'
|
import { NextPage, NextPageContext } from 'next'
|
||||||
import { ParsedUrlQuery } from 'querystring'
|
import { ParsedUrlQuery } from 'querystring'
|
||||||
import Advertisement from '../../components/Advertisement'
|
|
||||||
import BotCard from '../../components/BotCard'
|
|
||||||
|
|
||||||
import Container from '../../components/Container'
|
import { BotList } from '@types'
|
||||||
import Paginator from '../../components/Paginator'
|
import * as Query from '@utils/Query'
|
||||||
import { BotList } from '../../types'
|
|
||||||
import { Query } from '../../utils'
|
import Advertisement from '@components/Advertisement'
|
||||||
|
import BotCard from '@components/BotCard'
|
||||||
|
import Container from '@components/Container'
|
||||||
|
import Paginator from '@components/Paginator'
|
||||||
import NotFound from '../404'
|
import NotFound from '../404'
|
||||||
|
|
||||||
const Votes:NextPage<VotesProps> = ({ data }:VotesProps) => {
|
const Votes:NextPage<VotesProps> = ({ data }:VotesProps) => {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { NextPage } from 'next'
|
import { NextPage } from 'next'
|
||||||
import Docs from '../components/Docs'
|
import Docs from '@components/Docs'
|
||||||
|
|
||||||
const Privacy: NextPage = () => {
|
const Privacy: NextPage = () => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -1,20 +1,20 @@
|
|||||||
import { NextPage, NextPageContext } from 'next'
|
import { NextPage, NextPageContext } from 'next'
|
||||||
import { SnowflakeUtil } from 'discord.js'
|
import { SnowflakeUtil } from 'discord.js'
|
||||||
import { Query } from '../../utils'
|
import * as Query from '@utils/Query'
|
||||||
import { ParsedUrlQuery } from 'querystring'
|
import { ParsedUrlQuery } from 'querystring'
|
||||||
import { josa } from 'josa'
|
import { josa } from 'josa'
|
||||||
import { Bot, User } from '../../types'
|
import { Bot, User } from '@types'
|
||||||
|
|
||||||
import NotFound from '../404'
|
import NotFound from '../404'
|
||||||
import Container from '../../components/Container'
|
import Container from '@components/Container'
|
||||||
import SEO from '../../components/SEO'
|
import SEO from '@components/SEO'
|
||||||
import DiscordAvatar from '../../components/DiscordAvatar'
|
import DiscordAvatar from '@components/DiscordAvatar'
|
||||||
import Divider from '../../components/Divider'
|
import Divider from '@components/Divider'
|
||||||
import BotCard from '../../components/BotCard'
|
import BotCard from '@components/BotCard'
|
||||||
import Tag from '../../components/Tag'
|
import Tag from '@components/Tag'
|
||||||
import { checkPerm } from '../../utils/Tools'
|
import { checkPerm } from '@utils/Tools'
|
||||||
import Advertisement from '../../components/Advertisement'
|
import Advertisement from '@components/Advertisement'
|
||||||
import Tooltip from '../../components/Tooltip'
|
import Tooltip from '@components/Tooltip'
|
||||||
const Users: NextPage<UserProps> = ({ data }) => {
|
const Users: NextPage<UserProps> = ({ data }) => {
|
||||||
if (!data.id) return <NotFound />
|
if (!data.id) return <NotFound />
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -1,5 +1,12 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"@components/*": ["components/*"],
|
||||||
|
"@utils/*": ["utils/*"],
|
||||||
|
"@types": ["types/index.ts"]
|
||||||
|
|
||||||
|
},
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user