From 5d87ce3ea45df32698fa20277f64814e723fb490 Mon Sep 17 00:00:00 2001 From: Ou Date: Sat, 12 Oct 2024 01:36:42 +0800 Subject: [PATCH] pref: ui --- src/components/section/card.tsx | 28 +++++++--------------------- src/components/section/index.tsx | 2 +- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/components/section/card.tsx b/src/components/section/card.tsx index 11ee4ee..cff9686 100644 --- a/src/components/section/card.tsx +++ b/src/components/section/card.tsx @@ -18,14 +18,12 @@ export interface ItemsProps extends React.HTMLAttributes { * 是否显示透明度,拖动时原卡片的样式 */ isDragged?: boolean - isOverlay?: boolean handleListeners?: SyntheticListenerMap } interface NewsCardProps { id: SourceID inView: boolean - isOverlay?: boolean handleListeners?: SyntheticListenerMap } @@ -33,11 +31,9 @@ interface Query { query: UseQueryResult } -export const CardWrapper = forwardRef(({ id, isDragged, isOverlay, handleListeners, style, ...props }, dndRef) => { +export const CardWrapper = forwardRef(({ id, isDragged, handleListeners, style, ...props }, dndRef) => { const ref = useRef(null) - const { ref: inViewRef, inView } = useInView({ - threshold: 0, - }) + const { ref: inViewRef, inView } = useInView() useImperativeHandle(dndRef, () => ref.current!) useImperativeHandle(inViewRef, () => ref.current!) @@ -48,7 +44,6 @@ export const CardWrapper = forwardRef(({ id, isDragg className={clsx( "flex flex-col h-500px rounded-2xl bg-blue bg-op-50 p-4 backdrop-blur-5", isDragged && "op-50", - isOverlay ? "backdrop-blur-5 bg-op-40" : "", )} style={{ transformOrigin: "50% 50%", @@ -56,13 +51,12 @@ export const CardWrapper = forwardRef(({ id, isDragg }} {...props} > - + ) }) export function CardOverlay({ id }: { id: SourceID }) { - const [focusSources] = useAtom(focusSourcesAtom) return (
{sources[id]?.title && {sources[id].title}} - 刚刚刷新 + 正在刷新
-