Skip to content

Commit

Permalink
feat: modified info
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Jun 23, 2023
1 parent b4f9f98 commit 2393a99
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nextjs_bundle_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ defaults:
working-directory: ./

env:
VERCEL_ORG_ID: innei
VERCEL_PROJECT_ID: springtide
VERCEL_ORG_ID: wqUeSmfmBfQzj0I1OehLu2H9
VERCEL_PROJECT_ID: prj_IUZGepAtVeh4GrzmFtp0BceSTCvX

jobs:
analyze:
Expand Down
1 change: 1 addition & 0 deletions src/app/posts/(post-detail)/[category]/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const PostMetaBarInternal: Component = ({ className }) => {
category: data.category,
tags: data.tags,
count: data.count,
modified: data.modified,
}
})
if (!meta) return null
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/header/internal/UserAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function UserAuth() {
<SignedOut key="sign-in">
<FloatPopover
TriggerComponent={TriggerComponent}
wrapperClassNames="h-full w-full flex items-center justify-center"
wrapperClassName="h-full w-full flex items-center justify-center"
type="tooltip"
>
登陆
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/float-popover/FloatPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const FloatPopover: FC<
PropsWithChildren<{
TriggerComponent: FC
headless?: boolean
wrapperClassNames?: string
wrapperClassName?: string
trigger?: 'click' | 'hover' | 'both'
padding?: number
offset?: number
Expand All @@ -40,7 +40,7 @@ export const FloatPopover: FC<
> = (props) => {
const {
headless = false,
wrapperClassNames,
wrapperClassName: wrapperClassNames,
TriggerComponent,
trigger = 'hover',
padding,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/markdown/renderers/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const MLink: FC<{
return (
<FloatPopover
as="span"
wrapperClassNames="!inline"
wrapperClassName="!inline"
TriggerComponent={useCallback(
() => (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/note/NoteTopicInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const NoteTopicInfo = () => {
<FloatPopover
placement="right"
strategy="fixed"
wrapperClassNames="flex flex-grow flex-shrink min-w-0"
wrapperClassName="flex flex-grow flex-shrink min-w-0"
TriggerComponent={ToTopicLink}
>
<NoteTopicDetail topic={topic} />
Expand Down
14 changes: 12 additions & 2 deletions src/components/widgets/post/PostMetaBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ import type { PostModel } from '@mx-space/api-client'

import { MdiClockOutline } from '~/components/icons/clock'
import { FeHash } from '~/components/icons/fa-hash'
import { FloatPopover } from '~/components/ui/float-popover'
import { RelativeTime } from '~/components/ui/relative-time'
import { clsxm } from '~/utils/helper'

export const PostMetaBar: Component<{
meta: Pick<PostModel, 'created' | 'category' | 'tags' | 'count'>
meta: Pick<PostModel, 'created' | 'modified' | 'category' | 'tags' | 'count'>
}> = ({ className, meta }) => {
return (
<div
className={clsxm(
'flex min-w-0 flex-shrink flex-grow space-x-2 text-sm',
'flex min-w-0 flex-shrink flex-grow flex-wrap space-x-2 text-sm',
className,
)}
>
Expand All @@ -20,6 +21,15 @@ export const PostMetaBar: Component<{
<span>
<RelativeTime date={meta.created} />
</span>
{meta.modified && (
<FloatPopover
wrapperClassName="text-xs self-end"
as="span"
TriggerComponent={() => '(已编辑)'}
>
编辑于 <RelativeTime date={meta.modified} />
</FloatPopover>
)}
</div>

<div className="flex min-w-0 items-center space-x-1">
Expand Down
5 changes: 1 addition & 4 deletions src/components/widgets/toc/Toc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,7 @@ const TocTree: Component<
}, [accessory])
return (
<ul
className={clsxm(
'overflow-y-auto px-2 font-medium scrollbar-none',
className,
)}
className={clsxm('overflow-y-auto px-2 scrollbar-none', className)}
key={`${toc.map((i) => i.title).join('')}`}
ref={containerRef}
>
Expand Down

1 comment on commit 2393a99

@vercel
Copy link

@vercel vercel bot commented on 2393a99 Jun 23, 2023

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-innei.vercel.app
springtide-git-main-innei.vercel.app
innei.in
springtide.vercel.app

Please sign in to comment.