feat: added calculator link

This commit is contained in:
wonderlandpark 2021-03-25 15:54:45 +09:00
parent 3f57eac291
commit aeccd1ae1d
2 changed files with 21 additions and 7 deletions

View File

@ -138,6 +138,11 @@ const AddBot:NextPage<AddBotProps> = ({ logged, user, csrfToken, theme }) => {
</Label>
<Label For='inviteLink' label='초대링크' labelDesc='봇의 초대링크입니다. 비워두시면 자동으로 생성합니다.' error={errors.url && touched.url ? errors.url : null}>
<Input name='url' placeholder='https://discord.com/oauth2/authorize?client_id=653534001742741552&scope=bot&permissions=0' />
<span className='text-gray-400 mt-1 text-sm'>
<Link href='/calculator'>
<a className='text-blue-500 hover:text-blue-400'></a>
</Link> !
</span>
</Label>
{
values.category.includes('빗금 명령어') && <Message type='warning'>

View File

@ -2,14 +2,15 @@ import { NextPage, NextPageContext } from 'next'
import { useState } from 'react'
import { useRouter } from 'next/router'
import dynamic from 'next/dynamic'
import Link from 'next/link'
import { Form, Formik } from 'formik'
import { ParsedUrlQuery } from 'node:querystring'
import { get } from '@utils/Query'
import { checkUserFlag, cleanObject, makeBotURL, parseCookie, redirectTo } from '@utils/Tools'
import { AddBotSubmit, ManageBot, ManageBotSchema } from '@utils/Yup'
import { ManageBot, ManageBotSchema } from '@utils/Yup'
import { categories, library } from '@utils/Constants'
import { Bot, ResponseProps, SubmittedBot, Theme, User } from '@types'
import { Bot, Theme, User } from '@types'
import { getToken } from '@utils/Csrf'
import Fetch from '@utils/Fetch'
@ -19,6 +20,7 @@ import Forbidden from '@components/Forbidden'
const Label = dynamic(() => import('@components/Form/Label'))
const Input = dynamic(() => import('@components/Form/Input'))
const Divider = dynamic(() => import('@components/Divider'))
const Redirect = dynamic(() => import('@components/Redirect'))
const TextArea = dynamic(() => import('@components/Form/TextArea'))
const Segment = dynamic(() => import('@components/Segment'))
const Markdown = dynamic(() => import('@components/Markdown'))
@ -78,11 +80,13 @@ const ManageBotPage:NextPage<ManageBotProps> = ({ bot, user, csrfToken, theme })
</div>
{
data ? data.code === 200 ? <div className='mt-4'>
<Redirect to={makeBotURL(bot)}>
<Message type='success'>
<h2 className='text-lg font-black'> .</h2>
<p> !</p>
{redirectTo(router, makeBotURL(bot))}
</Message>
</Redirect>
</div> : <div className='mt-4'>
<Message type='error'>
<h2 className='text-lg font-black'>{data.message || '오류가 발생했습니다.'}</h2>
@ -113,6 +117,11 @@ const ManageBotPage:NextPage<ManageBotProps> = ({ bot, user, csrfToken, theme })
</Label>
<Label For='inviteLink' label='초대링크' labelDesc='봇의 초대링크입니다. 비워두시면 자동으로 생성합니다.' error={errors.url && touched.url ? errors.url : null}>
<Input name='url' placeholder='https://discord.com/oauth2/authorize?client_id=653534001742741552&scope=bot&permissions=0' />
<span className='text-gray-400 mt-1 text-sm'>
<Link href='/calculator'>
<a className='text-blue-500 hover:text-blue-400'></a>
</Link> !
</span>
</Label>
{
values.category.includes('빗금 명령어') && <Message type='warning'>