Skip to content

Commit

Permalink
Reinstate settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ochafik committed Dec 23, 2024
1 parent 009033d commit 50fabf8
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 10 deletions.
3 changes: 3 additions & 0 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Menu } from 'primereact/menu';
import { Toast } from 'primereact/toast';
import HelpMenu from './HelpMenu';
import ExportButton from './ExportButton';
import SettingsMenu from './SettingsMenu';


export default function Footer({style}: {style?: CSSProperties}) {
Expand Down Expand Up @@ -76,6 +77,8 @@ export default function Footer({style}: {style?: CSSProperties}) {

<div style={{flex: 1}}></div>

<SettingsMenu />

<HelpMenu style={{
position: 'absolute',
right: 0,
Expand Down
8 changes: 1 addition & 7 deletions src/components/SettingsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,10 @@ export default function SettingsMenu({className, style}: {className?: string, st
},
{
label: state.view.showAxes ? 'Hide axes' : 'Show axes',
icon: 'pi pi-box',
icon: 'pi pi-asterisk',
// disabled: true,
command: () => model.mutate(s => s.view.showAxes = !s.view.showAxes)
},
{
label: state.view.showShadows ? 'Hide shadows' : 'Add shadows',
icon: 'pi pi-box',
// disabled: true,
command: () => model.mutate(s => s.view.showShadows = !s.view.showShadows)
},
{
label: state.view.lineNumbers ? 'Hide line numbers' : 'Show line numbers',
icon: 'pi pi-list',
Expand Down
1 change: 0 additions & 1 deletion src/state/app-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export interface State {

color: string,
showAxes?: boolean,
showShadows?: boolean,
lineNumbers?: boolean,
}

Expand Down
1 change: 0 additions & 1 deletion src/state/fragment-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export async function readStateFromFragment(): Promise<State | null> {
collapsedCustomizerTabs: validateArray(view?.collapsedCustomizerTabs, validateString),
color: validateString(view?.color, () => defaultModelColor),
showAxes: validateBoolean(view?.layout?.showAxis, () => true),
showShadows: validateBoolean(view?.layout?.showShadow, () => true),
lineNumbers: validateBoolean(view?.layout?.lineNumbers, () => false)
}
};
Expand Down
1 change: 0 additions & 1 deletion src/state/initial-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export function createInitialState(state: State | null, content: string = defaul
}

initialState.view.showAxes ??= true
initialState.view.showShadows ??= true

// fs.writeFile(initialState.params.sourcePath, initialState.params.source);
// if (initialState.params.sourcePath !== defaultSourcePath) {
Expand Down

0 comments on commit 50fabf8

Please sign in to comment.