Skip to content

Commit

Permalink
chore: apply prettier (#637)
Browse files Browse the repository at this point in the history
* chore: apply prettier

* chore: edit ready comment

* chore: move ts comment
  • Loading branch information
skinmaker1345 authored Nov 29, 2023
1 parent a324106 commit b421d1a
Show file tree
Hide file tree
Showing 152 changed files with 8,340 additions and 5,104 deletions.
42 changes: 24 additions & 18 deletions components/Advertisement.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
import AdSense from 'react-adsense'

const Advertisement: React.FC<AdvertisementProps> = ({ size = 'short' }) => {
return <div className='py-5'>
<div
className={`z-0 mx-auto w-full text-center text-white ${
process.env.NODE_ENV === 'production' ? '' : 'py-12 bg-gray-700'
}`}
style={size === 'short' ? { height: '90px' } : { height: '330px' }}
>
{process.env.NODE_ENV === 'production' ? (
<AdSense.Google
style={{ display: 'inline-block', width: '100%', height: size === 'short' ? '90px' : '330px'}}
client='ca-pub-4856582423981759'
slot='3250141451'
format=''
/>
) : (
'Advertisement'
)}
return (
<div className='py-5'>
<div
className={`z-0 mx-auto w-full text-center text-white ${
process.env.NODE_ENV === 'production' ? '' : 'bg-gray-700 py-12'
}`}
style={size === 'short' ? { height: '90px' } : { height: '330px' }}
>
{process.env.NODE_ENV === 'production' ? (
<AdSense.Google
style={{
display: 'inline-block',
width: '100%',
height: size === 'short' ? '90px' : '330px',
}}
client='ca-pub-4856582423981759'
slot='3250141451'
format=''
/>
) : (
'Advertisement'
)}
</div>
</div>
</div>
)
}

declare global {
Expand Down
15 changes: 7 additions & 8 deletions components/Application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ const ServerIcon = dynamic(() => import('@components/ServerIcon'))
const Application: React.FC<ApplicationProps> = ({ type, id, name }) => {
return (
<Link href={`/developers/applications/${type + 's'}/${id}`} legacyBehavior>
<div className='relative px-2 py-4 text-center dark:bg-discord-black bg-little-white rounded-lg cursor-pointer transform hover:-translate-y-1 transition duration-100 ease-in'>
{
type === 'bot' ?
<DiscordAvatar userID={id} className='px-2 w-full rounded-xl' /> :
<ServerIcon id={id} className='px-2 w-full rounded-xl' />
}
<h2 className='pt-2 whitespace-nowrap text-xl font-medium truncate'>{name}</h2>
<div className='relative transform cursor-pointer rounded-lg bg-little-white px-2 py-4 text-center transition duration-100 ease-in hover:-translate-y-1 dark:bg-discord-black'>
{type === 'bot' ? (
<DiscordAvatar userID={id} className='w-full rounded-xl px-2' />
) : (
<ServerIcon id={id} className='w-full rounded-xl px-2' />
)}
<h2 className='truncate whitespace-nowrap pt-2 text-xl font-medium'>{name}</h2>
</div>
</Link>
)

}

interface ApplicationProps {
Expand Down
65 changes: 30 additions & 35 deletions components/BotCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@ const DiscordAvatar = dynamic(() => import('@components/DiscordAvatar'))

const BotCard: React.FC<BotCardProps> = ({ manage = false, bot }) => {
return (
<div className='min-w-0 container mb-16 transform hover:-translate-y-1 transition duration-100 ease-in cursor-pointer'>
<div className='container mb-16 min-w-0 transform cursor-pointer transition duration-100 ease-in hover:-translate-y-1'>
<div className='relative'>
<div className='container mx-auto'>
<div className='h-full'>
<div
className='relative mx-auto h-full text-black dark:text-white dark:bg-discord-black bg-little-white rounded-2xl shadow-xl'
className='relative mx-auto h-full rounded-2xl bg-little-white text-black shadow-xl dark:bg-discord-black dark:text-white'
style={
checkBotFlag(bot.flags, 'trusted') && bot.banner
? {
background: `linear-gradient(to right, rgba(34, 36, 38, 0.68), rgba(34, 36, 38, 0.68)), url("${bot.banner}") center top / cover no-repeat`,
color: 'white',
}
background: `linear-gradient(to right, rgba(34, 36, 38, 0.68), rgba(34, 36, 38, 0.68)), url("${bot.banner}") center top / cover no-repeat`,
color: 'white',
}
: {}
}
>
<Link href={makeBotURL(bot)} legacyBehavior>
<div>
<div className='flex flex-col'>
<div className='flex'>
<div className='w-3/5 flex justify-start'>
<div className='flex w-3/5 justify-start'>
<DiscordAvatar
size={128}
userID={bot.id}
alt='Avatar'
className='absolute -left-2 -top-8 mx-auto w-32 h-32 bg-white rounded-full'
className='absolute -left-2 -top-8 mx-auto h-32 w-32 rounded-full bg-white'
/>
</div>
<div className='grid grid-cols-1 pr-5 pt-5 w-2/5'>
<div className='grid w-2/5 grid-cols-1 pr-5 pt-5'>
<Tag
text={
<>
Expand All @@ -55,19 +55,19 @@ const BotCard: React.FC<BotCardProps> = ({ manage = false, bot }) => {
</div>
</div>
</div>
<div className='mt-3 px-4 h-16'>
<div className='mt-3 h-16 px-4'>
<h2 className='px-1 text-sm'>
<i className={`fas fa-circle text-${Status[bot.status]?.color}`} />
{Status[bot.status]?.text}
</h2>
<h1 className='mb-3 text-left text-xl sm:text-2xl font-bold truncate'>{bot.name}</h1>
<h1 className='mb-3 truncate text-left text-xl font-bold sm:text-2xl'>
{bot.name}
</h1>
</div>
<p className='mb-10 px-4 h-6 text-left text-gray-400 text-sm'>
{bot.intro}
</p>
<p className='mb-10 h-6 px-4 text-left text-sm text-gray-400'>{bot.intro}</p>
<div>
<div className='category flex flex-wrap px-2'>
{bot.category.slice(0, 3).map(el => (
{bot.category.slice(0, 3).map((el) => (
<Tag key={el} text={el} href={`/bots/categories/${el}`} dark />
))}{' '}
{bot.category.length > 3 && <Tag text={`+${bot.category.length - 3}`} dark />}
Expand All @@ -80,35 +80,31 @@ const BotCard: React.FC<BotCardProps> = ({ manage = false, bot }) => {
<div className='flex justify-evenly'>
<Link
href={makeBotURL(bot)}
className='py-3 w-full text-center text-koreanbots-blue hover:text-white text-sm font-bold hover:bg-koreanbots-blue rounded-bl-2xl hover:shadow-lg transition duration-100 ease-in'>

보기

className='w-full rounded-bl-2xl py-3 text-center text-sm font-bold text-koreanbots-blue transition duration-100 ease-in hover:bg-koreanbots-blue hover:text-white hover:shadow-lg'
>
보기
</Link>
{manage ? (
<Link
href={`/bots/${bot.id}/edit`}
className='py-3 w-full text-center text-emerald-500 hover:text-white text-sm font-bold hover:bg-emerald-500 rounded-br-2xl hover:shadow-lg transition duration-100 ease-in'>

관리하기

className='w-full rounded-br-2xl py-3 text-center text-sm font-bold text-emerald-500 transition duration-100 ease-in hover:bg-emerald-500 hover:text-white hover:shadow-lg'
>
관리하기
</Link>
) : bot.state !== 'ok' ? <a
className='py-3 w-full text-center text-discord-blurple text-sm font-bold rounded-br-2xl hover:shadow-lg transition duration-100 ease-in opacity-50 cursor-default select-none'
>
초대하기
</a> :
) : bot.state !== 'ok' ? (
<a className='w-full cursor-default select-none rounded-br-2xl py-3 text-center text-sm font-bold text-discord-blurple opacity-50 transition duration-100 ease-in hover:shadow-lg'>
초대하기
</a>
) : (
<a
href={
makeBotURL(bot) + '/invite'
}
href={makeBotURL(bot) + '/invite'}
rel='noopener noreferrer'
target='_blank'
className='py-3 w-full text-center text-discord-blurple hover:text-white text-sm font-bold hover:bg-discord-blurple rounded-br-2xl hover:shadow-lg transition duration-100 ease-in'
className='w-full rounded-br-2xl py-3 text-center text-sm font-bold text-discord-blurple transition duration-100 ease-in hover:bg-discord-blurple hover:text-white hover:shadow-lg'
>
초대하기
초대하기
</a>
}
)}
</div>
</div>
</div>
Expand All @@ -117,12 +113,11 @@ const BotCard: React.FC<BotCardProps> = ({ manage = false, bot }) => {
</div>
</div>
)

}

interface BotCardProps {
manage?: boolean
bot: Bot
}

export default BotCard
export default BotCard
48 changes: 28 additions & 20 deletions components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,41 @@ const Button: React.FC<ButtonProps> = ({
className,
children,
href,
disabled=false,
disabled = false,
onClick,
}) => {
return href ? <Link
href={!disabled && href}
className={`cursor-pointer rounded-md px-4 py-2 transition duration-300 ease select-none outline-none foucs:outline-none mr-1.5 ${className ??
'bg-discord-blurple hover:opacity-80 dark:bg-very-black dark:hover:bg-discord-dark-hover text-white'}`}>

{children}

</Link>
: onClick ? <button
return href ? (
<Link
href={!disabled && href}
className={`ease foucs:outline-none mr-1.5 cursor-pointer select-none rounded-md px-4 py-2 outline-none transition duration-300 ${
className ??
'bg-discord-blurple text-white hover:opacity-80 dark:bg-very-black dark:hover:bg-discord-dark-hover'
}`}
>
{children}
</Link>
) : onClick ? (
<button
type={disabled ? 'button' : type}
onClick={disabled ? null : onClick}
className={`cursor-pointer rounded-md px-4 py-2 transition duration-300 ease select-none outline-none foucs:outline-none mr-1.5 ${className ??
'bg-discord-blurple hover:opacity-80 dark:bg-very-black dark:hover:bg-discord-dark-hover text-white'}`}
className={`ease foucs:outline-none mr-1.5 cursor-pointer select-none rounded-md px-4 py-2 outline-none transition duration-300 ${
className ??
'bg-discord-blurple text-white hover:opacity-80 dark:bg-very-black dark:hover:bg-discord-dark-hover'
}`}
>
{children}
</button>
) : (
<button
type={disabled ? 'button' : type}
className={`ease foucs:outline-none mr-1.5 cursor-pointer select-none rounded-md px-4 py-2 outline-none transition duration-300 ${
className ??
'bg-discord-blurple text-white hover:opacity-80 dark:bg-very-black dark:hover:bg-discord-dark-hover'
}`}
>
{children}
</button>
:
<button
type={disabled ? 'button' : type}
className={`cursor-pointer rounded-md px-4 py-2 transition duration-300 ease select-none outline-none foucs:outline-none mr-1.5 ${className ??
'bg-discord-blurple hover:opacity-80 dark:bg-very-black dark:hover:bg-discord-dark-hover text-white'}`}
>
{children}
</button>
)
}

interface ButtonProps {
Expand Down
17 changes: 11 additions & 6 deletions components/Captcha.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import { Ref } from 'react'
import HCaptcha from '@hcaptcha/react-hcaptcha'


const Captcha: React.FC<CaptchaProps> = ({ dark, onVerify }) => {
return <HCaptcha sitekey={process.env.NEXT_PUBLIC_HCAPTCHA_SITEKEY} theme={dark ? 'dark' : 'light'} onVerify={onVerify}/>
return (
<HCaptcha
sitekey={process.env.NEXT_PUBLIC_HCAPTCHA_SITEKEY}
theme={dark ? 'dark' : 'light'}
onVerify={onVerify}
/>
)
}

interface CaptchaProps {
dark: boolean
onVerify(token: string, eKey?: string): void
ref?: Ref<HCaptcha>
dark: boolean
onVerify(token: string, eKey?: string): void
ref?: Ref<HCaptcha>
}

export default Captcha
export default Captcha
2 changes: 1 addition & 1 deletion components/ColorCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const ColorCard: React.FC<ColorCardProps> = ({ header, first, second, className
<div className={`rounded-lg p-10 ${className} shadow-lg`}>
<h2 className='text-2xl font-bold'>{header}</h2>
<p className='opacity-80'>
{first}
{first}
<br />
{second}
</p>
Expand Down
Loading

0 comments on commit b421d1a

Please sign in to comment.