Merged PR 170: Add new eslint rules
- naming-convention - prefer-arrow-callback - func-style - import/no-default-export
This commit is contained in:
parent
3f58c5ba5e
commit
ad126c6c28
65 changed files with 781 additions and 784 deletions
|
@ -1,6 +1,6 @@
|
|||
import * as React from 'react';
|
||||
import { ISymbolModel } from '../../Interfaces/ISymbolModel';
|
||||
import { restoreX, transformX } from '../../utils/svg';
|
||||
import { RestoreX, TransformX } from '../../utils/svg';
|
||||
import { InputGroup } from '../InputGroup/InputGroup';
|
||||
|
||||
interface ISymbolFormProps {
|
||||
|
@ -8,7 +8,8 @@ interface ISymbolFormProps {
|
|||
symbols: Map<string, ISymbolModel>
|
||||
onChange: (key: string, value: string | number | boolean) => void
|
||||
}
|
||||
const SymbolForm: React.FunctionComponent<ISymbolFormProps> = (props) => {
|
||||
|
||||
export function SymbolForm(props: ISymbolFormProps): JSX.Element {
|
||||
return (
|
||||
<div className='grid grid-cols-2 gap-y-4'>
|
||||
<InputGroup
|
||||
|
@ -18,17 +19,15 @@ const SymbolForm: React.FunctionComponent<ISymbolFormProps> = (props) => {
|
|||
inputClassName=''
|
||||
type='string'
|
||||
value={props.symbol.id.toString()}
|
||||
isDisabled={true}
|
||||
/>
|
||||
isDisabled={true} />
|
||||
<InputGroup
|
||||
labelText='x'
|
||||
inputKey='x'
|
||||
labelClassName=''
|
||||
inputClassName=''
|
||||
type='number'
|
||||
value={transformX(props.symbol.x, props.symbol.width, props.symbol.config.XPositionReference).toString()}
|
||||
onChange={(event) => props.onChange('x', restoreX(Number(event.target.value), props.symbol.width, props.symbol.config.XPositionReference))}
|
||||
/>
|
||||
value={TransformX(props.symbol.x, props.symbol.width, props.symbol.config.XPositionReference).toString()}
|
||||
onChange={(event) => props.onChange('x', RestoreX(Number(event.target.value), props.symbol.width, props.symbol.config.XPositionReference))} />
|
||||
<InputGroup
|
||||
labelText='Height'
|
||||
inputKey='height'
|
||||
|
@ -37,8 +36,7 @@ const SymbolForm: React.FunctionComponent<ISymbolFormProps> = (props) => {
|
|||
type='number'
|
||||
min={0}
|
||||
value={props.symbol.height.toString()}
|
||||
onChange={(event) => props.onChange('height', Number(event.target.value))}
|
||||
/>
|
||||
onChange={(event) => props.onChange('height', Number(event.target.value))} />
|
||||
<InputGroup
|
||||
labelText='Width'
|
||||
inputKey='width'
|
||||
|
@ -47,10 +45,7 @@ const SymbolForm: React.FunctionComponent<ISymbolFormProps> = (props) => {
|
|||
type='number'
|
||||
min={0}
|
||||
value={props.symbol.width.toString()}
|
||||
onChange={(event) => props.onChange('width', Number(event.target.value))}
|
||||
/>
|
||||
onChange={(event) => props.onChange('width', Number(event.target.value))} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SymbolForm;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue