1
0
Fork 0

chore(shared): Linter issues

This commit is contained in:
joostdecock 2023-08-27 17:01:58 +02:00
parent fb993ebe25
commit 7ef9198fe8
6 changed files with 33 additions and 35 deletions

View file

@ -110,14 +110,13 @@ export const MeasieVal = ({ val, m, imperial }) =>
export const MsetCard = ({ export const MsetCard = ({
set, set,
control,
onClick = false, onClick = false,
href = false, href = false,
useA = false, useA = false,
design = false, design = false,
language = false, language = false,
}) => { }) => {
const { t, i18n } = useTranslation(ns) const { t } = useTranslation(ns)
const wrapperProps = { const wrapperProps = {
className: className:
@ -134,11 +133,7 @@ export const MsetCard = ({
let note = <span></span> let note = <span></span>
if (design) { if (design) {
const [hasMeasies, missingMeasies] = hasRequiredMeasurements( const [hasMeasies] = hasRequiredMeasurements(designMeasurements[design], set.measies, true)
designMeasurements[design],
set.measies,
true
)
const noteClasses = const noteClasses =
'bg-opacity-90 w-full text-center py-2 font-bold px-2 rounded rounded-b-none leading-4 text-sm' 'bg-opacity-90 w-full text-center py-2 font-bold px-2 rounded rounded-b-none leading-4 text-sm'
note = hasMeasies ? ( note = hasMeasies ? (
@ -730,7 +725,6 @@ export const Sets = () => {
export const SetCard = ({ export const SetCard = ({
set, set,
language,
requiredMeasies = [], requiredMeasies = [],
href = false, href = false,
onClick = false, onClick = false,
@ -739,7 +733,7 @@ export const SetCard = ({
// Hooks // Hooks
const { t } = useTranslation(['sets']) const { t } = useTranslation(['sets'])
const [hasMeasies, missingMeasies] = hasRequiredMeasurements(requiredMeasies, set.measies, true) const [hasMeasies] = hasRequiredMeasurements(requiredMeasies, set.measies, true)
const wrapperProps = { const wrapperProps = {
className: className:
@ -756,7 +750,7 @@ export const SetCard = ({
const inner = hasMeasies ? null : ( const inner = hasMeasies ? null : (
<div className="flex flex-row gap-2 items-center"> <div className="flex flex-row gap-2 items-center">
<WarningIcon className="w-6 h-6 shrink-0 text-error" /> <WarningIcon className="w-6 h-6 shrink-0 text-error" />
<span>{t('setLacksMeasiesForDesign', { design: t(`designs:${design}.t`) })}</span> <span>{t('setLacksMeasiesForDesign')}</span>
</div> </div>
) )
@ -819,7 +813,7 @@ export const UserSetPicker = ({ design, t, href, clickHandler }) => {
if (Object.keys(sets).length > 0) { if (Object.keys(sets).length > 0) {
hasSets = true hasSets = true
for (const setId in sets) { for (const setId in sets) {
const [hasMeasies, missingMeasies] = hasRequiredMeasurements( const [hasMeasies] = hasRequiredMeasurements(
designMeasurements[design], designMeasurements[design],
sets[setId].measies, sets[setId].measies,
true true
@ -875,7 +869,7 @@ export const UserSetPicker = ({ design, t, href, clickHandler }) => {
<> <>
<h4>{t('account:theseSetsReady')}</h4> <h4>{t('account:theseSetsReady')}</h4>
<div className="grid grid-cols-1 md:grid-cols-2 2xl:grid-cols-3 gap-2"> <div className="grid grid-cols-1 md:grid-cols-2 2xl:grid-cols-3 gap-2">
{okSets.map((set, i) => ( {okSets.map((set) => (
<MsetButton <MsetButton
{...{ set, control, design }} {...{ set, control, design }}
onClick={clickHandler} onClick={clickHandler}
@ -890,7 +884,7 @@ export const UserSetPicker = ({ design, t, href, clickHandler }) => {
<div className="my-4"> <div className="my-4">
<h4>{t('account:someSetsLacking')}</h4> <h4>{t('account:someSetsLacking')}</h4>
<div className="grid grid-cols-1 md:grid-cols-2 2xl:grid-cols-3 gap-2"> <div className="grid grid-cols-1 md:grid-cols-2 2xl:grid-cols-3 gap-2">
{lackingSets.map((set, i) => ( {lackingSets.map((set) => (
<MsetLink <MsetLink
{...{ set, control, design }} {...{ set, control, design }}
onClick={clickHandler} onClick={clickHandler}
@ -998,6 +992,7 @@ export const CuratedSetPicker = ({ design, language, href, clickHandler }) => {
<MsetButton <MsetButton
key={set.id} key={set.id}
{...{ set, control, design }} {...{ set, control, design }}
href={href}
onClick={clickHandler} onClick={clickHandler}
requiredMeasies={measurements[design]} requiredMeasies={measurements[design]}
language={i18n.language} language={i18n.language}
@ -1008,7 +1003,7 @@ export const CuratedSetPicker = ({ design, language, href, clickHandler }) => {
) )
} }
export const BookmarkedSetPicker = ({ t }) => <V3Wip /> export const BookmarkedSetPicker = () => <V3Wip />
export const SetPicker = ({ design, href = false, clickHandler = false }) => { export const SetPicker = ({ design, href = false, clickHandler = false }) => {
const { t, i18n } = useTranslation('sets') const { t, i18n } = useTranslation('sets')

View file

@ -53,7 +53,7 @@ export const WorkbenchMenu = ({
updateFunc, updateFunc,
ns, ns,
Icon = () => null, Icon = () => null,
name, //name,
config, config,
control, control,
inputs, inputs,
@ -65,9 +65,9 @@ export const WorkbenchMenu = ({
language, language,
emojis, emojis,
Item, Item,
isFirst, //isFirst,
children, children,
docsPath, //docsPath,
isDesignOptionsGroup, isDesignOptionsGroup,
}) => { }) => {
// get translation for the menu // get translation for the menu

View file

@ -477,7 +477,7 @@ export const ConstantInput = ({
name, name,
current, current,
updateFunc, updateFunc,
t, //t,
changed, changed,
config, config,
}) => ( }) => (

View file

@ -62,11 +62,11 @@ export const MenuItem = ({
t, t,
passProps = {}, passProps = {},
changed, changed,
loadDocs, //loadDocs,
Input = () => {}, Input = () => {},
Value = () => {}, //Value = () => {},
allowOverride = false, allowOverride = false,
allowToggle = false, //allowToggle = false,
control = Infinity, control = Infinity,
DynamicDocs, DynamicDocs,
docsPath, docsPath,
@ -113,7 +113,7 @@ export const MenuItem = ({
/> />
</button> </button>
) )
const ResetButton = ({ open, disabled = false }) => ( const ResetButton = ({ disabled = false }) => (
<button <button
className={`${iconButtonClass} disabled:bg-opacity-0`} className={`${iconButtonClass} disabled:bg-opacity-0`}
disabled={disabled} disabled={disabled}
@ -171,7 +171,7 @@ export const MenuItem = ({
export const MenuItemGroup = ({ export const MenuItemGroup = ({
collapsible = true, collapsible = true,
control, control,
name, //name,
currentValues = {}, currentValues = {},
structure, structure,
Icon, Icon,
@ -201,7 +201,7 @@ export const MenuItemGroup = ({
? GroupIcon ? GroupIcon
: Icon : Icon
? Icon ? Icon
: () => <span role="img">{emoji}</span> : () => <span role="img">fixme-icon</span>
const Value = item.isGroup const Value = item.isGroup
? () => ( ? () => (
<div className="flex flex-row gap-2 items-center font-medium"> <div className="flex flex-row gap-2 items-center font-medium">

View file

@ -17,7 +17,7 @@ export const ns = nsMerge(coreMenuNs, designMenuNs, uiNs)
export const DraftMenu = ({ export const DraftMenu = ({
design, design,
patternConfig, patternConfig,
setSettings, //setSettings,
settings, settings,
ui, ui,
update, update,

View file

@ -1,3 +1,4 @@
import { Fragment } from 'react'
import { ns as optionsNs } from './options.mjs' import { ns as optionsNs } from './options.mjs'
import { ns as measieNs } from './measurements.mjs' import { ns as measieNs } from './measurements.mjs'
import { Accordion } from 'shared/components/accordion.mjs' import { Accordion } from 'shared/components/accordion.mjs'
@ -30,9 +31,9 @@ export const TestMenu = ({
patternConfig, patternConfig,
settings, settings,
update, update,
language, //language,
account, //account,
DynamicDocs, //DynamicDocs,
}) => { }) => {
const { t } = useTranslation(ns) const { t } = useTranslation(ns)
@ -50,7 +51,8 @@ export const TestMenu = ({
<p>{t('workbench:testOptionsDesc')}</p> <p>{t('workbench:testOptionsDesc')}</p>
</>, </>,
<ListInput <ListInput
list={[...allOptions].map((option) => ({ list={[...allOptions].map((option, i) => ({
key: i,
label: [ label: [
...option.path.map((p) => ( ...option.path.map((p) => (
<> <>
@ -58,7 +60,7 @@ export const TestMenu = ({
{spacer} {spacer}
</> </>
)), )),
<span>{t(`${design}:${option.key}.t`)}</span>, <span key={1}>{t(`${design}:${option.key}.t`)}</span>,
], ],
val: option.key, val: option.key,
}))} }))}
@ -70,14 +72,15 @@ export const TestMenu = ({
/>, />,
], ],
[ [
<> <Fragment key="a">
<h5 className="flex flex-row gap-2 items-center justify-between w-full"> <h5 className="flex flex-row gap-2 items-center justify-between w-full">
<span>{t('workbench:testMeasurements')}</span> <span>{t('workbench:testMeasurements')}</span>
<MeasieIcon className="w-8 h-8" /> <MeasieIcon className="w-8 h-8" />
</h5> </h5>
<p>{t('workbench:testOptionsDesc')}</p> <p>{t('workbench:testOptionsDesc')}</p>
</>, </Fragment>,
<ListInput <ListInput
key="b"
list={patternConfig.measurements.map((m) => ({ list={patternConfig.measurements.map((m) => ({
label: t(m), label: t(m),
val: m, val: m,
@ -90,14 +93,14 @@ export const TestMenu = ({
/>, />,
], ],
[ [
<> <Fragment key="a">
<h5 className="flex flex-row gap-2 items-center justify-between w-full"> <h5 className="flex flex-row gap-2 items-center justify-between w-full">
<span>{t('workbench:testSets')}</span> <span>{t('workbench:testSets')}</span>
<CommunityIcon className="w-8 h-8" /> <CommunityIcon className="w-8 h-8" />
</h5> </h5>
<p>{t('workbench:testSetsDesc')}</p> <p>{t('workbench:testSetsDesc')}</p>
</>, </Fragment>,
<V3Wip />, <V3Wip key="b" />,
], ],
]} ]}
/> />