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 = () => (
<path
strokeLinkecap="round"
strokeLinecap="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"
/>
@ -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" />
)
/** buttons for manipulating the part */
export const Buttons = ({ transform, flip, rotate, resetPart, rotate90, iconSize }) => {
return (

View file

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

View file

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

View file

@ -2,7 +2,7 @@ import React from 'react'
// Dependencies
import { defaultConfig as config } from '../config/index.mjs'
import { measurementAsMm } from '@freesewing/utils'
import { linkClasses } from '@freesewing/utils'
/*
* Components
* 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 { designOptionType, set, orderBy } from '@freesewing/utils'
import { i18n } from '@freesewing/collection'
import { linkClasses } from '@freesewing/utils'
export function menuDesignOptionsStructure(design, options, settings, asFullList = false) {
if (!options) return options

View file

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