mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 22:10:24 +00:00
style: suggestions at review
This commit is contained in:
parent
9ac121894c
commit
b473faa610
13
app.css
13
app.css
@ -152,10 +152,7 @@ button {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
box-shadow: 0 0 10px #3366FF, 0 0 5px #3366FF;
|
box-shadow: 0 0 10px #3366FF, 0 0 5px #3366FF;
|
||||||
opacity: 1.0;
|
opacity: 1.0;
|
||||||
|
transform: rotate(3deg) translate(0px, -4px);
|
||||||
-webkit-transform: rotate(3deg) translate(0px, -4px);
|
|
||||||
-ms-transform: rotate(3deg) translate(0px, -4px);
|
|
||||||
transform: rotate(3deg) translate(0px, -4px);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove these to get rid of the spinner */
|
/* Remove these to get rid of the spinner */
|
||||||
@ -176,9 +173,7 @@ button {
|
|||||||
border-top-color: #3366FF;
|
border-top-color: #3366FF;
|
||||||
border-left-color: #3366FF;
|
border-left-color: #3366FF;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
animation: nprogress-spinner 400ms linear infinite;
|
||||||
-webkit-animation: nprogress-spinner 400ms linear infinite;
|
|
||||||
animation: nprogress-spinner 400ms linear infinite;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.nprogress-custom-parent {
|
.nprogress-custom-parent {
|
||||||
@ -191,10 +186,6 @@ button {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
||||||
@-webkit-keyframes nprogress-spinner {
|
|
||||||
0% { -webkit-transform: rotate(0deg); }
|
|
||||||
100% { -webkit-transform: rotate(360deg); }
|
|
||||||
}
|
|
||||||
@keyframes nprogress-spinner {
|
@keyframes nprogress-spinner {
|
||||||
0% { transform: rotate(0deg); }
|
0% { transform: rotate(0deg); }
|
||||||
100% { transform: rotate(360deg); }
|
100% { transform: rotate(360deg); }
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import Logger from '@utils/Logger'
|
|
||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
|
import Logger from '@utils/Logger'
|
||||||
|
|
||||||
const Advertisement = ({ size = 'short' }: AdvertisementProps): JSX.Element => {
|
const Advertisement = ({ size = 'short' }: AdvertisementProps): JSX.Element => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
|
import dynamic from 'next/dynamic'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import DiscordAvatar from './DiscordAvatar'
|
|
||||||
|
const DiscordAvatar = dynamic(() => import('@components/DiscordAvatar'))
|
||||||
|
|
||||||
const Application = ({ type, id, name }: ApplicationProps): JSX.Element => {
|
const Application = ({ type, id, name }: ApplicationProps): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
|
import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
import { checkBotFlag, formatNumber, makeBotURL } from '@utils/Tools'
|
import { checkBotFlag, formatNumber, makeBotURL } from '@utils/Tools'
|
||||||
import { Status } from '@utils/Constants'
|
import { Status } from '@utils/Constants'
|
||||||
import { Bot } from '@types'
|
import { Bot } from '@types'
|
||||||
|
|
||||||
import Divider from '@components/Divider'
|
const Divider = dynamic(() => import('@components/Divider'))
|
||||||
import Tag from '@components/Tag'
|
const Tag = dynamic(() => import('@components/Tag'))
|
||||||
import DiscordAvatar from '@components/DiscordAvatar'
|
const DiscordAvatar = dynamic(() => import('@components/DiscordAvatar'))
|
||||||
|
|
||||||
const BotCard = ({ manage = false, bot }: BotProps): JSX.Element => {
|
const BotCard = ({ manage = false, bot }: BotProps): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import HCaptcha from '@hcaptcha/react-hcaptcha'
|
|
||||||
import { Ref } from 'react'
|
import { Ref } from 'react'
|
||||||
|
import HCaptcha from '@hcaptcha/react-hcaptcha'
|
||||||
|
|
||||||
|
|
||||||
const Captcha = ({ dark, onVerify }:CaptchaProps):JSX.Element => {
|
const Captcha = ({ dark, onVerify }:CaptchaProps):JSX.Element => {
|
||||||
return <HCaptcha sitekey='43e556b4-cc90-494f-b100-378b906bb736' theme={dark ? 'dark' : 'light'} onVerify={onVerify}/>
|
return <HCaptcha sitekey='43e556b4-cc90-494f-b100-378b906bb736' theme={dark ? 'dark' : 'light'} onVerify={onVerify}/>
|
||||||
|
|||||||
@ -11,39 +11,39 @@ const DiscordAvatar = (props: {
|
|||||||
}) => {
|
}) => {
|
||||||
const fallback = '/img/default.png'
|
const fallback = '/img/default.png'
|
||||||
const [ webpUnavailable, setWebpUnavailable ] = useState<boolean>()
|
const [ webpUnavailable, setWebpUnavailable ] = useState<boolean>()
|
||||||
|
|
||||||
useEffect(()=> {
|
useEffect(()=> {
|
||||||
setWebpUnavailable(localStorage.webp === 'false')
|
setWebpUnavailable(localStorage.webp === 'false')
|
||||||
}, [])
|
}, [])
|
||||||
return (
|
|
||||||
<img
|
return <img
|
||||||
alt={props.alt ?? 'Image'}
|
alt={props.alt ?? 'Image'}
|
||||||
loading='lazy'
|
loading='lazy'
|
||||||
className={props.className}
|
className={props.className}
|
||||||
src={
|
src={
|
||||||
KoreanbotsEndPoints.CDN.avatar(props.userID, { format: !webpUnavailable ? 'webp' : 'png', size: props.size ?? 256})
|
KoreanbotsEndPoints.CDN.avatar(props.userID, { format: !webpUnavailable ? 'webp' : 'png', size: props.size ?? 256})
|
||||||
}
|
}
|
||||||
onError={(e: SyntheticEvent<HTMLImageElement, ImageEvent>)=> {
|
onError={(e: SyntheticEvent<HTMLImageElement, ImageEvent>)=> {
|
||||||
if(webpUnavailable) {
|
if(webpUnavailable) {
|
||||||
(e.target as ImageTarget).onerror = (event) => {
|
(e.target as ImageTarget).onerror = (event) => {
|
||||||
// All Fails
|
// All Fails
|
||||||
(event.target as ImageTarget).onerror = ()=> { Logger.warn('FALLBACK IMAGE LOAD FAIL') }
|
(event.target as ImageTarget).onerror = ()=> { Logger.warn('FALLBACK IMAGE LOAD FAIL') }
|
||||||
(event.target as ImageTarget).src = fallback
|
(event.target as ImageTarget).src = fallback
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
(e.target as ImageTarget).onerror = (event) => {
|
else {
|
||||||
// All Fails
|
(e.target as ImageTarget).onerror = (event) => {
|
||||||
(event.target as ImageTarget).onerror = ()=> { Logger.warn('FALLBACK IMAGE LOAD FAIL') }
|
// All Fails
|
||||||
(event.target as ImageTarget).src = fallback
|
(event.target as ImageTarget).onerror = ()=> { Logger.warn('FALLBACK IMAGE LOAD FAIL') }
|
||||||
}
|
(event.target as ImageTarget).src = fallback
|
||||||
// Webp Load Fail
|
|
||||||
(e.target as ImageTarget).src = KoreanbotsEndPoints.CDN.avatar(props.userID, { size: props.size ?? 256})
|
|
||||||
if(!supportsWebP()) localStorage.setItem('webp', 'false')
|
|
||||||
}
|
}
|
||||||
}}
|
// Webp Load Fail
|
||||||
/>
|
(e.target as ImageTarget).src = KoreanbotsEndPoints.CDN.avatar(props.userID, { size: props.size ?? 256})
|
||||||
)
|
if(!supportsWebP()) localStorage.setItem('webp', 'false')
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
|
|
||||||
export default DiscordAvatar
|
export default DiscordAvatar
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import Container from '@components/Container'
|
import dynamic from 'next/dynamic'
|
||||||
import Wave from '@components/Wave'
|
|
||||||
import SEO from './SEO'
|
|
||||||
|
|
||||||
|
const Container = dynamic(() => import('@components/Container'))
|
||||||
|
const SEO = dynamic(() => import('@components/SEO'))
|
||||||
const Docs = ({ title, header, description, subheader, children }: DocsProps): JSX.Element => {
|
const Docs = ({ title, header, description, subheader, children }: DocsProps): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import Container from '@components/Container'
|
import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
import Toggle from './Toggle'
|
|
||||||
import { Theme } from '@types'
|
import { Theme } from '@types'
|
||||||
|
|
||||||
|
const Container = dynamic(() => import('@components/Container'))
|
||||||
|
const Toggle = dynamic(() => import('@components/Toggle'))
|
||||||
|
|
||||||
const Footer = ({ theme, setTheme }: FooterProps): JSX.Element => {
|
const Footer = ({ theme, setTheme }: FooterProps): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
<div className='releative z-30'>
|
<div className='releative z-30'>
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import ReactSelect, { components } from 'react-select'
|
import { ComponentType } from 'react'
|
||||||
|
import ReactSelect, { components, GroupTypeBase, MultiValueProps, OptionTypeBase } from 'react-select'
|
||||||
import {
|
import {
|
||||||
SortableContainer,
|
SortableContainer,
|
||||||
SortableElement,
|
SortableElement,
|
||||||
@ -49,8 +50,7 @@ const Select = ({ placeholder, options, values, setValues, handleChange, handleT
|
|||||||
}} isMulti className='border border-grey-light dark:border-transparent rounded' classNamePrefix='outline-none text-black dark:bg-very-black dark:text-white cursor-pointer ' placeholder={placeholder || '선택해주세요.'} options={options} onChange={handleChange} onBlur={handleTouch} noOptionsMessage={() => '검색 결과가 없습니다.'}
|
}} isMulti className='border border-grey-light dark:border-transparent rounded' classNamePrefix='outline-none text-black dark:bg-very-black dark:text-white cursor-pointer ' placeholder={placeholder || '선택해주세요.'} options={options} onChange={handleChange} onBlur={handleTouch} noOptionsMessage={() => '검색 결과가 없습니다.'}
|
||||||
value={values.map(el => ({ label: el, value: el}))}
|
value={values.map(el => ({ label: el, value: el}))}
|
||||||
components={{
|
components={{
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
MultiValue: SortableMultiValue as ComponentType<MultiValueProps<OptionTypeBase, GroupTypeBase<{ label: string, value: string}>>>,
|
||||||
MultiValue: SortableMultiValue as any,
|
|
||||||
MultiValueLabel: SortableMultiValueLabel,
|
MultiValueLabel: SortableMultiValueLabel,
|
||||||
}}
|
}}
|
||||||
closeMenuOnSelect={false}
|
closeMenuOnSelect={false}
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import dynamic from 'next/dynamic'
|
|||||||
import { categories, categoryIcon } from '@utils/Constants'
|
import { categories, categoryIcon } from '@utils/Constants'
|
||||||
|
|
||||||
const Container = dynamic(()=> import('@components/Container'))
|
const Container = dynamic(()=> import('@components/Container'))
|
||||||
const Wave = dynamic(()=> import('@components/Wave'))
|
|
||||||
const Tag = dynamic(()=> import('@components/Tag'))
|
const Tag = dynamic(()=> import('@components/Tag'))
|
||||||
const Search = dynamic(()=> import('@components/Search'))
|
const Search = dynamic(()=> import('@components/Search'))
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ const Redirect = ({ to, text=true, children }:RedirectProps):JSX.Element => {
|
|||||||
if(!to) throw new Error('No Link')
|
if(!to) throw new Error('No Link')
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
redirectTo(router, to)
|
redirectTo(router, to)
|
||||||
}, [])
|
})
|
||||||
if(children) return <>
|
if(children) return <>
|
||||||
{children}
|
{children}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -59,7 +59,7 @@ const Search = (): JSX.Element => {
|
|||||||
if(d.findIndex(n => n.value === query) !== -1) d.splice(d.findIndex(n => n.value === query), 1)
|
if(d.findIndex(n => n.value === query) !== -1) d.splice(d.findIndex(n => n.value === query), 1)
|
||||||
d.push({
|
d.push({
|
||||||
value: query,
|
value: query,
|
||||||
date: new Date().getTime()
|
date: Date.now()
|
||||||
})
|
})
|
||||||
d.reverse()
|
d.reverse()
|
||||||
setRecentSearch(d.slice(0, 10))
|
setRecentSearch(d.slice(0, 10))
|
||||||
@ -67,7 +67,7 @@ const Search = (): JSX.Element => {
|
|||||||
} catch {
|
} catch {
|
||||||
setRecentSearch([{
|
setRecentSearch([{
|
||||||
value: query,
|
value: query,
|
||||||
date: new Date().getTime()
|
date: Date.now()
|
||||||
}])
|
}])
|
||||||
localStorage.recentSearch = JSON.stringify(recentSearch)
|
localStorage.recentSearch = JSON.stringify(recentSearch)
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user