Skip to content

Commit

Permalink
Hide toolbar in preview mode
Browse files Browse the repository at this point in the history
  • Loading branch information
laymonage committed Nov 23, 2021
1 parent 0a4b703 commit 230bc72
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions components/CommentBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,22 @@ export default function CommentBox({
</button>
</div>

<div className="gsc-comment-box-md-toolbar">
<button
className="gsc-toolbar-item"
type="button"
title={isFixedWidth ? t('disableFixedWidth') : t('enableFixedWidth')}
onClick={() => {
setIsFixedWidth(!isFixedWidth);
textarea.current.focus();
}}
tabIndex={-1}
>
<TypographyIcon />
</button>
</div>
{!isPreview ? (
<div className="gsc-comment-box-md-toolbar">
<button
className="gsc-toolbar-item"
type="button"
title={isFixedWidth ? t('disableFixedWidth') : t('enableFixedWidth')}
onClick={() => {
setIsFixedWidth(!isFixedWidth);
textarea.current.focus();
}}
tabIndex={-1}
>
<TypographyIcon />
</button>
</div>
) : null}
</div>
<div className="gsc-comment-box-main">
{isPreview ? (
Expand Down

0 comments on commit 230bc72

Please sign in to comment.