1
0
Fork 0

chore(components): Fixed linter warnings

This commit is contained in:
Joost De Cock 2020-08-23 17:00:24 +02:00
parent de0ee0d8e7
commit 308fd6afa3
5 changed files with 5 additions and 13 deletions

View file

@ -4,7 +4,7 @@ import Event from './event'
const DraftEvents = ({ events }) => (
<div className="draft-events">
{['error', 'warning', 'debug'].map((type) => (
<div className={`events-${type}`}>
<div className={`events-${type}`} id={type}>
{events[type].map((event, index) => (
<Event event={event} type={type} key={index} />
))}

View file

@ -3,7 +3,6 @@ import Draft from '../../Draft'
import Zoombox from '../Zoombox'
import Design from '../Design'
import DraftConfigurator from '../../DraftConfigurator'
import { FormattedMessage } from 'react-intl'
import Prism from 'prismjs'
import fileSaver from 'file-saver'
import theme from '@freesewing/plugin-theme'
@ -101,11 +100,6 @@ const DraftPattern = (props) => {
}
}
let gist = Prism.highlight(
JSON.stringify(props.gist, null, 2),
Prism.languages.javascript,
'javascript'
)
let iconProps = {
size: 'small',
style: styles.icon,

View file

@ -1,4 +1,4 @@
import React, { useState } from 'react'
import React from 'react'
import Prism from 'prismjs'
const PatternJson = (props) => {

View file

@ -1,7 +1,6 @@
import React from 'react'
import SampleConfigurator from '../../SampleConfigurator'
import svgattrPlugin from '@freesewing/plugin-svgattr'
import { FormattedMessage } from 'react-intl'
const SamplePattern = (props) => {
let pattern = new props.Pattern(props.gist.settings).use(svgattrPlugin, {

View file

@ -42,14 +42,13 @@ const Zoombox = (props) => {
evt.preventDefault()
setPanning(false)
setPanFrom(false)
updateViewBox(evt)
updateViewBox()
}
}
const handlePan = (evt) => {
if (!dragging && panning) {
evt.stopPropagation()
evt.preventDefault()
let x, y
if (from[0] + (evt.clientX - panFrom[0]) <= -5) {
// Bump into left
} else if (from[1] + (evt.clientY - panFrom[1]) <= -5) {
@ -75,7 +74,7 @@ const Zoombox = (props) => {
}
const handleMouseUp = (evt) => {
if (dragging == 2) {
updateViewBox(evt)
updateViewBox()
if (falseAlarm) setFalseAlarm(false)
} else {
setFalseAlarm(true)
@ -97,7 +96,7 @@ const Zoombox = (props) => {
setTo([evt.clientX - box.x, evt.clientY - box.y])
}
}
const updateViewBox = (evt) => {
const updateViewBox = () => {
props.setViewBox(
from[0] * factor +
' ' +