Skip to content

Commit

Permalink
Merge pull request #239 from git-baboo/feature/238_shift_from_margin_…
Browse files Browse the repository at this point in the history
…to_spacer_in_comment_list_item

CommentListItem 内のマージン周りのリファクタリング
  • Loading branch information
watagit authored Feb 13, 2022
2 parents 0370e39 + 65da1ff commit da2316e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/components/review/CommentListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Avatar } from "@chakra-ui/avatar";
import { Grid, GridItem, ListItem, Text } from "@chakra-ui/layout";
import { Grid, GridItem, Text, Box } from "@chakra-ui/layout";
import ChakraUIRenderer from "chakra-ui-markdown-renderer";
import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";
Expand All @@ -14,7 +14,7 @@ type Props = {

const CommentListItem = ({ author, avatarUrl, body }: Props) => {
return (
<ListItem m={2} p={4} border="1px" borderRadius="md" borderColor="gray.300">
<Box p={4} border="1px" borderRadius="md" borderColor="gray.300">
<Grid templateColumns="auto 1fr" gap={2} alignItems="center">
<GridItem>
<Avatar size="sm" name={author} src={avatarUrl} />
Expand All @@ -32,7 +32,7 @@ const CommentListItem = ({ author, avatarUrl, body }: Props) => {
</ReactMarkdown>
</GridItem>
</Grid>
</ListItem>
</Box>
);
};

Expand Down
10 changes: 5 additions & 5 deletions src/components/review/Widget.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Button, Flex, List, Spacer, Textarea } from "@chakra-ui/react";
import { Button, Flex, Spacer, Textarea, Stack } from "@chakra-ui/react";
import React, { ChangeEvent, useCallback } from "react";

import CommentListItem from "@/components/review/CommentListItem";
Expand Down Expand Up @@ -39,9 +39,9 @@ const Widget = ({
}, [onSubmit, changeKey]);

return (
<Box m={4}>
<Stack direction="column" m={4}>
{comments && (
<List>
<>
{comments.map((comment, index) => {
return (
<CommentListItem
Expand All @@ -52,7 +52,7 @@ const Widget = ({
/>
);
})}
</List>
</>
)}
{isWriting && (
<>
Expand All @@ -65,7 +65,7 @@ const Widget = ({
</Flex>
</>
)}
</Box>
</Stack>
);
};

Expand Down

0 comments on commit da2316e

Please sign in to comment.