Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit da38a60

Browse files
committed
Merge branch 'highlight_show_code_button' into 'master'
Bot UI: highlighted show/hide code block string See merge request postgres-ai/database-lab!874
2 parents 672ff1f + 6de888c commit da38a60

File tree

1 file changed

+17
-2
lines changed
  • ui/packages/platform/src/pages/Bot/Messages/Message

1 file changed

+17
-2
lines changed

‎ui/packages/platform/src/pages/Bot/Messages/Message/CodeBlock.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import languages from 'react-syntax-highlighter/dist/esm/languages/prism/support
66
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
77
import FileCopyOutlinedIcon from '@material-ui/icons/FileCopyOutlined';
88
import CheckCircleOutlineIcon from '@material-ui/icons/CheckCircleOutline';
9+
import CodeIcon from '@material-ui/icons/Code';
910

1011
const useStyles = makeStyles((theme) => ({
1112
container: {
@@ -38,18 +39,27 @@ const useStyles = makeStyles((theme) => ({
3839
width: '0.813rem',
3940
},
4041
summary: {
42+
color: 'rgb(166, 38, 164)',
4143
textDecoration: 'underline',
4244
textDecorationStyle: 'dotted',
4345
cursor: 'pointer',
4446
backgroundColor: 'transparent',
4547
boxShadow: 'none',
4648
display: 'inline-flex',
47-
minHeight: '32px!important',
49+
minHeight: '2rem!important',
4850
padding: 0,
4951
'&:hover': {
5052
textDecoration: 'none'
5153
}
5254
},
55+
summaryText: {
56+
display: 'inline-flex',
57+
alignItems: 'center'
58+
},
59+
summaryTextIcon: {
60+
marginRight: 8,
61+
fontSize: '1rem'
62+
},
5363
details: {
5464
padding: 0,
5565
backgroundColor: 'transparent'
@@ -117,7 +127,12 @@ export const CodeBlock = memo(({ value, language }: CodeBlockProps) => {
117127
return (
118128
<Accordion expanded={expanded} onChange={handleToggle} className={classes.accordion}>
119129
<AccordionSummary expandIcon={<ExpandMoreIcon />} className={classes.summary}>
120-
<Typography>{expanded ? 'Hide' : 'Show'} code block ({codeLines.length} LOC)</Typography>
130+
<Typography
131+
className={classes.summaryText}
132+
>
133+
<CodeIcon className={classes.summaryTextIcon} />
134+
{expanded ? 'Hide' : 'Show'} code block ({codeLines.length} LOC)
135+
</Typography>
121136
</AccordionSummary>
122137
<AccordionDetails className={classes.details}>
123138
<div className={classes.container}>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /