feat: 앱을 웹과 맞춤 — 좋아요 하트·토스트, 별똥별, 단풍잎, 고운바탕, 안내 높이 유지, 시트 배경 페이드
This commit is contained in:
1 parent
865c521ab8
commit
b5d9adf396
19 files changed
+247
-52
No files matched your search
@@ -81,13 +81,17 @@ export function Rail({ children }: { children: ReactNode }) {
|
||||
);
|
||||
}
|
||||
|
||||
/** 실패·빈 목록 안내. 불러오는 중엔 그리지 않는다(그 자리는 스켈레톤) */
|
||||
export function StateBox({ load, onRetry, empty }: { load: Load; onRetry?: () => void; empty?: string }) {
|
||||
/**
|
||||
* 실패·빈 목록 안내. 불러오는 중엔 그리지 않는다(그 자리는 스켈레톤).
|
||||
* hold 에 스켈레톤을 주면 그 크기를 보이지 않게 깔고 안내를 그 위에 띄운다 — 로딩·실패·빈 상태의 자리 크기가 같다.
|
||||
* 이때 boxClassName 은 안내 상자의 위치(스켈레톤 바깥 여백만큼 inset).
|
||||
*/
|
||||
export function StateBox({ load, onRetry, empty, hold, boxClassName = 'inset-x-3 top-3 bottom-0' }: { load: Load; onRetry?: () => void; empty?: string; hold?: ReactNode; boxClassName?: string }) {
|
||||
const failed = load === 'error' || load === 'retrying';
|
||||
const text = failed ? '정보를 불러오지 못했어요.' : load === 'ready' ? empty : undefined;
|
||||
if (!text) return null;
|
||||
return (
|
||||
<View className="mx-3 mt-3 items-center gap-2 rounded-[22px] border-b-[5px] border-shade bg-card px-4 py-6">
|
||||
const box = (
|
||||
<View className={`items-center justify-center gap-2 rounded-[22px] border-b-[5px] border-shade bg-card px-4 py-6 ${hold ? `absolute ${boxClassName}` : 'mx-3 mt-3'}`}>
|
||||
<Text className="text-center text-[13.5px] font-semibold text-ink2">{text}</Text>
|
||||
{failed && onRetry && (
|
||||
<Pressable onPress={onRetry} disabled={load === 'retrying'} className="rounded-full bg-ink-btn px-4 py-1.5 disabled:opacity-60">
|
||||
@@ -96,6 +100,15 @@ export function StateBox({ load, onRetry, empty }: { load: Load; onRetry?: () =>
|
||||
)}
|
||||
</View>
|
||||
);
|
||||
if (!hold) return box;
|
||||
return (
|
||||
<View>
|
||||
<View style={{ opacity: 0 }} pointerEvents="none" accessibilityElementsHidden importantForAccessibility="no-hide-descendants">
|
||||
{hold}
|
||||
</View>
|
||||
{box}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
/** 사진 출처 표기 (공공누리 조건). 위치는 className 으로 */
|
||||
|
||||
Reference in new issue
Block a user