Skip to content

Commit

Permalink
feat(Layout): added bottombar with key sig and latency
Browse files Browse the repository at this point in the history
  • Loading branch information
ArTiSTiX committed Jan 5, 2024
1 parent 11d8a0d commit bf81f69
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 44 deletions.
30 changes: 3 additions & 27 deletions src/renderer/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,7 @@ const router = createHashRouter(
</ChordDisplay>
}
>
<Route
path="settings"
element={
<>
<QuickChangeKeyToolbar />
<ChordDisplayNamespaceSettings parentPath="../.." />
</>
}
/>
<Route path="settings" element={<ChordDisplayNamespaceSettings parentPath="../.." />} />
</Route>
<Route
path="circle-of-fifths"
Expand All @@ -74,15 +66,7 @@ const router = createHashRouter(
</MidiMessageManagerProvider>
}
>
<Route
path="settings"
element={
<>
<QuickChangeKeyToolbar />
<CircleOfFifthsSettings />
</>
}
/>
<Route path="settings" element={<CircleOfFifthsSettings />} />
</Route>
<Route
path="quiz"
Expand All @@ -94,15 +78,7 @@ const router = createHashRouter(
</MidiMessageManagerProvider>
}
>
<Route
path="settings"
element={
<>
<QuickChangeKeyToolbar />
<ChordQuizSettings />
</>
}
/>
<Route path="settings" element={<ChordQuizSettings />} />
</Route>
<Route
path="chord-dictionary"
Expand Down
22 changes: 22 additions & 0 deletions src/renderer/views/Layout/BottomBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import classnames from 'classnames/bind';

import { Stack, StackSeparator, Toolbar } from '@la-jarre-a-son/ui';

import styles from './Layout.module.scss';
import LatencyMonitor from './LatencyMonitor';
import { QuickChangeKeyToolbar } from '../Settings/NotationSettings';

const cx = classnames.bind(styles);

const BottomBar: React.FC = () => {
return (
<Toolbar as={Stack} elevation={3} placement="bottom" className={cx('bottombar')}>
<QuickChangeKeyToolbar />
<StackSeparator />
<LatencyMonitor />
</Toolbar>
);
};

export default BottomBar;
4 changes: 4 additions & 0 deletions src/renderer/views/Layout/Layout.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
}
}

.bottombar {
padding: 0 4px;
}

.titlebar {
-webkit-app-region: drag;
display: flex;
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/views/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import About from 'renderer/views/Settings/About';
import TopBar from './TopBar';

import styles from './Layout.module.scss';
import BottomBar from './BottomBar';

const cx = classnames.bind(styles);

Expand Down Expand Up @@ -66,6 +67,7 @@ const Layout: React.FC = () => {
)}
</ModalContainer>
</div>
<BottomBar />
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export const QuickChangeKeyToolbar: React.FC = () => {
const { settings, updateSetting } = useSettings();

return (
<Box elevation={2} pad="md">
<InputGroup block>
<InputContainerLabel>Key Signature</InputContainerLabel>
<Box elevation={2}>
<InputGroup as="label" block>
<InputContainerLabel>Key</InputContainerLabel>
<Select
onChange={(value: string) => updateSetting('notation.key', value)}
value={settings.notation.key}
Expand Down
7 changes: 0 additions & 7 deletions src/renderer/views/Settings/Routing/Routing.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ $View_SettingsRouting_padding: $space-lg !default;
overflow: hidden;
}

.latency {
padding: 0 $View_SettingsRouting_padding;
margin-left: auto;
display: flex;
align-items: center;
}

.container {
flex-grow: 1;
padding: 0 $View_SettingsRouting_padding;
Expand Down
8 changes: 1 addition & 7 deletions src/renderer/views/Settings/Routing/Routing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useMidiRouting } from 'renderer/contexts/MidiRouting';
import { Box, Toolbar, Button, StackSeparator } from '@la-jarre-a-son/ui';
import { Icon } from 'renderer/components';

import LatencyMonitor from './LatencyMonitor';
import LatencyMonitor from '../../Layout/LatencyMonitor';

Check warning on line 9 in src/renderer/views/Settings/Routing/Routing.tsx

View workflow job for this annotation

GitHub Actions / test (windows-latest)

'LatencyMonitor' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 9 in src/renderer/views/Settings/Routing/Routing.tsx

View workflow job for this annotation

GitHub Actions / test (windows-latest)

'LatencyMonitor' is defined but never used. Allowed unused vars must match /^_/u
import Graph from './Graph';

import styles from './Routing.module.scss';
Expand All @@ -19,12 +19,6 @@ const Routing: React.FC = () => {

return (
<div className={cx('base')}>
<Toolbar elevation={2}>
<div className={cx('latency')}>
Latency:&nbsp;
<LatencyMonitor />
</div>
</Toolbar>
<Box pad="md" className={cx('container')}>
<Graph
inputs={inputs}
Expand Down

0 comments on commit bf81f69

Please sign in to comment.