1
0
Fork 0

chore [react]: Prettier

This commit is contained in:
joostdecock 2025-06-01 17:04:47 +02:00
parent 47d4a27f64
commit daaf407028
8 changed files with 33 additions and 15 deletions

View file

@ -22,7 +22,9 @@ export const Breadcrumbs = ({ crumbs = [], title, Link = false }) => {
style={{ paddingLeft: 0 }}
>
<li className="tw:inline">
<Link href="/"><b>Home</b></Link>
<Link href="/">
<b>Home</b>
</Link>
</li>
<Spacer />
{crumbs.map((crumb, i) => (
@ -30,7 +32,9 @@ export const Breadcrumbs = ({ crumbs = [], title, Link = false }) => {
<li key={i} className="tw:inline">
<Link href={crumb.href}>{crumb.label}</Link>
</li>
<li key={i} className="tw:inline"><Spacer /></li>
<li key={i} className="tw:inline">
<Spacer />
</li>
</React.Fragment>
))}
<li className="tw:inline">{title}</li>

View file

@ -29,7 +29,14 @@ const handleCopied = (content, setCopied, setLoadingStatus, label, handler=false
* @param {boolean} props.sup - Set this to true to render as superscript (above the line)
* @returns {JSX.Element}
*/
export const CopyToClipboardButton = ({ children, content, label = false, sup = false, btnClasses="tw:daisy-btn tw:daisy-btn-ghost tw:hover:border-transparent w:hover:border-transparent tw:hover:shadow-none", onCopy=false }) => {
export const CopyToClipboardButton = ({
children,
content,
label = false,
sup = false,
btnClasses = 'tw:daisy-btn tw:daisy-btn-ghost tw:hover:border-transparent w:hover:border-transparent tw:hover:shadow-none',
onCopy = false,
}) => {
const [copied, setCopied] = useState(false)
const { setLoadingStatus } = useContext(LoadingStatusContext)

View file

@ -88,7 +88,8 @@ export const TestView = ({ Design, state, update, config }) => {
't',
'ASC'
)
const btnClasses = "tw:my-0.5 tw:block tw:daisy-btn tw:daisy-btn-primary tw:daisy-btn-outline tw:daisy-btn-xs tw:flex tw:flex-row tw:items-center tw:justify-between tw:w-full tw:max-w-64"
const btnClasses =
'tw:my-0.5 tw:block tw:daisy-btn tw:daisy-btn-primary tw:daisy-btn-outline tw:daisy-btn-xs tw:flex tw:flex-row tw:items-center tw:justify-between tw:w-full tw:max-w-64'
return (
<>
@ -162,7 +163,8 @@ const SampleOptionsMenu = ({ Design, state, update }) => {
const SampleOptionsSubMenu = ({ structure, update, level = 1 }) => {
const output = []
const btnClasses = "tw:my-0.5 tw:block tw:daisy-btn tw:daisy-btn-primary tw:daisy-btn-outline tw:daisy-btn-xs tw:flex tw:flex-row tw:items-center tw:justify-between tw:w-full tw:max-w-64"
const btnClasses =
'tw:my-0.5 tw:block tw:daisy-btn tw:daisy-btn-primary tw:daisy-btn-outline tw:daisy-btn-xs tw:flex tw:flex-row tw:items-center tw:justify-between tw:w-full tw:max-w-64'
/*
* Show entries alphabetic, but force groups last, and advanced last among them
*/

View file

@ -110,15 +110,15 @@ export const UndoStep = ({ update, state, step, Design, compact = false, index =
<>
<ButtonFrame onClick={() => update.restore(index, state._)}>
<div className="tw:flex tw:flex-col tw:font-medium tw:items-end tw:w-full tw:-mb-2">
<div className="tw:text-sm tw:-mt-2 tw:italic"><UndoStepTimeAgo step={step} /></div>
<div className="tw:text-sm tw:-mt-2 tw:italic">
<UndoStepTimeAgo step={step} />
</div>
<div className="tw:flex tw:flex-row tw:items-center tw:justify-start tw:gap-2 tw:w-full tw:text-lg tw:-mt-2">
<span className="tw:opacity-70 tw:flex tw:flex-row tw:gap-1 tw:items-center tw:text-base">
{data.menu}
</span>
<span>&raquo;</span>
<span className="tw:flex tw:flex-row tw:gap-2 tw:items-center">
{data.title}
</span>
<span className="tw:flex tw:flex-row tw:gap-2 tw:items-center">{data.title}</span>
</div>
<div className="tw:flex tw:flex-row tw:gap-1 tw:items-center tw:align-start tw:w-full">
{data.msg ? (

View file

@ -119,4 +119,3 @@ export const H6 = ({ children }) => (
{children}
</h6>
)

View file

@ -11,7 +11,13 @@ import { ModalWrapper } from '@freesewing/react/components/Modal'
* @param {object} props - All component props
* @returns {JSX.Element}
*/
const Iframe = (props) => <iframe {...props} style={{ height: '90vh', width: '90vw' }} className="tw:w-full tw:mx-auto tw:max-w-4xl" />
const Iframe = (props) => (
<iframe
{...props}
style={{ height: '90vh', width: '90vw' }}
className="tw:w-full tw:mx-auto tw:max-w-4xl"
/>
)
/*
* A component to display an iframe with FreeSewing.eu docs content intended for a modal window.
@ -21,7 +27,9 @@ const Iframe = (props) => <iframe {...props} style={{ height: '90vh', width: '90
* @param {string} props.path - The (relative) URL path of the page to load
* @returns {JSX.Element}
*/
const DocsHelp = ({ path }) => <Iframe src={`https://freesewing.eu/${path}/?docusaurus-data-fs-embed=true`} />
const DocsHelp = ({ path }) => (
<Iframe src={`https://freesewing.eu/${path}/?docusaurus-data-fs-embed=true`} />
)
/*
* A component to display inline help for a design option

View file

@ -84,7 +84,6 @@ export const ModalWrapper = ({
onClick={keepOpenOnClick ? stopClick : null}
className={`tw:z-30 tw:bg-base-100 tw:p-4 tw:lg:px-8 tw:lg:rounded-lg tw:lg:shadow-lg tw:max-h-full tw:overflow-auto tw:hover:cursor-default ${
fullWidth ? 'tw:w-full' : ''
} ${wide ? 'tw:max-w-5xl tw:w-full' : ''} `}
>
{children}

View file

@ -711,4 +711,3 @@ Backend.prototype.updateSet = async function (id, data) {
Backend.prototype.uploadImage = async function (data) {
return await this.post('/images/jwt', data)
}