Skip to content

Commit

Permalink
refactor: 코드 포매팅
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyoeunkh committed May 20, 2024
1 parent 3a3f076 commit 76c66e7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
20 changes: 11 additions & 9 deletions src/pages/BoothDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,17 @@ export default function BoothDetailPage() {

return (
<DetailPageWrapper>
{isPending ? <Loader /> : boothDetail && <BoothInfo boothDetail={boothDetail} /> }

{(boothDetail?.boothDescription!=null?boothDetail.boothDescription:'').split("<br/>").map((detail) => {
return (
<Paragraph size="m" weight="normal">
{detail}
</Paragraph>
);
})}
{isPending ? <Loader /> : boothDetail && <BoothInfo boothDetail={boothDetail} />}

{(boothDetail?.boothDescription != null ? boothDetail.boothDescription : "")
.split("<br/>")
.map((detail) => {
return (
<Paragraph size="m" weight="normal">
{detail}
</Paragraph>
);
})}

<CommentHeader>
<Text size="20px" weight="bold">
Expand Down
2 changes: 1 addition & 1 deletion src/services/booth/booth.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const useBoothDetail = () => {

useEffect(() => {
if (!visitorId) return;

setIsPending(true);
boothService
.readBoothById(category as string, parseInt(boothId as string), visitorId as string)
Expand Down
8 changes: 4 additions & 4 deletions src/utils/parseCreatedDate.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export const parseCreatedDate = (str: string) => {
// 2024-05-19T03:18:40.33581
console.log(str);
if(!str) return '';
const [date, time] = (str||'').split("T");
if (!str) return "";

const [date, time] = (str || "").split("T");
const [y, m, d] = date.split("-");
const t = time.split(".")[0];

return `${y}${m}${d}${t}`
return `${y}${m}${d}${t}`;
};

0 comments on commit 76c66e7

Please sign in to comment.