Skip to content

Commit d907db0

Browse files
committed
chore(demo): tweak ui
1 parent b6db976 commit d907db0

23 files changed

+433
-699
lines changed

examples/build.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -353,20 +353,21 @@ Always remove listeners on cleanup (useEffect return function):
353353

354354
### Section Order (top to bottom)
355355

356-
1. **App Section** (App ID, Guidance Banner, Consent Toggle, Logged-in-as display, Login/Logout)
357-
2. **Push Section** (Push ID, Enabled Toggle, Auto-prompts permission on load)
358-
3. **Send Push Notification Section** (Simple, With Image, Custom buttons)
359-
4. **In-App Messaging Section** (Pause toggle)
360-
5. **Send In-App Message Section** (Top Banner, Bottom Banner, Center Modal, Full Screen - with icons)
361-
6. **Aliases Section** (Add/Add Multiple, read-only list)
362-
7. **Emails Section** (Collapsible list >5 items)
363-
8. **SMS Section** (Collapsible list >5 items)
364-
9. **Tags Section** (Add/Add Multiple/Remove Selected)
365-
10. **Outcome Events Section** (Send Outcome dialog with type selection)
366-
11. **Triggers Section** (Add/Add Multiple/Remove Selected/Clear All - IN MEMORY ONLY)
367-
12. **Track Event Section** (Track Event with JSON validation)
368-
13. **Location Section** (Location Shared toggle, Prompt Location button)
369-
14. **Next Page Button**
356+
1. **App Section** (App ID, Guidance Banner, Consent Toggle)
357+
2. **User Section** (Status display, Login/Logout)
358+
3. **Push Section** (Push ID, Enabled Toggle, Auto-prompts permission on load)
359+
4. **Send Push Notification Section** (Simple, With Image, Custom buttons)
360+
5. **In-App Messaging Section** (Pause toggle)
361+
6. **Send In-App Message Section** (Top Banner, Bottom Banner, Center Modal, Full Screen - with icons)
362+
7. **Aliases Section** (Add/Add Multiple, read-only list)
363+
8. **Emails Section** (Collapsible list >5 items)
364+
9. **SMS Section** (Collapsible list >5 items)
365+
10. **Tags Section** (Add/Add Multiple/Remove Selected)
366+
11. **Outcome Events Section** (Send Outcome dialog with type selection)
367+
12. **Triggers Section** (Add/Add Multiple/Remove Selected/Clear All - IN MEMORY ONLY)
368+
13. **Track Event Section** (Track Event with JSON validation)
369+
14. **Location Section** (Location Shared toggle, Prompt Location button)
370+
15. **Next Page Button**
370371

371372
### Prompt 2.1 - App Section
372373

@@ -391,7 +392,11 @@ App Section layout:
391392
- Separated from the above toggle by a horizontal divider
392393
- NOT a blocking overlay - user can interact with app regardless of state
393394

394-
4. User status card (always visible, ABOVE the login/logout buttons):
395+
### Prompt 2.1b - User Section
396+
397+
User Section layout (separate section from App, placed directly below it):
398+
399+
1. User status card (always visible, ABOVE the login/logout buttons):
395400
- Card with two rows separated by a divider
396401
- Row 1: "Status" label on the left, value on the right
397402
- Row 2: "External ID" label on the left, value on the right
@@ -402,12 +407,12 @@ App Section layout:
402407
- Status shows "Logged In" with success styling
403408
- External ID shows the actual external user ID
404409

405-
5. LOGIN USER button:
410+
2. LOGIN USER button:
406411
- Shows "LOGIN USER" when no user is logged in
407412
- Shows "SWITCH USER" when a user is logged in
408-
- Opens modal with empty "External User Id" field
413+
- Opens "Login User" modal with empty `External User Id` field
409414

410-
6. LOGOUT USER button (only visible when a user is logged in)
415+
3. LOGOUT USER button (only visible when a user is logged in)
411416

412417
### Prompt 2.2 - Push Section
413418

@@ -473,8 +478,8 @@ Tooltip should explain each IAM type.
473478
Aliases Section (placed after Send In-App Message):
474479

475480
- Section title: "Aliases" with info icon for tooltip
476-
- List showing key-value pairs (read-only, no delete icons)
477-
- Each item shows: Label | ID
481+
- Stacked key-value list (read-only, no delete icons)
482+
- Each item shows Label on top, ID below (see styles.md "Stacked" list layout)
478483
- Filter out "external_id" and "onesignal_id" from display (these are special)
479484
- "No Aliases Added" text when empty
480485
- ADD button -> PairInputModal with empty Label and ID fields on the same row (single add)
@@ -1059,7 +1064,8 @@ examples/demo/
10591064
│ │ ├── CustomNotificationModal.tsx
10601065
│ │ └── TooltipModal.tsx
10611066
│ └── sections/
1062-
│ ├── AppSection.tsx # App ID, consent, login/logout
1067+
│ ├── AppSection.tsx # App ID, guidance banner, consent
1068+
│ ├── UserSection.tsx # User status, login/logout
10631069
│ ├── PushSection.tsx # Push subscription controls
10641070
│ ├── SendPushSection.tsx # Send notification buttons
10651071
│ ├── InAppSection.tsx # IAM pause toggle

examples/demo/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ function App() {
146146
headerStyle: { backgroundColor: AppColors.osPrimary },
147147
headerTintColor: AppColors.white,
148148
headerTitleAlign: 'center',
149+
headerShadowVisible: false,
149150
}}
150151
>
151152
<Stack.Screen
@@ -189,7 +190,6 @@ const headerStyles = StyleSheet.create({
189190
fontSize: 14,
190191
fontWeight: '400',
191192
color: AppColors.white,
192-
opacity: 0.9,
193193
},
194194
});
195195

examples/demo/src/components/ActionButton.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,17 @@ export default function ActionButton({
3232
leftAligned,
3333
}: Props) {
3434
const bgColor =
35-
variant === 'primary'
36-
? AppColors.osPrimary
37-
: variant === 'destructive'
38-
? AppColors.osPrimary
39-
: 'transparent';
35+
variant === 'primary' ? AppColors.osPrimary : 'transparent';
4036

4137
const borderStyle =
42-
variant === 'outlined'
38+
variant === 'outlined' || variant === 'destructive'
4339
? { borderWidth: 1, borderColor: AppColors.osPrimary }
4440
: {};
4541

46-
const textColor = variant === 'outlined' ? AppColors.osPrimary : AppColors.white;
42+
const textColor =
43+
variant === 'outlined' || variant === 'destructive'
44+
? AppColors.osPrimary
45+
: AppColors.white;
4746

4847
return (
4948
<TouchableOpacity
@@ -78,7 +77,8 @@ export default function ActionButton({
7877
const styles = StyleSheet.create({
7978
button: {
8079
borderRadius: 8,
81-
paddingVertical: 14,
80+
height: 48,
81+
justifyContent: 'center',
8282
paddingHorizontal: 16,
8383
width: '100%',
8484
marginBottom: AppSpacing.gap,
@@ -94,8 +94,6 @@ const styles = StyleSheet.create({
9494
text: {
9595
fontSize: 14,
9696
fontWeight: '600',
97-
letterSpacing: 0.5,
98-
textTransform: 'uppercase',
9997
},
10098
iconLeft: {
10199
marginRight: 8,

examples/demo/src/components/ListWidgets.tsx

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState } from 'react';
22
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
33
import Icon from 'react-native-vector-icons/MaterialIcons';
4-
import { AppColors, AppTheme } from '../theme';
4+
import { AppColors, AppTextStyles, AppTheme } from '../theme';
55

66
// PairItem
77
interface PairItemProps {
@@ -187,25 +187,24 @@ const styles = StyleSheet.create({
187187
pairRow: {
188188
flexDirection: 'row',
189189
alignItems: 'center',
190-
paddingVertical: 8,
190+
paddingVertical: 4,
191+
paddingHorizontal: 4,
191192
},
192193
pairStackedContent: {
193194
flex: 1,
194195
marginRight: 8,
195196
},
196197
pairStackedKey: {
197-
fontSize: 15,
198-
color: AppColors.osGrey700,
199-
fontWeight: '500',
198+
...AppTextStyles.bodyMedium,
200199
marginBottom: 2,
201200
},
202201
pairStackedValue: {
203-
fontSize: 14,
202+
...AppTextStyles.bodySmall,
204203
color: AppColors.osGrey600,
205204
},
206205
pairKey: {
206+
...AppTextStyles.bodyMedium,
207207
flex: 1,
208-
fontSize: 14,
209208
color: AppColors.osGrey600,
210209
},
211210
pairSeparator: {
@@ -214,41 +213,41 @@ const styles = StyleSheet.create({
214213
marginHorizontal: 8,
215214
},
216215
pairValue: {
216+
...AppTextStyles.bodyMedium,
217217
flex: 1,
218-
fontSize: 14,
219218
color: AppColors.osGrey700,
220219
textAlign: 'right',
221220
marginRight: 8,
222221
},
223222
singleRow: {
224223
flexDirection: 'row',
225224
alignItems: 'center',
226-
paddingVertical: 8,
225+
paddingVertical: 4,
226+
paddingHorizontal: 4,
227227
},
228228
singleValue: {
229+
...AppTextStyles.bodyMedium,
229230
flex: 1,
230-
fontSize: 14,
231231
color: AppColors.osGrey700,
232232
},
233233
emptyContainer: {
234-
paddingVertical: 8,
234+
paddingVertical: 12,
235235
alignItems: 'center',
236236
},
237237
emptyText: {
238-
fontSize: 14,
238+
...AppTextStyles.bodyMedium,
239239
color: AppColors.osGrey600,
240-
fontStyle: 'italic',
241240
},
242241
divider: {
243242
height: 1,
244243
backgroundColor: AppColors.osDivider,
245244
},
246245
moreButton: {
247-
paddingVertical: 8,
246+
paddingVertical: 4,
248247
alignItems: 'center',
249248
},
250249
moreText: {
251-
fontSize: 13,
250+
fontSize: 14,
252251
color: AppColors.osPrimary,
253252
fontWeight: '500',
254253
},

examples/demo/src/components/LogView.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
} from 'react-native';
99
import Icon from 'react-native-vector-icons/MaterialIcons';
1010
import LogManager, { LogEntry } from '../services/LogManager';
11-
import { AppColors } from '../theme';
11+
import { AppColors, AppTextStyles } from '../theme';
1212

1313
const LEVEL_COLORS: Record<string, string> = {
1414
D: AppColors.osLogDebug,
@@ -142,13 +142,13 @@ const styles = StyleSheet.create({
142142
alignItems: 'center',
143143
},
144144
headerText: {
145-
fontSize: 11,
145+
...AppTextStyles.labelSmall,
146146
fontWeight: '700',
147147
color: AppColors.white,
148148
letterSpacing: 0.8,
149149
},
150150
countText: {
151-
fontSize: 11,
151+
...AppTextStyles.labelSmall,
152152
color: AppColors.osGrey500,
153153
marginLeft: 8,
154154
},
@@ -172,22 +172,22 @@ const styles = StyleSheet.create({
172172
gap: 4,
173173
},
174174
timestamp: {
175-
fontSize: 11,
175+
...AppTextStyles.labelSmall,
176176
color: AppColors.osLogTimestamp,
177177
fontFamily: 'monospace',
178178
},
179179
level: {
180-
fontSize: 11,
180+
...AppTextStyles.labelSmall,
181181
fontWeight: '700',
182182
fontFamily: 'monospace',
183183
},
184184
message: {
185-
fontSize: 11,
185+
...AppTextStyles.labelSmall,
186186
color: AppColors.white,
187187
fontFamily: 'monospace',
188188
},
189189
emptyText: {
190-
fontSize: 11,
190+
...AppTextStyles.labelSmall,
191191
color: AppColors.osGrey500,
192192
paddingVertical: 12,
193193
textAlign: 'center',

examples/demo/src/components/SectionCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
3-
import { AppColors, AppTheme, AppSpacing } from '../theme';
3+
import { AppColors, AppTextStyles, AppTheme, AppSpacing } from '../theme';
44

55
interface Props {
66
title: string;
@@ -46,7 +46,7 @@ const styles = StyleSheet.create({
4646
paddingHorizontal: 4,
4747
},
4848
title: {
49-
fontSize: 12,
49+
...AppTextStyles.bodySmall,
5050
fontWeight: '700',
5151
color: AppColors.osGrey700,
5252
letterSpacing: 0.5,

examples/demo/src/components/ToggleRow.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { View, Text, Switch, StyleSheet } from 'react-native';
3-
import { AppColors } from '../theme';
3+
import { AppColors, AppTextStyles } from '../theme';
44

55
interface Props {
66
label: string;
@@ -49,12 +49,11 @@ const styles = StyleSheet.create({
4949
marginRight: 12,
5050
},
5151
label: {
52-
fontSize: 15,
52+
...AppTextStyles.bodyMedium,
5353
color: '#212121',
54-
fontWeight: '500',
5554
},
5655
description: {
57-
fontSize: 12,
56+
...AppTextStyles.bodySmall,
5857
color: AppColors.osGrey600,
5958
marginTop: 2,
6059
},

0 commit comments

Comments
 (0)