chore: Fixed linter warnings
This commit is contained in:
parent
67da7dd595
commit
74cf28b871
6 changed files with 6 additions and 19 deletions
|
@ -7,7 +7,7 @@ const XrayPart = props => {
|
||||||
// Don't bother if this is the only part on display
|
// Don't bother if this is the only part on display
|
||||||
if (props.gist.only && props.gist.only.length === 1) return null
|
if (props.gist.only && props.gist.only.length === 1) return null
|
||||||
const i = props.gist._state?.xray?.reveal
|
const i = props.gist._state?.xray?.reveal
|
||||||
? Object.keys(props.gist._state?.xray.reveal).indexOf(props.partName)%10
|
? Object.keys(props.gist._state.xray.reveal).indexOf(props.partName)%10
|
||||||
: 0
|
: 0
|
||||||
const { topLeft, bottomRight } = props.part
|
const { topLeft, bottomRight } = props.part
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,6 @@ import Snippet from '../draft/snippet'
|
||||||
import { getProps } from '../draft/utils'
|
import { getProps } from '../draft/utils'
|
||||||
import { drag } from 'd3-drag'
|
import { drag } from 'd3-drag'
|
||||||
import { select } from 'd3-selection'
|
import { select } from 'd3-selection'
|
||||||
import { event } from 'd3-dispatch'
|
|
||||||
|
|
||||||
const Buttons = ({ transform, flip, rotate, setRotate, resetPart }) => {
|
const Buttons = ({ transform, flip, rotate, setRotate, resetPart }) => {
|
||||||
const letter = 'F'
|
const letter = 'F'
|
||||||
|
@ -136,7 +135,7 @@ const generateTransform = (x, y, rot, flipX, flipY, part) => {
|
||||||
'scale(-1, 1)',
|
'scale(-1, 1)',
|
||||||
`translate(${center.x * -1 + 2 * dx}, ${center.y})`
|
`translate(${center.x * -1 + 2 * dx}, ${center.y})`
|
||||||
)
|
)
|
||||||
if (flipX) transforms.push(
|
if (flipY) transforms.push(
|
||||||
`translate(${center.x * -1}, ${center.y * -1})`,
|
`translate(${center.x * -1}, ${center.y * -1})`,
|
||||||
'scale(1, -1)',
|
'scale(1, -1)',
|
||||||
`translate(${center.x}, ${center.y * -1 + 2 * dy})`,
|
`translate(${center.x}, ${center.y * -1 + 2 * dy})`,
|
||||||
|
@ -153,7 +152,7 @@ const Part = props => {
|
||||||
const partLayout= layout.parts[name]
|
const partLayout= layout.parts[name]
|
||||||
|
|
||||||
// Don't just assume this makes sense
|
// Don't just assume this makes sense
|
||||||
if (typeof layout?.parts?.[name]?.move?.x === 'undefined') return null
|
if (typeof layout.parts.[name].move?.x === 'undefined') return null
|
||||||
|
|
||||||
// Use a ref for direct DOM manipulation
|
// Use a ref for direct DOM manipulation
|
||||||
const partRef = useRef(null)
|
const partRef = useRef(null)
|
||||||
|
@ -175,7 +174,7 @@ const Part = props => {
|
||||||
let rotation = partLayout.rotate || 0
|
let rotation = partLayout.rotate || 0
|
||||||
let flipX = partLayout.flipX ? true : false
|
let flipX = partLayout.flipX ? true : false
|
||||||
let flipY = partLayout.flipY ? true : false
|
let flipY = partLayout.flipY ? true : false
|
||||||
let rotStart = { x: 0, y: 0 }
|
let rotStart
|
||||||
let partRect
|
let partRect
|
||||||
|
|
||||||
const center = {
|
const center = {
|
||||||
|
@ -184,7 +183,6 @@ const Part = props => {
|
||||||
}
|
}
|
||||||
const handleDrag = drag()
|
const handleDrag = drag()
|
||||||
.subject(function() {
|
.subject(function() {
|
||||||
const me = select(this);
|
|
||||||
return { x: translateX, y: translateY }
|
return { x: translateX, y: translateY }
|
||||||
})
|
})
|
||||||
.on('start', function(event) {
|
.on('start', function(event) {
|
||||||
|
@ -305,7 +303,7 @@ const Part = props => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const Draft = props => {
|
const Draft = props => {
|
||||||
const { patternProps, gist, app, updateGist, unsetGist, bgProps={} } = props
|
const { patternProps, gist, app, bgProps={} } = props
|
||||||
const { layout=false } = gist
|
const { layout=false } = gist
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
@ -4,11 +4,6 @@ import Settings from './settings'
|
||||||
import Draft from '../draft'
|
import Draft from '../draft'
|
||||||
import pluginBuilder from './plugin'
|
import pluginBuilder from './plugin'
|
||||||
|
|
||||||
const addPages = (gist) => {
|
|
||||||
const pages = []
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const PrintLayout = props => {
|
const PrintLayout = props => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import { useTranslation } from 'next-i18next'
|
|
||||||
import PageSizePicker from './pagesize-picker'
|
import PageSizePicker from './pagesize-picker'
|
||||||
import OrientationPicker from './orientation-picker'
|
import OrientationPicker from './orientation-picker'
|
||||||
import PrintIcon from 'shared/components/icons/print'
|
import PrintIcon from 'shared/components/icons/print'
|
||||||
|
@ -6,10 +5,6 @@ import RightIcon from 'shared/components/icons/right'
|
||||||
|
|
||||||
const PrintLayoutSettings = props => {
|
const PrintLayoutSettings = props => {
|
||||||
if (!props.draft?.parts?.pages?.pages) return null
|
if (!props.draft?.parts?.pages?.pages) return null
|
||||||
const settingsProps = {
|
|
||||||
gist: props.gist,
|
|
||||||
updateGist: props.updateGist
|
|
||||||
}
|
|
||||||
const { cols, rows, count } = props.draft.parts.pages.pages
|
const { cols, rows, count } = props.draft.parts.pages.pages
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -35,7 +35,6 @@ const View = props => {
|
||||||
{
|
{
|
||||||
name: 'export',
|
name: 'export',
|
||||||
title: t('exportThing', { thing: props.pattern.config.name }),
|
title: t('exportThing', { thing: props.pattern.config.name }),
|
||||||
title: t('export'),
|
|
||||||
onClick: () => props.updateGist(['_state', 'view'], 'export')
|
onClick: () => props.updateGist(['_state', 'view'], 'export')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,7 +41,7 @@ const Xray = props => {
|
||||||
<Reset {...props} />
|
<Reset {...props} />
|
||||||
{
|
{
|
||||||
props.gist?._state?.xray?.parts &&
|
props.gist?._state?.xray?.parts &&
|
||||||
Object.keys(props.gist._state?.xray.parts).map(partName => <List {...props} partName={partName} />)
|
Object.keys(props.gist._state.xray.parts).map(partName => <List {...props} partName={partName} />)
|
||||||
}
|
}
|
||||||
</Ul>
|
</Ul>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue