1
0
Fork 0

chore: Linter issues

This commit is contained in:
Joost De Cock 2023-08-29 09:39:48 +02:00
parent 30b60bf569
commit 9741a6e736
4 changed files with 27 additions and 40 deletions

View file

@ -11,7 +11,6 @@ import {
formatMm, formatMm,
hasRequiredMeasurements, hasRequiredMeasurements,
capitalize, capitalize,
scrollTo,
horFlexClasses, horFlexClasses,
} from 'shared/utils.mjs' } from 'shared/utils.mjs'
import orderBy from 'lodash.orderby' import orderBy from 'lodash.orderby'
@ -26,7 +25,7 @@ import { ModalContext } from 'shared/context/modal-context.mjs'
import { Popout } from 'shared/components/popout/index.mjs' import { Popout } from 'shared/components/popout/index.mjs'
import { Tag } from 'shared/components/tag.mjs' import { Tag } from 'shared/components/tag.mjs'
import { BackToAccountButton } from './shared.mjs' import { BackToAccountButton } from './shared.mjs'
import { AnchorLink, PageLink, Link, linkClasses } from 'shared/components/link.mjs' import { AnchorLink, PageLink, Link } from 'shared/components/link.mjs'
import { V3Wip } from 'shared/components/v3-wip.mjs' import { V3Wip } from 'shared/components/v3-wip.mjs'
import { import {
OkIcon, OkIcon,
@ -117,8 +116,6 @@ export const MsetCard = ({
language = false, language = false,
size = 'lg', size = 'lg',
}) => { }) => {
const { t } = useTranslation(ns)
const sizes = { const sizes = {
lg: 96, lg: 96,
md: 52, md: 52,

View file

@ -425,14 +425,9 @@ export const MarkdownInput = ({
id = '', // An id to tie the input to the label id = '', // An id to tie the input to the label
labelBL = false, // Bottom-Left label labelBL = false, // Bottom-Left label
labelBR = false, // Bottom-Right label labelBR = false, // Bottom-Right label
}) => { }) => (
const [activeTab, setActiveTab] = useState('edit')
const tabs = ['edit', 'preview']
return (
<FormControl {...{ label, labelBL, labelBR, docs }} forId={id}> <FormControl {...{ label, labelBL, labelBR, docs }} forId={id}>
<Tabs tabs={tabs}> <Tabs tabs={['edit', 'preview']}>
<Tab key="edit"> <Tab key="edit">
<div className="flex flex-row items-center mt-4"> <div className="flex flex-row items-center mt-4">
<textarea <textarea
@ -453,7 +448,6 @@ export const MarkdownInput = ({
</Tabs> </Tabs>
</FormControl> </FormControl>
) )
}
export const MeasieInput = ({ export const MeasieInput = ({
imperial, // True for imperial, False for metric imperial, // True for imperial, False for metric

View file

@ -6,7 +6,7 @@ import { DynamicOrgDocs } from 'shared/components/dynamic-docs/org.mjs'
export const ns = nsMerge('workbench', inputNs) export const ns = nsMerge('workbench', inputNs)
export const MeasiesEditor = ({ Design, settings, update }) => { export const MeasiesEditor = ({ Design, settings, update }) => {
const { t, i18n } = useTranslation(ns) const { i18n } = useTranslation(ns)
const onUpdate = (m, newVal) => { const onUpdate = (m, newVal) => {
update.settings(['measurements', m], newVal) update.settings(['measurements', m], newVal)

View file

@ -13,10 +13,8 @@ import {
CuratedSetPicker, CuratedSetPicker,
ns as setsNs, ns as setsNs,
} from 'shared/components/account/sets.mjs' } from 'shared/components/account/sets.mjs'
import { Tabs, Tab } from 'shared/components/tabs.mjs'
import { MeasiesEditor } from './editor.mjs' import { MeasiesEditor } from './editor.mjs'
import { Popout } from 'shared/components/popout/index.mjs' import { Popout } from 'shared/components/popout/index.mjs'
import { linkClasses } from 'shared/components/link.mjs'
import { Accordion } from 'shared/components/accordion.mjs' import { Accordion } from 'shared/components/accordion.mjs'
import { MsetIcon, BookmarkIcon, CsetIcon, EditIcon } from 'shared/components/icons.mjs' import { MsetIcon, BookmarkIcon, CsetIcon, EditIcon } from 'shared/components/icons.mjs'
@ -28,8 +26,6 @@ export const MeasiesView = ({ design, Design, settings, update, missingMeasureme
const { t } = useTranslation(['workbench']) const { t } = useTranslation(['workbench'])
const { setLoadingStatus, LoadingStatus } = useLoadingStatus() const { setLoadingStatus, LoadingStatus } = useLoadingStatus()
const tabs = tabNames.map((n) => t(n)).join(',')
const loadMeasurements = (set) => { const loadMeasurements = (set) => {
update.settings([ update.settings([
[['measurements'], designMeasurements(Design, set.measies)], [['measurements'], designMeasurements(Design, set.measies)],
@ -97,7 +93,7 @@ export const MeasiesView = ({ design, Design, settings, update, missingMeasureme
</div> </div>
<p>{t('workbench:chooseFromCuratedSetsDesc')}</p> <p>{t('workbench:chooseFromCuratedSetsDesc')}</p>
</Fragment>, </Fragment>,
<CuratedSetPicker design={design} clickHandler={loadMeasurements} t={t} />, <CuratedSetPicker design={design} clickHandler={loadMeasurements} t={t} key={2} />,
], ],
[ [
<Fragment key={1}> <Fragment key={1}>
@ -107,7 +103,7 @@ export const MeasiesView = ({ design, Design, settings, update, missingMeasureme
</div> </div>
<p>{t('workbench:editMeasiesByHandDesc')}</p> <p>{t('workbench:editMeasiesByHandDesc')}</p>
</Fragment>, </Fragment>,
<MeasiesEditor {...{ Design, settings, update }} />, <MeasiesEditor {...{ Design, settings, update }} key={2} />,
], ],
]} ]}
/> />