Skip to content

Commit 9bee87f

Browse files
committed
Update allowed users mode selector to 2x2 grid layout
- Change from horizontal layout to 2x2 grid for better visual organization - Update button labels and order to match design: Only Me, Invite Only, Public Relay, Subscription - Increase button height to 80px to properly accommodate two-line text - Add proper flexbox layout to prevent text overlapping - Improve typography with larger main labels and smaller subtitle text - Maintain existing colors and functionality while improving layout Layout: Top row (Only Me, Invite Only), Bottom row (Public Relay, Subscription)
1 parent f05ec60 commit 9bee87f

File tree

2 files changed

+36
-17
lines changed

2 files changed

+36
-17
lines changed

src/components/allowed-users/components/ModeSelector/ModeSelector.styles.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ export const Container = styled.div`
88

99
export const ModeGrid = styled.div`
1010
display: grid;
11-
grid-template-columns: repeat(3, 1fr);
11+
grid-template-columns: repeat(2, 1fr);
12+
grid-template-rows: repeat(2, 1fr);
1213
gap: 1rem;
1314
margin-bottom: 1.5rem;
1415
1516
${media.md} {
1617
grid-template-columns: 1fr;
18+
grid-template-rows: none;
1719
gap: 0.75rem;
1820
}
1921
`;
@@ -24,10 +26,14 @@ interface ModeButtonProps {
2426
}
2527

2628
export const ModeButton = styled(Button)<ModeButtonProps>`
27-
height: 60px;
29+
height: 80px;
2830
border-radius: 8px;
2931
font-weight: 600;
3032
transition: all 0.3s ease;
33+
display: flex;
34+
align-items: center;
35+
justify-content: center;
36+
padding: 8px 16px;
3137
3238
${({ $isActive, $color }) => $isActive && `
3339
background-color: ${$color} !important;
@@ -41,7 +47,7 @@ export const ModeButton = styled(Button)<ModeButtonProps>`
4147
}
4248
4349
${media.md} {
44-
height: 50px;
50+
height: 70px;
4551
}
4652
`;
4753

src/components/allowed-users/components/ModeSelector/ModeSelector.tsx

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,29 @@ interface ModeSelectorProps {
1010
}
1111

1212
const MODE_INFO = {
13+
personal: {
14+
label: 'Only Me',
15+
subtitle: '[Free]',
16+
description: 'Personal relay for single user with unlimited access',
17+
color: '#fa541c'
18+
},
19+
exclusive: {
20+
label: 'Invite Only',
21+
subtitle: '[Free]',
22+
description: 'Invite-only access with manual NPUB management',
23+
color: '#722ed1'
24+
},
1325
free: {
14-
label: 'Free - Public Relay',
26+
label: 'Public Relay',
27+
subtitle: '[Free]',
1528
description: 'Open access with optional free tiers',
1629
color: '#1890ff'
1730
},
1831
paid: {
19-
label: 'Paid - Subscription Tiers',
32+
label: 'Subscription',
33+
subtitle: '[Paid]',
2034
description: 'Subscription-based access control',
2135
color: '#52c41a'
22-
},
23-
exclusive: {
24-
label: 'Free - Invite Only',
25-
description: 'Invite-only access with manual NPUB management',
26-
color: '#722ed1'
27-
},
28-
personal: {
29-
label: 'Free - Only Me',
30-
description: 'Personal relay for single user with unlimited access',
31-
color: '#fa541c'
3236
}
3337
};
3438

@@ -40,7 +44,7 @@ export const ModeSelector: React.FC<ModeSelectorProps> = ({
4044
return (
4145
<S.Container>
4246
<S.ModeGrid>
43-
{(Object.keys(MODE_INFO) as AllowedUsersMode[]).map((mode) => {
47+
{(['personal', 'exclusive', 'free', 'paid'] as AllowedUsersMode[]).map((mode) => {
4448
const info = MODE_INFO[mode];
4549
const isActive = currentMode === mode;
4650

@@ -54,7 +58,16 @@ export const ModeSelector: React.FC<ModeSelectorProps> = ({
5458
$isActive={isActive}
5559
$color={info.color}
5660
>
57-
{info.label}
61+
<div style={{
62+
display: 'flex',
63+
flexDirection: 'column',
64+
alignItems: 'center',
65+
gap: '2px',
66+
lineHeight: '1.2'
67+
}}>
68+
<div style={{ fontSize: '16px', fontWeight: '600' }}>{info.label}</div>
69+
<div style={{ fontSize: '12px', opacity: 0.8, fontWeight: '400' }}>{info.subtitle}</div>
70+
</div>
5871
</S.ModeButton>
5972
</Tooltip>
6073
);

0 commit comments

Comments
 (0)