Skip to content

Commit 192ddfa

Browse files
authored
Fix code (codesandbox#3792)
* overflow pre * make code 13pc * use existing action
1 parent 86c5067 commit 192ddfa

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

packages/app/src/app/pages/Sandbox/Editor/Workspace/screens/Comments/Dialog/Code.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ export const Code = withTheme(({ value, language, theme }) => (
2424
className={className}
2525
style={style}
2626
css={css({
27+
fontSize: 3,
2728
whiteSpace: 'pre-wrap',
29+
maxHeight: 400,
30+
overflow: 'scroll',
31+
32+
'*': {
33+
wordBreak: 'break-all',
34+
},
2835
})}
2936
>
3037
{tokens.map((line, i) => (

packages/app/src/app/pages/Sandbox/Editor/Workspace/screens/Comments/Dialog/Reply.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ export const Reply = ({ reply }: ReplyProps) => {
2828
<Menu.IconButton name="more" title="Reply actions" size={12} />
2929
<Menu.List>
3030
<Menu.Item
31-
onSelect={() =>
31+
onSelect={() => {
3232
actions.comments.deleteComment({
3333
commentId: id,
34-
})
35-
}
34+
});
35+
}}
3636
>
3737
Delete
3838
</Menu.Item>

packages/app/src/app/pages/Sandbox/Editor/Workspace/screens/Comments/Dialog/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,12 @@ const CommentBody = ({ comment, editing, setEditing }) => {
302302
Edit Comment
303303
</Menu.Item>
304304
<Menu.Item
305-
onSelect={() =>
305+
onSelect={() => {
306+
actions.comments.closeComment();
306307
actions.comments.deleteComment({
307308
commentId: comment.id,
308-
})
309-
}
309+
});
310+
}}
310311
>
311312
Delete
312313
</Menu.Item>

packages/app/src/app/pages/Sandbox/Editor/Workspace/screens/Comments/components/AvatarBlock.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Avatar, Link, Stack, Text } from '@codesandbox/components';
1+
import { Avatar, Stack, Text } from '@codesandbox/components';
22
import { CommentFragment } from 'app/graphql/types';
33
import { formatDistance } from 'date-fns';
44
import { zonedTimeToUtc } from 'date-fns-tz';
@@ -10,14 +10,9 @@ export const AvatarBlock: React.FC<{ comment: CommentFragment }> = ({
1010
<Stack gap={2} align="center">
1111
<Avatar user={comment.user} />
1212
<Stack direction="vertical" justify="center" gap={1}>
13-
<Link
14-
size={3}
15-
weight="bold"
16-
href={`/u/${comment.user.username}`}
17-
variant="body"
18-
>
13+
<Text size={3} weight="bold" variant="body">
1914
{comment.user.username}
20-
</Link>
15+
</Text>
2116
<Text size={2} variant="muted">
2217
{formatDistance(
2318
zonedTimeToUtc(comment.insertedAt, 'Etc/UTC'),

0 commit comments

Comments
 (0)