Merged PR 170: Add new eslint rules

- naming-convention
- prefer-arrow-callback
- func-style
- import/no-default-export
This commit is contained in:
Eric Nguyen 2022-08-26 16:13:21 +00:00
parent 3f58c5ba5e
commit ad126c6c28
65 changed files with 781 additions and 784 deletions

View file

@ -1,6 +1,6 @@
import * as React from 'react';
import { IAvailableContainer } from '../../Interfaces/IAvailableContainer';
import { truncateString } from '../../utils/stringtools';
import { TruncateString } from '../../utils/stringtools';
interface ISidebarProps {
componentOptions: IAvailableContainer[]
@ -8,11 +8,11 @@ interface ISidebarProps {
buttonOnClick: (type: string) => void
}
function handleDragStart(event: React.DragEvent<HTMLButtonElement>): void {
function HandleDragStart(event: React.DragEvent<HTMLButtonElement>): void {
event.dataTransfer.setData('type', (event.target as HTMLButtonElement).id);
}
export const Sidebar: React.FC<ISidebarProps> = (props: ISidebarProps) => {
export function Sidebar(props: ISidebarProps): JSX.Element {
const listElements = props.componentOptions.map(componentOption =>
<button type="button"
className='justify-center transition-all sidebar-component'
@ -21,9 +21,9 @@ export const Sidebar: React.FC<ISidebarProps> = (props: ISidebarProps) => {
title={componentOption.Type}
onClick={() => props.buttonOnClick(componentOption.Type)}
draggable={true}
onDragStart={(event) => handleDragStart(event)}
onDragStart={(event) => HandleDragStart(event)}
>
{truncateString(componentOption.Type, 5)}
{TruncateString(componentOption.Type, 5)}
</button>
);