Skip to content

Commit

Permalink
fix: settings icon and flex overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gorjan5sk committed Jul 8, 2021
1 parent 80d7753 commit 1231226
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 58 deletions.
3 changes: 0 additions & 3 deletions app/assets/icons/ic-settings-filled.svg

This file was deleted.

3 changes: 3 additions & 0 deletions app/assets/icons/ic-settings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions app/assets/javascripts/components/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import HelpIcon from '../../icons/ic-help.svg';
import KeyboardIcon from '../../icons/ic-keyboard.svg';
import ListedIcon from '../../icons/ic-listed.svg';
import SecurityIcon from '../../icons/ic-security.svg';
import SettingsFilledIcon from '../../icons/ic-settings-filled.svg';
import SettingsIcon from '../../icons/ic-settings.svg';
import StarIcon from '../../icons/ic-star.svg';
import ThemesIcon from '../../icons/ic-themes.svg';
import UserIcon from '../../icons/ic-user.svg';
Expand Down Expand Up @@ -47,7 +47,7 @@ const ICONS = {
keyboard: KeyboardIcon,
listed: ListedIcon,
security: SecurityIcon,
'settings-filled': SettingsFilledIcon,
settings: SettingsIcon,
star: StarIcon,
themes: ThemesIcon,
user: UserIcon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface PreferenceListItem extends PreferenceItem {
}

const predefinedItems: PreferenceItem[] = [
{ label: 'General', icon: 'settings-filled' },
{ label: 'General', icon: 'settings' },
{ label: 'Account', icon: 'user' },
{ label: 'Appearance', icon: 'themes' },
{ label: 'Security', icon: 'security' },
Expand Down
33 changes: 0 additions & 33 deletions app/assets/javascripts/components/preferences/pane.tsx

This file was deleted.

42 changes: 24 additions & 18 deletions app/assets/javascripts/components/preferences/view.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
import { IconButton } from '@/components/IconButton';
import { TitleBar, Title } from '@/components/TitleBar';
import { FunctionComponent } from 'preact';
import { PreferencesPane } from './pane';
import { MockState } from './mock-state';
import { PreferencesMenu } from './menu';

interface PreferencesViewProps {
close: () => void;
}

export const PreferencesView: FunctionComponent<PreferencesViewProps> = ({
close,
}) => (
<div className="sn-full-screen flex flex-col bg-contrast z-index-preferences">
<TitleBar className="items-center justify-between">
{/* div is added so flex justify-between can center the title */}
<div className="h-8 w-8" />
<Title className="text-lg">Your preferences for Standard Notes</Title>
<IconButton
onClick={() => {
close();
}}
type="normal"
iconType="close"
/>
</TitleBar>
<PreferencesPane />
</div>
);
}) => {
const store = new MockState();
return (
<div className="sn-full-screen flex flex-col bg-contrast z-index-preferences">
<TitleBar className="items-center justify-between">
{/* div is added so flex justify-between can center the title */}
<div className="h-8 w-8" />
<Title className="text-lg">Your preferences for Standard Notes</Title>
<IconButton
onClick={() => {
close();
}}
type="normal"
iconType="close"
/>
</TitleBar>
<div className="flex flex-row flex-grow min-h-0">
<PreferencesMenu store={store}></PreferencesMenu>
</div>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { action, computed, makeObservable, observable } from 'mobx';

export class PreferencesState {
private _open = false;
private _open = true;

constructor() {
makeObservable<PreferencesState, '_open'>(this, {
Expand Down

0 comments on commit 1231226

Please sign in to comment.