Skip to content

Commit 85a82ad

Browse files
committed
Design: Add final version of metadata
1 parent 778999e commit 85a82ad

2 files changed

Lines changed: 39 additions & 20 deletions

File tree

frontend/components/pages/ItemPage/ItemPage.js

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
mdiShare,
1010
mdiStar,
1111
mdiStarOutline,
12-
mdiUpload
12+
mdiUpload,
1313
} from "@mdi/js";
1414
import Icon from "@mdi/react";
1515
import {
@@ -18,20 +18,22 @@ import {
1818
Divider,
1919
IconButton,
2020
ListItemIcon,
21-
Skeleton,
2221
Menu,
2322
MenuItem,
23+
Skeleton,
2424
Stack,
25-
Tooltip
25+
Tooltip,
2626
} from "@mui/material";
2727
import { push } from "connected-react-router";
2828
import R from "ramda";
2929
import React, { useEffect, useState } from "react";
3030
import { store as RNC } from "react-notifications-component";
3131
import { useDispatch, useSelector } from "react-redux";
3232
import { useParams } from "react-router";
33+
import { Link } from "react-router-dom";
3334
import LinkComponent from "_atoms/LinkComponent";
3435
import TypeIcon from "_atoms/TypeIcon";
36+
import { dateElapsed, dateToString } from "_frontend/utils/date";
3537
import BreadCrumbs from "_molecules/BreadCrumbs";
3638
import Editor from "_molecules/Editor";
3739
import Comment from "_organisms/Comment";
@@ -40,12 +42,12 @@ import {
4042
attemptDeleteItem,
4143
attemptGetItem,
4244
attemptGetItemChildren,
43-
attemptPublishItem
45+
attemptPublishItem,
4446
} from "_thunks/item";
4547
import {
4648
attemptAddBookmark,
4749
attemptGetUser,
48-
attemptRemoveBookmark
50+
attemptRemoveBookmark,
4951
} from "_thunks/user";
5052
import { deepEqual } from "_utils/compare";
5153

@@ -331,7 +333,9 @@ export default function ItemPage() {
331333
<TypeIcon type={item.type} size={1.5} opacity={0.7} />
332334
</Badge>
333335
</Tooltip>
336+
{/* Item title */}
334337
<div className="item-title">{item.title}</div>
338+
{/* Item action menus */}
335339
<Stack direction="row">
336340
<Tooltip title="북마크에 추가" arrow>
337341
<IconButton onClick={toggleBookmark}>
@@ -346,26 +350,35 @@ export default function ItemPage() {
346350
</IconButton>
347351
</Stack>
348352
</div>
349-
{itemParents != null ? (
350-
<BreadCrumbs itemArray={[...itemParents, item]} />
351-
) : (
352-
<BreadCrumbs hierarchyLevel={hierarchyLevel[item.type]} />
353-
)}
354353
</Stack>
354+
{/* Item BreadCrumbs */}
355+
{itemParents != null ? (
356+
<BreadCrumbs itemArray={[...itemParents, item]} />
357+
) : (
358+
<BreadCrumbs hierarchyLevel={hierarchyLevel[item.type]} />
359+
)}
360+
{/* Item owner profile */}
355361
{itemOwner != null ? (
356362
<Stack className="item-profile">
357363
<img
358364
className="item-profile-image"
359365
src={itemOwner.profileImageUrl || "/images/default-profile.png"}
360366
/>
361367
<div className="item-profile-name">
362-
{itemOwner.rank} {itemOwner.name}
368+
<Link to={`/user/${itemOwner._id}`}>
369+
{itemOwner.rank} {itemOwner.name}
370+
</Link>
371+
{"님이"}
372+
<Tooltip title={dateToString(item.created)} arrow>
373+
<div>{dateElapsed(item.created)}</div>
374+
</Tooltip>
375+
{"작성함"}
363376
</div>
364377
</Stack>
365378
) : (
366379
<Stack className="item-profile">
367-
<Skeleton className="item-profile-image"/>
368-
<Skeleton className="item-profile-name" />
380+
<Skeleton variant="circular" width={24} height={24} />
381+
<Skeleton width={200} height="1em" />
369382
</Stack>
370383
)}
371384
{item.content && <Editor content={item.content} editable={false} />}

frontend/styles/item-page.scss

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,30 @@
3838
.item-profile {
3939
align-items: center;
4040
flex-direction: row;
41+
gap: 12px;
42+
padding-top: 8px;
4143

4244
.item-profile-image {
4345
width: 24px;
4446
height: 24px;
45-
margin-right: 12px;
4647
border-radius: 50%;
47-
border: 1px solid #0005;
48+
border: 1px solid #0003;
4849
}
4950

5051
.item-profile-name {
51-
font-size: 1.15em;
52-
font-weight: bold;
52+
display: flex;
53+
gap: 4px;
54+
flex-direction: row;
55+
font-size: 1em;
5356
text-align: start;
5457
padding-top: 3px;
55-
}
58+
color: $black-b70;
5659

57-
.item-profile-name-loading {
58-
width: 100px;
60+
a {
61+
color: $black-b70;
62+
text-decoration: none;
63+
font-weight: bold;
64+
}
5965
}
6066
}
6167
}

0 commit comments

Comments
 (0)