1
0
Fork 0

lint fixes

This commit is contained in:
Enoch Riese 2022-11-14 16:53:31 -06:00
parent 18f588dc99
commit 3676c7af07
6 changed files with 13 additions and 12 deletions

View file

@ -67,4 +67,6 @@ const SvgWrapper = forwardRef((props, ref) => {
) )
}) })
SvgWrapper.displayName = 'SvgWrapper'
export default SvgWrapper export default SvgWrapper

View file

@ -32,7 +32,7 @@ export const handleExport = async (format, gist, design, t, app, onComplete, onE
app.startLoading() app.startLoading()
// get a worker going // get a worker going
const worker = new Worker(new URL('./export-worker.js', import.meta.url), { type: module }) const worker = new Worker(new URL('./export-worker.js', import.meta.url), { type: 'module' })
// listen for the worker's message back // listen for the worker's message back
worker.addEventListener('message', (e) => { worker.addEventListener('message', (e) => {
@ -56,7 +56,6 @@ export const handleExport = async (format, gist, design, t, app, onComplete, onE
app.stopLoading() app.stopLoading()
}) })
let svg = ''
// pdf settings // pdf settings
const settings = { const settings = {
...defaultPdfSettings, ...defaultPdfSettings,

View file

@ -56,9 +56,6 @@ const Stack = (props) => {
const stackLayout = layout.stacks?.[stackName] const stackLayout = layout.stacks?.[stackName]
// // Don't just assume this makes sense
if (typeof stackLayout?.move?.x === 'undefined') return null
// Use a ref for direct DOM manipulation // Use a ref for direct DOM manipulation
const stackRef = useRef(null) const stackRef = useRef(null)
const centerRef = useRef(null) const centerRef = useRef(null)
@ -82,6 +79,9 @@ const Stack = (props) => {
handleDrag(select(stackRef.current)) handleDrag(select(stackRef.current))
}, [rotate, stackRef, stackLayout]) }, [rotate, stackRef, stackLayout])
// // Don't just assume this makes sense
if (typeof stackLayout?.move?.x === 'undefined') return null
// These are kept as vars because re-rendering on drag would kill performance // These are kept as vars because re-rendering on drag would kill performance
// Managing the difference between re-render and direct DOM updates makes this // Managing the difference between re-render and direct DOM updates makes this
// whole thing a bit tricky to wrap your head around // whole thing a bit tricky to wrap your head around
@ -144,7 +144,7 @@ const Stack = (props) => {
didDrag = true didDrag = true
setTransforms() setTransforms()
}) })
.on('end', function (event) { .on('end', function () {
// save to gist if anything actually changed // save to gist if anything actually changed
if (didDrag) updateLayout() if (didDrag) updateLayout()
@ -152,7 +152,7 @@ const Stack = (props) => {
}) })
/** reset the part's transforms */ /** reset the part's transforms */
const resetPart = (event) => { const resetPart = () => {
rotation = 0 rotation = 0
flipX = 0 flipX = 0
flipY = 0 flipY = 0

View file

@ -13,7 +13,7 @@ const PrintLayout = (props) => {
// disable xray // disable xray
useEffect(() => { useEffect(() => {
if (props.gist?._state?.xray?.enabled) props.updateGist(['_state', 'xray', 'enabled'], false) if (props.gist?._state?.xray?.enabled) props.updateGist(['_state', 'xray', 'enabled'], false)
}, []) })
const { t } = useTranslation(['workbench']) const { t } = useTranslation(['workbench'])
const [error, setError] = useState(false) const [error, setError] = useState(false)
@ -45,8 +45,8 @@ const PrintLayout = (props) => {
props.design, props.design,
t, t,
props.app, props.app,
(e) => setError(false), () => setError(false),
(e) => setError(true) () => setError(true)
) )
} }

View file

@ -96,7 +96,7 @@ const doScanForBlanks = (stacks, layout, x, y, w, h) => {
const basePlugin = ({ const basePlugin = ({
sheetWidth, sheetWidth,
sheetHeight, sheetHeight,
boundary = false, // boundary = false,
partName = 'pages', partName = 'pages',
responsiveColumns = true, responsiveColumns = true,
printStyle = false, printStyle = false,

View file

@ -7,10 +7,10 @@ import ExportIcon from 'shared/components/icons/export'
import { useTranslation } from 'next-i18next' import { useTranslation } from 'next-i18next'
const PrintLayoutSettings = (props) => { const PrintLayoutSettings = (props) => {
const { t } = useTranslation(['workbench'])
let pages = props.draft?.setStores[0].get('pages') let pages = props.draft?.setStores[0].get('pages')
if (!pages) return null if (!pages) return null
const { cols, rows, count } = pages const { cols, rows, count } = pages
const { t } = useTranslation(['workbench'])
const setMargin = (evt) => { const setMargin = (evt) => {
props.updateGist( props.updateGist(