Skip to content

Commit d352da1

Browse files
authored
ui(ings-list): add spacing for comments (#93)
1 parent ee20484 commit d352da1

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

ui/ing/IngItem.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ class IngItem extends Component<IngItemProps, IngItemState> {
6868
key={id}
6969
activityPersonas={persons.map<IPersonaProps>(imageUrl => ({ imageUrl }))}
7070
comments={[
71-
content,
71+
// eslint-disable-next-line @typescript-eslint/naming-convention
72+
<div dangerouslySetInnerHTML={{ __html: content }}></div>,
7273
icons ? (
7374
<span /* eslint-disable-next-line @typescript-eslint/naming-convention */
7475
dangerouslySetInnerHTML={{ __html: icons }}
@@ -93,10 +94,12 @@ class IngItem extends Component<IngItemProps, IngItemState> {
9394
</Link>,
9495
]}
9596
timeStamp={[
96-
formatDistanceStrict(dateAdded, new Date(), {
97-
locale: zhCN,
98-
addSuffix: true,
99-
}),
97+
<span title={format(dateAdded, 'yyyy-MM-dd HH:mm')}>
98+
{formatDistanceStrict(dateAdded, new Date(), {
99+
locale: zhCN,
100+
addSuffix: true,
101+
})}
102+
</span>,
100103
sendFrom > 0 ? (
101104
<span className="ml-[3px] inline-flex items-center">
102105
{this.renderSendFromIcon(sendFrom)}
@@ -111,6 +114,7 @@ class IngItem extends Component<IngItemProps, IngItemState> {
111114
lineHeight: 16,
112115
display: 'flex',
113116
alignItems: 'center',
117+
fontSize: 'inherit',
114118
},
115119
activityText: {
116120
color: 'inherit',
@@ -138,10 +142,13 @@ class IngItem extends Component<IngItemProps, IngItemState> {
138142
);
139143
}
140144

141-
private renderComment = ({ userDisplayName, content, dateAdded, statusId, userId, id }: IngComment) => (
142-
<div>
145+
private renderComment = (
146+
{ userDisplayName, content, dateAdded, statusId, userId, id }: IngComment,
147+
index: number
148+
) => (
149+
<div className={`${index > 0 ? 'mt-[3px]' : ''} leading-[1.5]`}>
143150
<div className="inline">
144-
<span className="whitespace-nowrap ">
151+
<span className="whitespace-nowrap">
145152
<Link>{userDisplayName}</Link>&nbsp;:&nbsp;
146153
</span>
147154
{/* eslint-disable-next-line @typescript-eslint/naming-convention */}

0 commit comments

Comments
 (0)