feat: 히어로 날씨 점수 옆 ? 버튼 — 누르면 비중 막대(칸 넓이=비중, 채운 만큼=얻은 점수)와 조건별 지금 값으로 점수 근거를 보여 주는 창
This commit is contained in:
1 parent
8f95519cb6
commit
b7d4df4d7a
8 files changed
+190
-6
No files matched your search
@@ -139,6 +139,10 @@ function Hero({ hero, today, ranked, all, feedLoad, todayLoad }: HeroProps) {
|
||||
const weather = weatherOf(slotOf(mode))
|
||||
const slotScore = mode === 'now' ? undefined : hero?.weather_slots?.[SLOT_KEY[mode]]
|
||||
const score = slotScore ?? hero?.weather_score
|
||||
// 점수 옆 ? 버튼: 보고 있는 시간대(지금이면 지금 구간)의 날씨 점수 근거
|
||||
const whyKey = mode === 'now' ? SLOT_KEY[nowKind] : SLOT_KEY[mode]
|
||||
const why = hero?.weather_why?.[whyKey]
|
||||
const whyLabel = mode === 'now' || mode === nowKind ? '지금' : PREVIEW[mode].label
|
||||
const slotTop = mode === 'now' ? undefined : ranked.find((g) => g.active)
|
||||
const top1 = slotTop ?? hero?.top1
|
||||
// 저녁(노을)부터는 가운데 동그라미가 오늘 밤 달 모양이 된다
|
||||
@@ -208,6 +212,16 @@ function Hero({ hero, today, ranked, all, feedLoad, todayLoad }: HeroProps) {
|
||||
<small className="block font-jua text-[12px]">{failed(feedLoad) ? '점수를 못 불러왔어요' : `${slotScore != null && mode !== 'now' ? PREVIEW[mode].label : '지금'} 날씨 점수`}</small>
|
||||
<b className="block font-bagel text-[52px] leading-[0.95] font-normal">{heroVal(feedLoad, score, 'w-[84px]')}</b>
|
||||
</span>
|
||||
{why && score != null && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => open({ type: 'weatherWhy', why: { label: whyLabel, score, why } })}
|
||||
aria-label={`${whyLabel} 날씨 점수 ${score}점, 어떻게 나왔는지 보기`}
|
||||
className={cx('absolute right-0 bottom-1 z-[2] grid size-7 cursor-pointer place-items-center rounded-full bg-white font-jua text-[16px] text-(--orange-deep) shadow-[0_2px_6px_rgb(40_48_74/0.25)]', TAP44)}
|
||||
>
|
||||
?
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="relative z-[3] text-center">
|
||||
|
||||
Reference in new issue
Block a user