Skip to content

Commit b1ce359

Browse files
authored
Polish v1234 (codesandbox#3802)
* more polish * add constants * make style instead
1 parent e85fd2d commit b1ce359

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const AddComment: React.FC = () => {
4343
onKeyDown={submitOnEnter}
4444
placeholder="Write a comment"
4545
css={css({ minHeight: 8 })}
46+
style={{ lineHeight: 1.2 }}
4647
/>
4748
</FormField>
4849
</form>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,9 @@ const Replies = ({ replies, repliesRenderedCallback }) => {
394394
>
395395
{repliesLoaded ? (
396396
<>
397-
{replies.map(reply => (
398-
<Reply reply={reply} key={reply.id} />
399-
))}
397+
{replies.map(
398+
reply => reply && <Reply reply={reply} key={reply.id} />
399+
)}
400400
</>
401401
) : (
402402
<SkeletonReply />

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ export const MultiComment = ({ x, y, ids }: MultiCommentProps) => {
1818
actions,
1919
} = useOvermind();
2020

21+
const CARROT_LEFT_MARGIN = 25;
22+
const BORDER_WIDTH = 10;
23+
2124
const list = css({
2225
position: 'fixed',
23-
left: x - 10,
26+
left: x - CARROT_LEFT_MARGIN,
2427
top: y + 20,
2528
backgroundColor: 'sideBar.background',
2629
border: '1px solid',
@@ -35,30 +38,30 @@ export const MultiComment = ({ x, y, ids }: MultiCommentProps) => {
3538
content: "''",
3639
display: 'block',
3740
position: 'absolute',
38-
left: '7px',
41+
left: CARROT_LEFT_MARGIN - 1,
3942
width: 0,
4043
height: 0,
4144
borderStyle: 'solid',
42-
top: '-11px',
45+
top: `-${BORDER_WIDTH + 1}px`,
4346
borderColor: 'transparent',
4447
borderBottomColor: 'sideBar.border',
4548

46-
borderWidth: '11px',
49+
borderWidth: `${BORDER_WIDTH + 1}px`,
4750
borderTopWidth: 0,
4851
},
4952

5053
'&::after': {
5154
content: "''",
5255
display: 'block',
5356
position: 'absolute',
54-
left: 2,
57+
left: CARROT_LEFT_MARGIN,
5558
width: 0,
5659
height: 0,
5760
borderStyle: 'solid',
58-
top: '-10px',
61+
top: `-${BORDER_WIDTH}px`,
5962
borderColor: 'transparent',
6063
borderBottomColor: 'sideBar.background',
61-
borderWidth: '10px',
64+
borderWidth: `${BORDER_WIDTH}px`,
6265
borderTopWidth: 0,
6366
},
6467
});

0 commit comments

Comments
 (0)