feat(symbol-page): PeriodTabs overflow fix + fullscreen chart symbol label
- page.tsx: wrap PeriodTabs in overflow-x-auto + inner flex w-max min-w-full
justify-end so the leftmost tab is reachable when content exceeds container
(justify-end + overflow-x-auto alone clips negative direction in some browsers).
- StockChart: when fullscreen, render small "{name} {code}" leading label in the
toolbar — PriceHero is covered by the fixed inset overlay so the chart loses
symbol context otherwise. Toolbar (not canvas) so it doesn't overlap the
existing CrosshairLabel at top-left of the chart area.
This commit is contained in:
@@ -213,8 +213,16 @@ export default function CodePage({ params }: { params: { code: string } }) {
|
||||
<StarButton code={code} name={chart?.name} />
|
||||
</div>
|
||||
</div>
|
||||
<div className="mb-4 flex justify-end overflow-x-auto">
|
||||
<PeriodTabs value={period} onChange={(id) => setPeriod(id)} />
|
||||
{/*
|
||||
PeriodTabs 가 좁은 폭에서 컨테이너보다 넓어질 때:
|
||||
부모에 `justify-end` 를 직접 걸면 음수 방향으로 첫 탭이 잘려서 스크롤로도 접근이 어려움.
|
||||
wrapper-of-wrapper 패턴 — 바깥은 overflow-x-auto 스크롤만, 안쪽 inline flex 가 폭에 맞춰
|
||||
넓으면 좌측 정렬(스크롤 노출), 좁으면 우측 정렬(공간 차지 안 함). w-max + min-w-full 이 핵심.
|
||||
*/}
|
||||
<div className="mb-4 overflow-x-auto">
|
||||
<div className="flex w-max min-w-full justify-end">
|
||||
<PeriodTabs value={period} onChange={(id) => setPeriod(id)} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{err && <div className="mb-4 text-sm text-red-400">차트 로딩 실패: {err}</div>}
|
||||
|
||||
Reference in New Issue
Block a user