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
|
@ -6,14 +6,14 @@ interface IMainMenuProps {
|
|||
}
|
||||
|
||||
enum WindowState {
|
||||
MAIN,
|
||||
LOAD,
|
||||
Main,
|
||||
Load,
|
||||
}
|
||||
|
||||
export const MainMenu: React.FC<IMainMenuProps> = (props) => {
|
||||
const [windowState, setWindowState] = React.useState(WindowState.MAIN);
|
||||
export function MainMenu(props: IMainMenuProps): JSX.Element {
|
||||
const [windowState, setWindowState] = React.useState(WindowState.Main);
|
||||
switch (windowState) {
|
||||
case WindowState.LOAD:
|
||||
case WindowState.Load:
|
||||
return (
|
||||
<div className='flex flex-col drop-shadow-lg bg-blue-50 p-12 rounded-lg absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2'>
|
||||
<form className="flex items-center space-x-6">
|
||||
|
@ -37,7 +37,7 @@ export const MainMenu: React.FC<IMainMenuProps> = (props) => {
|
|||
</label>
|
||||
</form>
|
||||
<button type="button"
|
||||
onClick={() => setWindowState(WindowState.MAIN)}
|
||||
onClick={() => setWindowState(WindowState.Main)}
|
||||
className='normal-btn block
|
||||
mt-8 '
|
||||
>
|
||||
|
@ -50,7 +50,7 @@ export const MainMenu: React.FC<IMainMenuProps> = (props) => {
|
|||
return (
|
||||
<div className='absolute bg-blue-50 p-12 rounded-lg drop-shadow-lg grid grid-cols-1 md:grid-cols-2 gap-8 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2'>
|
||||
<button type="button" className='mainmenu-btn' onClick={props.newEditor}>Start from scratch</button>
|
||||
<button type="button" className='mainmenu-btn' onClick={() => setWindowState(WindowState.LOAD)}>Load a configuration file</button>
|
||||
<button type="button" className='mainmenu-btn' onClick={() => setWindowState(WindowState.Load)}>Load a configuration file</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue