Skip to content

Commit

Permalink
fix: update icons
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Jan 15, 2024
1 parent c194d5c commit 3255228
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 34 deletions.
16 changes: 12 additions & 4 deletions src/modules/common/CommentActions.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { useTranslation } from 'react-i18next';

import { Delete, Edit } from '@mui/icons-material';
import { ListItemIcon, ListItemText, Menu, MenuItem } from '@mui/material';
import {
ListItemIcon,
ListItemText,
Menu,
MenuItem,
useTheme,
} from '@mui/material';

import { Edit2, Trash2 } from 'lucide-react';

import { AppActionsType } from '@/config/appActions';
import { CommentAppData } from '@/config/appData';
Expand Down Expand Up @@ -30,6 +37,7 @@ const CommentActions = ({
// showFlag = true,
comment,
}: Props): JSX.Element => {
const theme = useTheme();
const { t } = useTranslation();
const { mutate: deleteAppData } = mutations.useDeleteAppData();
const { mutate: postAction } = mutations.usePostAppAction();
Expand Down Expand Up @@ -62,7 +70,7 @@ const CommentActions = ({
}}
>
<ListItemIcon>
<Edit color="primary" />
<Edit2 color={theme.palette.primary.main} />
</ListItemIcon>
<ListItemText>{t('EDIT_LABEL')}</ListItemText>
</MenuItem>
Expand All @@ -79,7 +87,7 @@ const CommentActions = ({
}}
>
<ListItemIcon>
<Delete color="error" />
<Trash2 color={theme.palette.error.main} />
</ListItemIcon>
<ListItemText>{t('DELETE_LABEL')}</ListItemText>
</MenuItem>
Expand Down
61 changes: 31 additions & 30 deletions src/modules/common/CommentEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ import {
useTextAreaMarkdownEditor,
} from 'react-mde';

import {
Code,
FormatBold,
FormatItalic,
FormatQuote,
InsertLink,
} from '@mui/icons-material';
import {
Box,
FormHelperText,
Expand All @@ -26,6 +19,15 @@ import {

import { Button } from '@graasp/ui';

import {
Bold,
Code2,
Italic,
Link as LinkIcon,
Quote,
SendHorizonal,
} from 'lucide-react';

import { CommentAppData } from '@/config/appData';
// import { DEFAULT_MAX_COMMENT_LENGTH_SETTING } from '@/config/appSetting';
import {
Expand Down Expand Up @@ -121,39 +123,39 @@ const CommentEditor = ({
await commandController.executeCommand('bold');
}}
>
<FormatBold fontSize="inherit" />
<Bold size={16} />
</ToolbarButton>
<ToolbarButton
dataCy={COMMENT_EDITOR_ITALIC_BUTTON_CYPRESS}
onClick={async () => {
await commandController.executeCommand('italic');
}}
>
<FormatItalic fontSize="inherit" />
<Italic size={16} />
</ToolbarButton>
<ToolbarButton
dataCy={COMMENT_EDITOR_CODE_BUTTON_CYPRESS}
onClick={async () => {
await commandController.executeCommand('code');
}}
>
<Code fontSize="inherit" />
<Code2 size={16} />
</ToolbarButton>
<ToolbarButton
dataCy={COMMENT_EDITOR_LINK_BUTTON_CYPRESS}
onClick={async () => {
await commandController.executeCommand('link');
}}
>
<InsertLink fontSize="inherit" />
<LinkIcon size={16} />
</ToolbarButton>
<ToolbarButton
dataCy={COMMENT_EDITOR_QUOTE_BUTTON_CYPRESS}
onClick={async () => {
await commandController.executeCommand('quote');
}}
>
<FormatQuote fontSize="inherit" />
<Quote size={16} />
</ToolbarButton>
</Stack>
<TextArea
Expand All @@ -174,24 +176,23 @@ const CommentEditor = ({
alignItems="center"
justifyContent="space-between"
>
<Stack direction="row" spacing={1} justifyContent="end">
<Button
dataCy={COMMENT_EDITOR_CANCEL_BUTTON_CYPRESS}
color="secondary"
variant="outlined"
onClick={() => onCancel()}
>
{t('CANCEL_LABEL')}
</Button>
<Button
dataCy={COMMENT_EDITOR_SAVE_BUTTON_CYPRESS}
color="primary"
variant="outlined"
onClick={() => onSend(text)}
>
{t('SEND_LABEL')}
</Button>
</Stack>
<Button
dataCy={COMMENT_EDITOR_CANCEL_BUTTON_CYPRESS}
color="secondary"
variant="outlined"
onClick={() => onCancel()}
>
{t('CANCEL_LABEL')}
</Button>
<Button
endIcon={<SendHorizonal />}
dataCy={COMMENT_EDITOR_SAVE_BUTTON_CYPRESS}
color="primary"
variant="outlined"
onClick={() => onSend(text)}
>
{t('SEND_LABEL')}
</Button>
</Stack>
</Stack>
</Box>
Expand Down

0 comments on commit 3255228

Please sign in to comment.