-
-
Notifications
You must be signed in to change notification settings - Fork 781
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Innei <[email protected]>
- Loading branch information
Showing
4 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import dayjs from 'dayjs' | ||
|
||
import { Banner } from '~/components/ui/banner' | ||
import { RelativeTime } from '~/components/ui/relative-time' | ||
import { useCurrentPostDataSelector } from '~/providers/post/CurrentPostDataProvider' | ||
|
||
export const PostOutdate = () => { | ||
const time = useCurrentPostDataSelector((s) => s?.modified) | ||
if (!time) { | ||
return null | ||
} | ||
return dayjs().diff(dayjs(time), 'day') > 60 ? ( | ||
<Banner type="warning" className="mb-10"> | ||
<span className="leading-[1.8]"> | ||
这篇文章上次修改于 <RelativeTime date={time} /> | ||
,可能部分内容已经不适用,如有疑问可询问作者。 | ||
</span> | ||
</Banner> | ||
) : null | ||
} |
50a7735
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
springtide – ./
springtide-git-main-innei.vercel.app
springtide.vercel.app
springtide-innei.vercel.app
innei.in