Skip to content

Commit

Permalink
[FE/#74] Refactor : statusChip render함수 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
Elllin committed Jun 24, 2020
1 parent 9d1adf9 commit 1f3c5aa
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions FE/src/components/DetailedIssue/Header/IssueStatus/IssueStatus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,21 @@ const IssueStatus = () => {

const statusMessage = `opened this issue ${time} ago · ${countOfComment} comment`;

const statusChipRender = () => {
return isOpened ? (
<Chip color="primary" label={OPEN_TEXT} icon={<StatusIcon color={{ opened: "white" }} />} />
) : (
<Chip
color="secondary"
label={CLOSE_TEXT}
icon={<StatusIcon color={{ closed: "white" }} closed />}
/>
);
};

return (
<Box display="flex" alignItems="center" mt={1}>
{isOpened ? (
<Chip color="primary" label={OPEN_TEXT} icon={<StatusIcon color="white" />} />
) : (
<Chip color="secondary" label={CLOSE_TEXT} icon={<StatusIcon color="white" closed />} />
)}
{statusChipRender()}
<Typography color="textSecondary" variant="subtitle1" component="div">
<strong className={classes.userName}>{userName}</strong>
{statusMessage}
Expand Down

0 comments on commit 1f3c5aa

Please sign in to comment.