Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command Palette: additional icons / css fix #251

Merged
merged 3 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/ui/icons/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,13 @@ export const Sql = (props: SvgIconProps) => (
<path d="M12 10.5C9.5 10.5 7.375 10.1083 5.625 9.325C3.875 8.54167 3 7.6 3 6.5C3 5.4 3.875 4.45833 5.625 3.675C7.375 2.89167 9.5 2.5 12 2.5C14.5 2.5 16.625 2.89167 18.375 3.675C20.125 4.45833 21 5.4 21 6.5C21 7.6 20.125 8.54167 18.375 9.325C16.625 10.1083 14.5 10.5 12 10.5ZM12 15.5C9.5 15.5 7.375 15.1083 5.625 14.325C3.875 13.5417 3 12.6 3 11.5V9C3 9.73333 3.34167 10.3543 4.025 10.863C4.70833 11.371 5.525 11.7833 6.475 12.1C7.425 12.4167 8.41267 12.6457 9.438 12.787C10.4627 12.929 11.3167 13 12 13C12.6833 13 13.5373 12.929 14.562 12.787C15.5873 12.6457 16.575 12.4167 17.525 12.1C18.475 11.7833 19.2917 11.371 19.975 10.863C20.6583 10.3543 21 9.73333 21 9V11.5C21 12.6 20.125 13.5417 18.375 14.325C16.625 15.1083 14.5 15.5 12 15.5ZM12 20.5C9.5 20.5 7.375 20.1083 5.625 19.325C3.875 18.5417 3 17.6 3 16.5V14C3 14.7333 3.34167 15.3543 4.025 15.863C4.70833 16.371 5.525 16.7833 6.475 17.1C7.425 17.4167 8.41267 17.646 9.438 17.788C10.4627 17.9293 11.3167 18 12 18C12.6833 18 13.5373 17.9293 14.562 17.788C15.5873 17.646 16.575 17.4167 17.525 17.1C18.475 16.7833 19.2917 16.371 19.975 15.863C20.6583 15.3543 21 14.7333 21 14V16.5C21 17.6 20.125 18.5417 18.375 19.325C16.625 20.1083 14.5 20.5 12 20.5Z" />
</SvgIcon>
);

export const SaveFileOutlined = (props: SvgIconProps) => (
<SvgIcon {...props}>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M4.588 21.413C4.97933 21.8043 5.45 22 6 22H18C18.55 22 19.021 21.8043 19.413 21.413C19.8043 21.021 20 20.55 20 20V8L14 2H6C5.45 2 4.97933 2.19567 4.588 2.587C4.196 2.979 4 3.45 4 4V20C4 20.55 4.196 21.021 4.588 21.413ZM13 4V9H18V20H6V4H13ZM13 11H11L11 15.175L9.4 13.575L8 15L12 19L16 15L14.575 13.6L13 15.175L13 11Z"
/>
</SvgIcon>
);
2 changes: 1 addition & 1 deletion src/ui/menus/CommandPalette/CommandPalette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const CommandPalette = (props: Props) => {
/>

<Divider />
<div style={{ maxHeight: '330px', overflow: 'scroll' }}>
<div style={{ maxHeight: '330px', overflowY: 'scroll', paddingBottom: '5px' }}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on being more explicit about overflow direction here 👍

<List dense={true} disablePadding>
{ListItems.length ? (
ListItems
Expand Down
3 changes: 3 additions & 0 deletions src/ui/menus/CommandPalette/ListItems/Edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { KeyboardSymbols } from '../../../../helpers/keyboardSymbols';
import { ContentCopy, ContentPaste, ContentCut, East } from '@mui/icons-material';
import { useRecoilState } from 'recoil';
import { editorInteractionStateAtom } from '../../../../atoms/editorInteractionStateAtom';
import { Undo, Redo } from '@mui/icons-material';

const ListItems = [
{
Expand All @@ -13,6 +14,7 @@ const ListItems = [
return (
<CommandPaletteListItem
{...props}
icon={<Undo />}
action={() => {
props.sheetController.undo();
}}
Expand All @@ -28,6 +30,7 @@ const ListItems = [
return (
<CommandPaletteListItem
{...props}
icon={<Redo />}
action={() => {
props.sheetController.redo();
}}
Expand Down
5 changes: 5 additions & 0 deletions src/ui/menus/CommandPalette/ListItems/File.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import { CommandPaletteListItemSharedProps } from '../CommandPaletteListItem';
import { CommandPaletteListItem } from '../CommandPaletteListItem';
import { newGridFile, openGridFile } from '../../../../grid/actions/gridFile/OpenGridFile';
import { SaveGridFile } from '../../../../grid/actions/gridFile/SaveGridFile';
import { NoteAddOutlined, UploadFileOutlined } from '@mui/icons-material';
import { SaveFileOutlined } from '../../../icons';

const ListItems = [
{
label: 'File: New',
Component: (props: CommandPaletteListItemSharedProps) => (
<CommandPaletteListItem
{...props}
icon={<NoteAddOutlined />}
action={() => {
newGridFile('Untitled.grid', props.sheetController);
}}
Expand All @@ -20,6 +23,7 @@ const ListItems = [
Component: (props: CommandPaletteListItemSharedProps) => (
<CommandPaletteListItem
{...props}
icon={<SaveFileOutlined />}
action={() => {
SaveGridFile(props.sheetController.sheet, true);
}}
Expand All @@ -31,6 +35,7 @@ const ListItems = [
Component: (props: CommandPaletteListItemSharedProps) => (
<CommandPaletteListItem
{...props}
icon={<UploadFileOutlined />}
action={() => {
openGridFile(props.sheetController);
}}
Expand Down