1
0
Fork 0

chore: Fixed linter warnings

This commit is contained in:
Joost De Cock 2022-03-13 08:48:21 +01:00
parent 67da7dd595
commit 74cf28b871
6 changed files with 6 additions and 19 deletions

View file

@ -7,7 +7,7 @@ const XrayPart = props => {
// Don't bother if this is the only part on display
if (props.gist.only && props.gist.only.length === 1) return null
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
const { topLeft, bottomRight } = props.part

View file

@ -81,7 +81,6 @@ import Snippet from '../draft/snippet'
import { getProps } from '../draft/utils'
import { drag } from 'd3-drag'
import { select } from 'd3-selection'
import { event } from 'd3-dispatch'
const Buttons = ({ transform, flip, rotate, setRotate, resetPart }) => {
const letter = 'F'
@ -136,7 +135,7 @@ const generateTransform = (x, y, rot, flipX, flipY, part) => {
'scale(-1, 1)',
`translate(${center.x * -1 + 2 * dx}, ${center.y})`
)
if (flipX) transforms.push(
if (flipY) transforms.push(
`translate(${center.x * -1}, ${center.y * -1})`,
'scale(1, -1)',
`translate(${center.x}, ${center.y * -1 + 2 * dy})`,
@ -153,7 +152,7 @@ const Part = props => {
const partLayout= layout.parts[name]
// 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
const partRef = useRef(null)
@ -175,7 +174,7 @@ const Part = props => {
let rotation = partLayout.rotate || 0
let flipX = partLayout.flipX ? true : false
let flipY = partLayout.flipY ? true : false
let rotStart = { x: 0, y: 0 }
let rotStart
let partRect
const center = {
@ -184,7 +183,6 @@ const Part = props => {
}
const handleDrag = drag()
.subject(function() {
const me = select(this);
return { x: translateX, y: translateY }
})
.on('start', function(event) {
@ -305,7 +303,7 @@ const Part = props => {
}
const Draft = props => {
const { patternProps, gist, app, updateGist, unsetGist, bgProps={} } = props
const { patternProps, gist, app, bgProps={} } = props
const { layout=false } = gist
useEffect(() => {

View file

@ -4,11 +4,6 @@ import Settings from './settings'
import Draft from '../draft'
import pluginBuilder from './plugin'
const addPages = (gist) => {
const pages = []
}
const PrintLayout = props => {
useEffect(() => {

View file

@ -1,4 +1,3 @@
import { useTranslation } from 'next-i18next'
import PageSizePicker from './pagesize-picker'
import OrientationPicker from './orientation-picker'
import PrintIcon from 'shared/components/icons/print'
@ -6,10 +5,6 @@ import RightIcon from 'shared/components/icons/right'
const PrintLayoutSettings = props => {
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
return (

View file

@ -35,7 +35,6 @@ const View = props => {
{
name: 'export',
title: t('exportThing', { thing: props.pattern.config.name }),
title: t('export'),
onClick: () => props.updateGist(['_state', 'view'], 'export')
},
{

View file

@ -41,7 +41,7 @@ const Xray = props => {
<Reset {...props} />
{
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>
)}