Remove unused code

Dependencies and components that were no longer used
This commit is contained in:
Justin Edmund 2023-07-02 02:04:30 -07:00
parent 10c1e0332e
commit da2d0cfc8e
16 changed files with 6 additions and 192 deletions

View file

@ -1,11 +1,9 @@
import React from 'react'
import Link from 'next/link'
import { Trans, useTranslation } from 'next-i18next'
import classNames from 'classnames'
import LinkItem from '../LinkItem'
import ShareIcon from '~public/icons/Share.svg'
import DiscordIcon from '~public/icons/discord.svg'
import GithubIcon from '~public/icons/github.svg'

View file

@ -1,11 +1,9 @@
import React from 'react'
import Link from 'next/link'
import { useTranslation } from 'next-i18next'
import classNames from 'classnames'
import LinkItem from '~components/about/LinkItem'
import ShareIcon from '~public/icons/Share.svg'
import GithubIcon from '~public/icons/github.svg'
import styles from './index.module.scss'

View file

@ -3,7 +3,6 @@ import { useTranslation } from 'next-i18next'
import classNames from 'classnames'
import ContentUpdate from '~components/about/ContentUpdate'
import ChangelogUnit from '~components/about/ChangelogUnit'
import styles from './index.module.scss'

View file

@ -10,26 +10,15 @@ import DialogFooter from '~components/common/DialogFooter'
import DialogContent from '~components/common/DialogContent'
import Button from '~components/common/Button'
import SelectItem from '~components/common/SelectItem'
import PictureSelectItem from '~components/common/PictureSelectItem'
import SelectTableField from '~components/common/SelectTableField'
// import * as Switch from '@radix-ui/react-switch'
import api from '~utils/api'
import changeLanguage from 'utils/changeLanguage'
import { accountState } from '~utils/accountState'
import { pictureData } from '~utils/pictureData'
import CrossIcon from '~public/icons/Cross.svg'
import styles from './index.module.scss'
type StateVariables = {
[key: string]: boolean
picture: boolean
gender: boolean
language: boolean
theme: boolean
}
interface Props {
open: boolean
username?: string
@ -55,23 +44,8 @@ const AccountModal = React.forwardRef<HTMLDivElement, Props>(
const [mounted, setMounted] = useState(false)
const { theme: appTheme, setTheme: setAppTheme } = useTheme()
// Cookies
const accountCookie = getCookie('account')
const userCookie = getCookie('user')
const cookieData = {
account: accountCookie ? JSON.parse(accountCookie as string) : undefined,
user: userCookie ? JSON.parse(userCookie as string) : undefined,
}
// UI State
const [open, setOpen] = useState(false)
const [selectOpenState, setSelectOpenState] = useState<StateVariables>({
picture: false,
gender: false,
language: false,
theme: false,
})
// Values
const [username, setUsername] = useState(props.username || '')
@ -79,7 +53,6 @@ const AccountModal = React.forwardRef<HTMLDivElement, Props>(
const [language, setLanguage] = useState(props.language || '')
const [gender, setGender] = useState(props.gender || 0)
const [theme, setTheme] = useState(props.theme || 'system')
// const [privateProfile, setPrivateProfile] = useState(false)
// Setup
const [pictureOpen, setPictureOpen] = useState(false)
@ -145,7 +118,6 @@ const AccountModal = React.forwardRef<HTMLDivElement, Props>(
language: language,
gender: gender,
theme: theme,
// private: privateProfile,
},
}

View file

@ -1,14 +1,10 @@
import React, { useEffect, useState } from 'react'
import { useTranslation } from 'next-i18next'
import cloneDeep from 'lodash.clonedeep'
import * as DropdownMenu from '@radix-ui/react-dropdown-menu'
import SearchFilter from '~components/search/SearchFilter'
import SearchFilterCheckboxItem from '~components/search/SearchFilterCheckboxItem'
import styles from './index.module.scss'
import {
emptyElementState,
emptyProficiencyState,
@ -16,6 +12,8 @@ import {
} from '~utils/emptyStates'
import { elements, proficiencies, rarities } from '~utils/stateValues'
import styles from './index.module.scss'
interface Props {
sendFilters: (filters: { [key: string]: number[] }) => void
}

View file

@ -1,4 +1,4 @@
import React, { MouseEvent, useEffect, useState } from 'react'
import React, { useEffect, useState } from 'react'
import { useRouter } from 'next/router'
import { useSnapshot } from 'valtio'
import { Trans, useTranslation } from 'next-i18next'

View file

@ -3,7 +3,6 @@ import Input from '~components/common/Input'
import TableField from '~components/common/TableField'
import styles from './index.module.scss'
import classNames from 'classnames'
interface Props
extends React.DetailedHTMLProps<

View file

@ -32,7 +32,7 @@ export const PopoverContent = React.forwardRef<HTMLDivElement, Props>(
ref={forwardedRef}
>
{children}
<PopoverPrimitive.Arrow className="Arrow" />
<PopoverPrimitive.Arrow className={styles.arrow} />
</PopoverPrimitive.Content>
</PopoverPrimitive.Portal>
)

View file

@ -1,5 +1,4 @@
import React from 'react'
import styles from './index.module.scss'
interface Props {

View file

@ -1,8 +1,8 @@
import React, { ComponentProps } from 'react'
import classNames from 'classnames'
import * as Select from '@radix-ui/react-select'
import styles from './index.module.scss'
import classNames from 'classnames'
interface Props extends ComponentProps<'div'> {
value: string | number

View file

@ -1,7 +1,6 @@
import React from 'react'
import * as RadixSwitch from '@radix-ui/react-switch'
import classNames from 'classnames'
import * as RadixSwitch from '@radix-ui/react-switch'
import styles from './index.module.scss'
interface Props

View file

@ -1,18 +0,0 @@
.Fieldset textarea {
$offset: 2px;
background-color: var(--input-bg);
border: $offset solid transparent;
border-radius: $input-corner;
box-sizing: border-box;
color: var(--text-primary);
display: block;
line-height: 21px;
-webkit-font-smoothing: antialiased;
padding: $unit-2x calc($unit-2x - $offset);
&:focus-within {
border: $offset solid $blue;
outline: none;
}
}

View file

@ -1,32 +0,0 @@
import React from 'react'
import styles from './index.module.scss'
interface Props {
fieldName: string
placeholder: string
value?: string
error: string
onBlur?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void
onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void
}
const TextFieldset = React.forwardRef<HTMLTextAreaElement, Props>(
function fieldSet(props, ref) {
return (
<fieldset className="Fieldset">
<textarea
className="Input"
name={props.fieldName}
placeholder={props.placeholder}
defaultValue={props.value || ''}
onBlur={props.onBlur}
onChange={props.onChange}
ref={ref}
/>
{props.error.length > 0 && <p className="InputError">{props.error}</p>}
</fieldset>
)
}
)
export default TextFieldset

View file

@ -1,65 +0,0 @@
.toggle-switch {
background: var(--card-bg);
border-radius: 18px;
display: inline-block;
position: relative;
width: 58px;
height: 34px;
&-checkbox {
display: none;
}
&-label {
border-radius: 17px;
display: block;
cursor: pointer;
height: 34px;
margin: 0;
overflow: hidden;
}
&-disabled {
background-color: #ddd;
cursor: not-allowed;
&:before {
background-color: #ddd;
cursor: not-allowed;
}
}
&-switch {
background: var(--switch-nub); // #e4e4e4;
display: block;
width: 24px;
margin: 5px;
position: absolute;
top: 0;
bottom: 0;
right: 24px;
border-radius: 17px;
transition: all 0.18s ease-in 0s;
&:hover {
background: var(--background);
}
}
&-checkbox:checked + &-label {
background: var(--extra-purple-bg);
}
&-checkbox:checked + &-label &-switch {
background: var(--extra-purple-primary);
}
&-checkbox:checked + &-label {
.toggle-switch-inner {
margin-left: 0;
}
.toggle-switch-switch {
right: 0px;
}
}
}

View file

@ -1,31 +0,0 @@
import React from 'react'
import styles from './index.module.scss'
interface Props {
name: string
checked: boolean
editable: boolean
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void
}
const ToggleSwitch: React.FC<Props> = (props: Props) => {
return (
<div className="toggle-switch">
<input
className="toggle-switch-checkbox"
name={props.name}
id={props.name}
type="checkbox"
checked={props.checked}
disabled={!props.editable}
onChange={props.onChange}
/>
<label className="toggle-switch-label" htmlFor={props.name}>
<span className="toggle-switch-switch" />
</label>
</div>
)
}
export default ToggleSwitch

View file

@ -1,6 +1,4 @@
import React, { PropsWithChildren } from 'react'
import classNames from 'classnames'
import * as TooltipPrimitive from '@radix-ui/react-tooltip'
import styles from './index.module.scss'