mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
docs: simplify the reference and tighten the verifier (#2736)
This commit is contained in:
1 parent
6af33c7188
commit
7375ac9d80
111 files changed
+1616
-2430
No files matched your search
@@ -9,7 +9,7 @@ import {Tooltip} from '@app/features/ui/tooltip/Tooltip';
|
||||
import type {CustomStatus} from '@app/features/user/state/CustomStatus';
|
||||
import {getCustomStatusText, isCustomStatusExpired, normalizeCustomStatus} from '@app/features/user/state/CustomStatus';
|
||||
import clsx from 'clsx';
|
||||
import {type ReactNode, useEffect, useMemo, useRef, useState} from 'react';
|
||||
import {type ReactNode, useEffect, useRef, useState} from 'react';
|
||||
|
||||
interface CompactMemberCustomStatusProps {
|
||||
className?: string;
|
||||
@@ -97,13 +97,7 @@ export function CompactMemberCustomStatus({
|
||||
const timer = window.setTimeout(() => setExpiryTick((tick) => tick + 1), delay);
|
||||
return () => window.clearTimeout(timer);
|
||||
}, [status]);
|
||||
const normalized = useMemo(() => {
|
||||
const nextStatus = normalizeCustomStatus(status);
|
||||
if (!nextStatus || isCustomStatusExpired(nextStatus)) {
|
||||
return null;
|
||||
}
|
||||
return nextStatus;
|
||||
}, [status]);
|
||||
const normalized = normalizeCustomStatus(status);
|
||||
const fullText = normalized ? getCustomStatusText(normalized) : null;
|
||||
const isOverflowing = useTextOverflow(containerRef, {content: fullText, measureTextRange: true});
|
||||
if (!normalized) {
|
||||
|
||||
Reference in new issue
Block a user