Skip to content

Commit

Permalink
chore: run format
Browse files Browse the repository at this point in the history
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
  • Loading branch information
Harry-Chen committed Mar 29, 2024
1 parent 8e8025a commit 6b9636c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 27 deletions.
46 changes: 25 additions & 21 deletions src/components/ContentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ const ContentCard = ({ type, id }: ContentCardProps) => {
? diffDays > 99
? '99+'
: diffDays < 0
? _(COURSE_MAIN_FUNC[content.type].name)
: diffDays.toString()
? _(COURSE_MAIN_FUNC[content.type].name)
: diffDays.toString()
: _(COURSE_MAIN_FUNC[content.type].name)}
</div>
}
Expand All @@ -103,14 +103,14 @@ const ContentCard = ({ type, id }: ContentCardProps) => {
diffDays < 0
? 'due'
: content.submitted
? 'submitted'
: diffDays >= 10
? 'far'
: diffDays >= 5
? 'near'
: diffDays >= 3
? 'close'
: 'urgent'
? 'submitted'
: diffDays >= 10
? 'far'
: diffDays >= 5
? 'near'
: diffDays >= 3
? 'close'
: 'urgent'
}`
: `chip_${content.type}`
],
Expand All @@ -136,17 +136,21 @@ const ContentCard = ({ type, id }: ContentCardProps) => {
: t`无评分`) + t`(${content.graderName ?? ''})`
: t`未批阅`)
: content.type === ContentType.NOTIFICATION || content.type === ContentType.FILE
? (content.markedImportant ? ' · ' + t`重要` : '') +
(content.type === ContentType.NOTIFICATION
? ' · ' + t`发布者:${content.publisher}`
: ' · ' +
content.size +
(content.description.trim() !== '' ? ' · ' + content.description.trim() : ''))
: content.type === ContentType.DISCUSSION || content.type === ContentType.QUESTION
? ' · ' +
t`回复:${content.replyCount}` +
(content.replyCount !== 0 ? ' · ' + t`最后回复:${content.lastReplierName}` : '')
: null}
? (content.markedImportant ? ' · ' + t`重要` : '') +
(content.type === ContentType.NOTIFICATION
? ' · ' + t`发布者:${content.publisher}`
: ' · ' +
content.size +
(content.description.trim() !== ''
? ' · ' + content.description.trim()
: ''))
: content.type === ContentType.DISCUSSION || content.type === ContentType.QUESTION
? ' · ' +
t`回复:${content.replyCount}` +
(content.replyCount !== 0
? ' · ' + t`最后回复:${content.lastReplierName}`
: '')
: null}
</span>
<span className={styles.card_course}>{_({ id: `course-${content.courseId}` })}</span>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/components/ContentDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ const ContentDetail = ({ content }: ContentDetailProps) => {
(content.type === ContentType.HOMEWORK
? content.description
: content.type === ContentType.FILE
? content.description
: content.type === ContentType.NOTIFICATION
? content.content
: undefined
? content.description
: content.type === ContentType.NOTIFICATION
? content.content
: undefined
)?.trim() || t`详情为空`;

const fileToPreview: RemoteFile | undefined =
Expand Down
4 changes: 2 additions & 2 deletions src/redux/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ export const refreshCardList = (): AppThunk<void> => (dispatch, getState) => {
type === 'ignored'
? c.ignored
: courseId
? c.courseId === courseId
: !contentIgnore[c.courseId]?.[c.type] && !c.ignored,
? c.courseId === courseId
: !contentIgnore[c.courseId]?.[c.type] && !c.ignored,
)
.sort((a, b) => {
const aNotDue =
Expand Down

0 comments on commit 6b9636c

Please sign in to comment.