1
0
Fork 0

chore [react]: Linter

This commit is contained in:
joostdecock 2025-06-01 17:04:31 +02:00
parent 0c1d886e94
commit 47d4a27f64
6 changed files with 49 additions and 46 deletions

View file

@ -414,7 +414,7 @@ const Button = ({ onClickCb, transform, Icon, title = '' }) => {
const InnerFlipIcon = () => ( const InnerFlipIcon = () => (
<path <path
strokeLinkecap="round" strokeLinecap="round"
strokeLinejoin="round" strokeLinejoin="round"
d="M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5" d="M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"
/> />
@ -431,7 +431,6 @@ const InnerResetIcon = () => (
<path d="M12 9.75 14.25 12m0 0 2.25 2.25M14.25 12l2.25-2.25M14.25 12 12 14.25m-2.58 4.92-6.374-6.375a1.125 1.125 0 0 1 0-1.59L9.42 4.83c.21-.211.497-.33.795-.33H19.5a2.25 2.25 0 0 1 2.25 2.25v10.5a2.25 2.25 0 0 1-2.25 2.25h-9.284c-.298 0-.585-.119-.795-.33Z" /> <path d="M12 9.75 14.25 12m0 0 2.25 2.25M14.25 12l2.25-2.25M14.25 12 12 14.25m-2.58 4.92-6.374-6.375a1.125 1.125 0 0 1 0-1.59L9.42 4.83c.21-.211.497-.33.795-.33H19.5a2.25 2.25 0 0 1 2.25 2.25v10.5a2.25 2.25 0 0 1-2.25 2.25h-9.284c-.298 0-.585-.119-.795-.33Z" />
) )
/** buttons for manipulating the part */ /** buttons for manipulating the part */
export const Buttons = ({ transform, flip, rotate, resetPart, rotate90, iconSize }) => { export const Buttons = ({ transform, flip, rotate, resetPart, rotate90, iconSize }) => {
return ( return (

View file

@ -19,7 +19,7 @@ import { useDesignTranslation } from '@freesewing/react/hooks/useDesignTranslati
* @param {object] pattern - The drafted pattern * @param {object] pattern - The drafted pattern
*/ */
export const PatternLayout = (props) => { export const PatternLayout = (props) => {
const { Design, pattern, update, config, state } = props const { Design, pattern, update, config } = props
const i18n = useDesignTranslation(Design.designConfig.data.id) const i18n = useDesignTranslation(Design.designConfig.data.id)
return ( return (
@ -42,42 +42,45 @@ export const PatternLayout = (props) => {
const PatternAsideMenu = (props) => { const PatternAsideMenu = (props) => {
if (!props.state.ui?.aside) return null if (!props.state.ui?.aside) return null
if (props.state.view === 'draft') return ( if (props.state.view === 'draft')
<PatternAsideWrapper> return (
<h5 className="tw:capitalize">{props.pattern.designConfig.data.id} Options</h5> <PatternAsideWrapper>
<SideMenuUl> <h5 className="tw:capitalize">{props.pattern.designConfig.data.id} Options</h5>
<DesignOptionsMenu {...props} /> <SideMenuUl>
</SideMenuUl> <DesignOptionsMenu {...props} />
<h5>Core Settings</h5> </SideMenuUl>
<SideMenuUl> <h5>Core Settings</h5>
<CoreSettingsMenu {...props} /> <SideMenuUl>
</SideMenuUl> <CoreSettingsMenu {...props} />
<h5>UI Preferences</h5> </SideMenuUl>
<SideMenuUl> <h5>UI Preferences</h5>
<UiPreferencesMenu {...props} /> <SideMenuUl>
</SideMenuUl> <UiPreferencesMenu {...props} />
</PatternAsideWrapper> </SideMenuUl>
) </PatternAsideWrapper>
if (props.state.view === 'layout') return ( )
<PatternAsideWrapper> if (props.state.view === 'layout')
<h5>Layout Settings</h5> return (
<SideMenuUl> <PatternAsideWrapper>
<LayoutSettingsMenu {...props} /> <h5>Layout Settings</h5>
</SideMenuUl> <SideMenuUl>
</PatternAsideWrapper> <LayoutSettingsMenu {...props} />
) </SideMenuUl>
if (props.state.view === 'test') return ( </PatternAsideWrapper>
<PatternAsideWrapper> )
<h5>Test Design Options</h5> if (props.state.view === 'test')
<SideMenuUl> return (
<TestOptionsMenu {...props} /> <PatternAsideWrapper>
</SideMenuUl> <h5>Test Design Options</h5>
<h5>Test Measurements</h5> <SideMenuUl>
<SideMenuUl> <TestOptionsMenu {...props} />
<TestMeasurementsMenu {...props} /> </SideMenuUl>
</SideMenuUl> <h5>Test Measurements</h5>
</PatternAsideWrapper> <SideMenuUl>
) <TestMeasurementsMenu {...props} />
</SideMenuUl>
</PatternAsideWrapper>
)
return null return null
} }

View file

@ -1,5 +1,5 @@
// Dependencies // Dependencies
import { linkClasses, capitalize } from '@freesewing/utils' import { linkClasses } from '@freesewing/utils'
// Context // Context
import { ModalContext } from '@freesewing/react/context/Modal' import { ModalContext } from '@freesewing/react/context/Modal'
// Hooks // Hooks
@ -10,7 +10,6 @@ import { modalDocsHelp } from '@freesewing/react/components/Help'
import { HeaderMenu } from '../HeaderMenu.mjs' import { HeaderMenu } from '../HeaderMenu.mjs'
import { Popout } from '@freesewing/react/components/Popout' import { Popout } from '@freesewing/react/components/Popout'
/** /**
* This is the docs view, it just shows content * This is the docs view, it just shows content
* *
@ -41,7 +40,9 @@ export const DocsView = ({ state, config, update }) => {
<button <button
className="tw:daisy-btn tw:daisy-btn-secondary tw:daisy-btn-outline tw:mt-4" className="tw:daisy-btn tw:daisy-btn-secondary tw:daisy-btn-outline tw:mt-4"
onClick={() => modalDocsHelp(`docs/designs/${state.design}`, setModal)} onClick={() => modalDocsHelp(`docs/designs/${state.design}`, setModal)}
>Open without leaving the Editor</button> >
Open without leaving the Editor
</button>
</> </>
) : null} ) : null}
<H2>Editor Documentation</H2> <H2>Editor Documentation</H2>
@ -56,7 +57,9 @@ export const DocsView = ({ state, config, update }) => {
<button <button
className="tw:daisy-btn tw:daisy-btn-secondary tw:daisy-btn-outline tw:mt-4" className="tw:daisy-btn tw:daisy-btn-secondary tw:daisy-btn-outline tw:mt-4"
onClick={() => modalDocsHelp(`docs/editor`, setModal)} onClick={() => modalDocsHelp(`docs/editor`, setModal)}
>Open without leaving the Editor</button> >
Open without leaving the Editor
</button>
<H2>Developer Documentation</H2> <H2>Developer Documentation</H2>
<Popout type="link" compact> <Popout type="link" compact>
<b> <b>

View file

@ -2,7 +2,7 @@ import React from 'react'
// Dependencies // Dependencies
import { defaultConfig as config } from '../config/index.mjs' import { defaultConfig as config } from '../config/index.mjs'
import { measurementAsMm } from '@freesewing/utils' import { measurementAsMm } from '@freesewing/utils'
import { linkClasses } from '@freesewing/utils'
/* /*
* Components * Components
* Note that these are only used as returns values * Note that these are only used as returns values

View file

@ -2,7 +2,6 @@ import React from 'react'
import { mergeOptions } from '@freesewing/core' import { mergeOptions } from '@freesewing/core'
import { designOptionType, set, orderBy } from '@freesewing/utils' import { designOptionType, set, orderBy } from '@freesewing/utils'
import { i18n } from '@freesewing/collection' import { i18n } from '@freesewing/collection'
import { linkClasses } from '@freesewing/utils'
export function menuDesignOptionsStructure(design, options, settings, asFullList = false) { export function menuDesignOptionsStructure(design, options, settings, asFullList = false) {
if (!options) return options if (!options) return options

View file

@ -1,6 +1,5 @@
import React from 'react' import React from 'react'
import { defaultConfig } from '../config/index.mjs' import { defaultConfig } from '../config/index.mjs'
import { linkClasses } from '@freesewing/utils'
import { AsideIcon, RotateIcon, RocketIcon, UxIcon } from '@freesewing/react/components/Icon' import { AsideIcon, RotateIcon, RocketIcon, UxIcon } from '@freesewing/react/components/Icon'
export function menuUiPreferencesStructure() { export function menuUiPreferencesStructure() {