Skip to content

Commit f874d76

Browse files
committed
Redesign legend pod layout
1 parent de1e1c9 commit f874d76

1 file changed

Lines changed: 23 additions & 34 deletions

File tree

src/App.tsx

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ const App = () => {
109109
theme={theme}
110110
/>
111111
<div
112-
className={`pointer-events-auto absolute bottom-6 left-6 flex max-w-4xl flex-nowrap items-stretch gap-2 overflow-x-auto rounded-full border px-3 py-2 text-xs ${
113-
isDark ? 'border-white/10 bg-[#050914]/80 text-slate-300' : 'border-slate-200 bg-white/95 text-slate-600 shadow-lg'
112+
className={`pointer-events-auto absolute bottom-6 left-6 flex max-w-4xl flex-nowrap items-stretch overflow-hidden rounded-full border text-xs ${
113+
isDark ? 'border-white/10 bg-[#050914]/80 text-slate-300' : 'border-slate-200 bg-white text-slate-600 shadow-lg'
114114
}`}
115115
>
116116
<LegendSummary
@@ -128,11 +128,6 @@ const App = () => {
128128
isDark={isDark}
129129
/>
130130
<InfoPill label="Online gateways" value={formatNumber(onlineGateways.length)} isDark={isDark} />
131-
{error && (
132-
<span className={`rounded-full px-3 py-1 ${isDark ? 'bg-red-500/20 text-red-200' : 'bg-red-100 text-red-500'}`}>
133-
{error}
134-
</span>
135-
)}
136131
</div>
137132
</div>
138133
{loading && <LoadingOverlay isDark={isDark} />}
@@ -208,6 +203,10 @@ const SectionGrid = ({ title, items, theme }: { title: string; items: { label: s
208203
);
209204
};
210205

206+
const SegmentWrapper = ({ children, isDark }: { children: React.ReactNode; isDark: boolean }) => (
207+
<div className={`flex flex-1 items-center gap-3 px-4 py-3 ${isDark ? 'border-white/10' : 'border-slate-200'} border-r last:border-r-0`}>{children}</div>
208+
);
209+
211210
const LegendSummary = ({
212211
color,
213212
label,
@@ -220,35 +219,25 @@ const LegendSummary = ({
220219
count: string;
221220
description: string;
222221
isDark: boolean;
223-
}) => {
224-
const chipClass = isDark
225-
? 'bg-white/5 text-white border border-white/10'
226-
: 'bg-white text-slate-900 border border-slate-200/70';
227-
return (
228-
<div className={`flex h-full flex-shrink-0 items-center gap-3 rounded-full px-3 py-2 ${chipClass}`}>
229-
<div className="flex items-center gap-2">
230-
<span className="h-2 w-2 rounded-full" style={{ backgroundColor: color }} />
231-
<span className="text-sm font-medium">{label}</span>
232-
</div>
233-
<div>
234-
<p className="font-display text-sm">{count}</p>
235-
<p className={`text-[0.6rem] uppercase tracking-[0.3em] ${isDark ? 'text-slate-500' : 'text-slate-600'}`}>{description}</p>
236-
</div>
222+
}) => (
223+
<SegmentWrapper isDark={isDark}>
224+
<div className="flex items-center gap-2">
225+
<span className="h-2 w-2 rounded-full" style={{ backgroundColor: color }} />
226+
<span className="text-sm font-medium">{label}</span>
237227
</div>
238-
);
239-
};
240-
241-
const InfoPill = ({ label, value, isDark }: { label: string; value: string; isDark: boolean }) => {
242-
const chipClass = isDark
243-
? 'bg-white/5 text-white border border-white/10'
244-
: 'bg-white text-slate-900 border border-slate-200/70';
245-
return (
246-
<div className={`flex h-full flex-shrink-0 items-center rounded-full px-3 py-2 ${chipClass}`}>
247-
<p className={`text-[0.6rem] uppercase tracking-[0.3em] ${isDark ? 'text-slate-500' : 'text-slate-600'}`}>{label}</p>
248-
<p className="text-sm font-medium">{value}</p>
228+
<div>
229+
<p className="font-display text-sm">{count}</p>
230+
<p className={`text-[0.6rem] uppercase tracking-[0.3em] ${isDark ? 'text-slate-500' : 'text-slate-600'}`}>{description}</p>
249231
</div>
250-
);
251-
};
232+
</SegmentWrapper>
233+
);
234+
235+
const InfoPill = ({ label, value, isDark }: { label: string; value: string; isDark: boolean }) => (
236+
<SegmentWrapper isDark={isDark}>
237+
<p className={`text-[0.6rem] uppercase tracking-[0.3em] ${isDark ? 'text-slate-500' : 'text-slate-600'}`}>{label}</p>
238+
<p className="text-sm font-medium">{value}</p>
239+
</SegmentWrapper>
240+
);
252241

253242
const LoadingOverlay = ({ isDark }: { isDark: boolean }) => (
254243
<div

0 commit comments

Comments
 (0)