Skip to content

Commit fcc07ec

Browse files
committed
fix: some ui
1 parent 95bde28 commit fcc07ec

File tree

12 files changed

+70
-24
lines changed

12 files changed

+70
-24
lines changed

src/app/notes/[id]/page.module.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
.paragraph .indent {
99
border-bottom: 1px solid;
1010

11-
@apply border-accent/20 dark:border-accent/30;
11+
/* @apply border-accent/20 dark:border-accent/20; */
12+
@apply border-accent/10;
1213
}
1314

1415
blockquote {

src/components/layout/header/internal/SiteOwnerAvatar.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ export const SiteOwnerAvatar: Component = ({ className }) => {
5353
width={40}
5454
height={40}
5555
className={clsxm(
56-
'rounded-md ring-2 ring-slate-200 dark:ring-neutral-800',
57-
isLiving ? 'rounded-full' : '',
56+
'ring-2 ring-slate-200 dark:ring-neutral-800',
57+
isLiving ? 'rounded-full' : 'mask mask-squircle',
5858
)}
5959
/>
6060
{isLiving && (

src/components/ui/image/ZoomedImage.module.css

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
}
55

66
.loaded {
7-
animation: zoomIn 500ms ease-in-out forwards;
7+
animation: imageLoad 500ms ease-in-out forwards;
88
}
99

10-
@keyframes zoomIn {
10+
@keyframes imageLoad {
1111
0% {
12-
opacity: 0;
13-
clip-path: inset(5%);
14-
transform: scale(111.11%);
12+
mask: linear-gradient(90deg, #000 25%, #000000e6 50%, #00000000) 150% 0 /
13+
400% no-repeat;
14+
opacity: 0.2;
1515
}
1616
100% {
17+
mask: linear-gradient(90deg, #000 25%, #000000e6 50%, #00000000) 0 / 400%
18+
no-repeat;
1719
opacity: 1;
18-
clip-path: inset(0);
19-
transform: scale(1);
2020
}
2121
}

src/components/ui/markdown/Markdown.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ import { KateXRule } from './parsers/katex'
2424
import { MarkRule } from './parsers/mark'
2525
import { MentionRule } from './parsers/mention'
2626
import { SpoilderRule } from './parsers/spoiler'
27-
import { MParagraph, MTableBody, MTableHead, MTableRow } from './renderers'
27+
import {
28+
MParagraph,
29+
MTable,
30+
MTableBody,
31+
MTableHead,
32+
MTableRow,
33+
} from './renderers'
2834
import { MDetails } from './renderers/collapse'
2935
import { MFootNote } from './renderers/footnotes'
3036
import { MHeader } from './renderers/heading'
@@ -79,6 +85,7 @@ export const Markdown: FC<MdProps & MarkdownToJSX.Options & PropsWithChildren> =
7985
thead: MTableHead,
8086
tr: MTableRow,
8187
tbody: MTableBody,
88+
table: MTable,
8289
// FIXME: footer tag in raw html will renders not as expected, but footer tag in this markdown lib will wrapper as linkReferer footnotes
8390
footer: MFootNote,
8491
details: MDetails,

src/components/ui/markdown/renderers/LinkRenderer.tsx

+11-7
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,17 @@ const FixedRatioContainer = ({
148148
children: React.ReactNode
149149
}) => {
150150
return (
151-
<div
152-
className="relative my-8 h-0 w-full"
153-
style={{
154-
paddingBottom: `${ratio}%`,
155-
}}
156-
>
157-
{children}
151+
<div className="mockup-window my-16 bg-base-300">
152+
<div className="flex justify-center px-4">
153+
<div
154+
className="relative my-8 h-0 w-full"
155+
style={{
156+
paddingBottom: `${ratio}%`,
157+
}}
158+
>
159+
{children}
160+
</div>
161+
</div>
158162
</div>
159163
)
160164
}

src/components/ui/markdown/renderers/table.tsx

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
import React from 'react'
2-
import clsx from 'clsx'
32
import type { FC } from 'react'
43

4+
import { clsxm } from '~/lib/helper'
5+
6+
export const MTable: FC<JSX.IntrinsicElements['table']> = (props) => {
7+
const { className, ...rest } = props
8+
return (
9+
<table
10+
{...rest}
11+
className={clsxm('table table-zebra table-pin-rows', className)}
12+
/>
13+
)
14+
}
15+
516
export const MTableHead: FC<JSX.IntrinsicElements['thead']> = (props) => {
617
const { children, className, ...rest } = props
718
return (
8-
<thead className={clsx(className, 'bg-base-content/20')} {...rest}>
19+
<thead className={className} {...rest}>
920
{children}
1021
</thead>
1122
)

src/components/widgets/comment/CommentBox/SwitchCommentMode.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { FC } from 'react'
66

77
import { useUser } from '@clerk/nextjs'
88

9+
import { useIsLogged } from '~/atoms'
910
import { MotionButtonBase } from '~/components/ui/button'
1011
import { FloatPopover } from '~/components/ui/float-popover'
1112

@@ -39,6 +40,9 @@ export const SwitchCommentMode = () => {
3940
</>
4041
)
4142
}).current
43+
44+
const isOwnerLogged = useIsLogged()
45+
if (isOwnerLogged) return null
4246
return (
4347
<MotionButtonBase
4448
className={clsx(

src/styles/theme.css

+9-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
}
9595

9696
.animation-blink {
97-
animation: blink 2s ease infinite both;
97+
animation: blink 1.2s linear infinite;
9898
}
9999

100100
.mask-top {
@@ -107,12 +107,18 @@
107107
0% {
108108
opacity: 0;
109109
}
110-
50% {
110+
40% {
111+
opacity: 0;
112+
}
113+
40.1% {
111114
opacity: 1;
112115
}
113-
100% {
116+
99.9% {
114117
opacity: 1;
115118
}
119+
100% {
120+
opacity: 0;
121+
}
116122
}
117123
}
118124

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const useRouter = () => {
2+
return {
3+
push(path) {
4+
location.pathname = path
5+
},
6+
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "next_navigation",
3+
"main": "./index.js"
4+
}

storybook/vite.config.mts

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export default defineConfig({
4343
'next/image': resolve(__dirname, './mock-packages/next_image'),
4444
'next/link': resolve(__dirname, './mock-packages/next_link'),
4545
'next/dynamic': resolve(__dirname, './mock-packages/next_dynamic'),
46+
'next/navigation': resolve(__dirname, './mock-packages/next_navigation'),
4647
'~': resolve(__dirname, '../src'),
4748
},
4849
},

tailwind.config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,9 @@ const twConfig: Config = {
291291
addDynamicIconSelectors(),
292292
addShortcutPlugin,
293293

294-
daisyui,
295294
typography,
295+
daisyui,
296+
296297
require('tailwind-scrollbar'),
297298
],
298299
}

0 commit comments

Comments
 (0)