Skip to content

Commit 2d87e2d

Browse files
committed
fix: chrome scroll behavior
Signed-off-by: Innei <tukon479@gmail.com>
1 parent 44b5f7a commit 2d87e2d

File tree

5 files changed

+35
-12
lines changed

5 files changed

+35
-12
lines changed

src/assets/styles/extra.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ ph {
138138
width: 3em;
139139
height: 3em;
140140
right: 0;
141-
bottom: 0;
142141
content: '';
143142
}
144143

@@ -155,6 +154,7 @@ ph {
155154
transparent 50%,
156155
var(--gray-6) 0
157156
);
157+
transform: translateY(-12px);
158158
border-left: 1px solid var(--gray-5);
159159
border-top: 1px solid var(--gray-5);
160160
border-top-left-radius: 3px;

src/components/widgets/Subscribe/hooks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const SWR_CHECK_SUBSCRIBE_KEY = 'subscribe-status'
1313

1414
export const useSubscribeStatus = () => {
1515
return useSWR(SWR_CHECK_SUBSCRIBE_KEY, apiClient.subscribe.check, {
16-
refreshInterval: 10e8,
16+
refreshInterval: 60_000 * 10,
1717
})
1818
}
1919

src/components/widgets/xLogInfo/index.tsx

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { clsx } from 'clsx'
2-
import type { FC } from 'react'
2+
import type { FC, SVGProps } from 'react'
33
import { useState } from 'react'
44
import { Collapse } from 'react-collapse'
55

@@ -32,7 +32,7 @@ export const XLogInfoForNote: FC<{
3232
export const XLogInfoBase: FC<{
3333
meta?: XLogMeta
3434
}> = ({ meta }) => {
35-
const [collapse, setCollapse] = useState(true)
35+
const [collapse, setCollapse] = useState(false)
3636

3737
if (!meta) return null
3838

@@ -96,14 +96,22 @@ export const XLogInfoBase: FC<{
9696
<div
9797
role="button"
9898
tabIndex={0}
99-
className="flex w-full justify-between items-center rounded-lg p-2 text-left text-gray-900 hover:bg-zinc-100 transition-colors duration-300 transition md:rounded-xl"
99+
className="flex w-[100%+0.5rem] justify-between items-center rounded-lg -mx-2 p-2 text-left text-gray-900 hover:bg-zinc-100 dark:hover:bg-dark-200 transition-colors duration-300 transition md:rounded-xl"
100100
onClick={() => {
101101
setCollapse((c) => !c)
102102
}}
103103
>
104-
<div className="flex items-center space-x-2">
105-
<SafeIcon />
106-
<span>此文章已经由它的创作者签名并安全地存储在区块链上。</span>
104+
<div className="flex items-center justify-between w-full">
105+
<span className="flex-grow flex space-x-2">
106+
<SafeIcon />
107+
<span>此文章已经由它的创作者签名并安全地存储在区块链上。</span>
108+
</span>
109+
<IcRoundKeyboardArrowDown
110+
className={clsx(
111+
!collapse ? '' : 'rotate-180',
112+
'transition-transform transform ease-linear duration-200 text-lg',
113+
)}
114+
/>
107115
</div>
108116
</div>
109117
<Collapse isOpened={collapse}>
@@ -128,3 +136,20 @@ const SafeIcon = () => (
128136
/>
129137
</svg>
130138
)
139+
140+
const IcRoundKeyboardArrowDown = (props: SVGProps<SVGSVGElement>) => {
141+
return (
142+
<svg
143+
xmlns="http://www.w3.org/2000/svg"
144+
width="1em"
145+
height="1em"
146+
viewBox="0 0 24 24"
147+
{...props}
148+
>
149+
<path
150+
fill="currentColor"
151+
d="M8.12 9.29L12 13.17l3.88-3.88a.996.996 0 1 1 1.41 1.41l-4.59 4.59a.996.996 0 0 1-1.41 0L6.7 10.7a.996.996 0 0 1 0-1.41c.39-.38 1.03-.39 1.42 0z"
152+
/>
153+
</svg>
154+
)
155+
}

src/components/widgets/xLogSummary/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ export const XLogSummary: FC<{
2323
})
2424
},
2525
{
26-
revalidateOnReconnect: false,
2726
revalidateOnFocus: false,
2827
errorRetryCount: 3,
2928
errorRetryInterval: 1000,
30-
dedupingInterval: 0,
29+
refreshInterval: 0,
3130
},
3231
)
3332

src/pages/notes/[id].tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ const NoteView: React.FC<{ id: string }> = memo((props) => {
213213
},
214214
},
215215
})}
216-
217216
<NoteLayout title={title} date={note.created} tips={tips} id={note.id}>
218217
{isSecret && !isLogged ? (
219218
<p className="text-center my-8">
@@ -238,9 +237,9 @@ const NoteView: React.FC<{ id: string }> = memo((props) => {
238237
)}
239238
<div className="pb-8" />
240239
{note.topic && <NoteTopic noteId={props.id} topic={note.topic} />}
240+
241241
<NoteFooterNavigationBarForMobile id={props.id} />
242242
<div className="pb-4" />
243-
244243
<SubscribeBell defaultType={'note_c'} />
245244
<XLogInfoForNote id={props.id} />
246245
<NoteFooterActionBar id={props.id} />

0 commit comments

Comments
 (0)