Skip to content

Commit

Permalink
Add icon to plain text button
Browse files Browse the repository at this point in the history
  • Loading branch information
lpsinger committed Feb 22, 2024
1 parent 1d7bb05 commit 38c3dfa
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions app/routes/_gcn.circulars.edit.$circularId/RichEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { onKeyDown } from './onKeyDown'
import styles from './index.module.css'
import iconBold from '@gitlab/svgs/dist/sprite_icons/bold.svg'
import iconCode from '@gitlab/svgs/dist/sprite_icons/code.svg'
import iconText from '@gitlab/svgs/dist/sprite_icons/doc-text.svg'
import iconEllipsis from '@gitlab/svgs/dist/sprite_icons/ellipsis_h.svg'
import iconHeading from '@gitlab/svgs/dist/sprite_icons/heading.svg'
import iconItalic from '@gitlab/svgs/dist/sprite_icons/italic.svg'
Expand Down Expand Up @@ -58,7 +59,8 @@ function PlainTextButton({
>) {
return (
<SlimButton outline={!checked} type="button" {...props}>
Plain Text
<GitLabIcon src={iconText} className="width-2 height-2" />
<span className="display-none tablet-lg:display-inline"> Plain Text</span>
</SlimButton>
)
}
Expand Down Expand Up @@ -371,19 +373,13 @@ export function RichEditor({
name="format"
value={markdown ? 'text/markdown' : 'text/plain'}
/>
<ButtonGroup
type="segmented"
className="display-none desktop:display-flex"
>
<ButtonGroup type="segmented">
<PlainTextButton
{...toggleMarkdownButtonProps}
checked={!markdown}
/>
<MarkdownButton {...toggleMarkdownButtonProps} checked={markdown} />
</ButtonGroup>
<ButtonGroup className="display-inline-block desktop:display-none">
<MarkdownButton {...toggleMarkdownButtonProps} checked={markdown} />
</ButtonGroup>
</Grid>
{editing && (
<Grid
Expand Down

0 comments on commit 38c3dfa

Please sign in to comment.