feat(notes): add mobile workspace selection
This commit is contained in:
parent
991acac3ba
commit
8e577993c0
@ -13,6 +13,7 @@ export default function CaptureScreen() {
|
|||||||
const saveDraft = useNotesStore((state: NotesState) => state.saveDraft);
|
const saveDraft = useNotesStore((state: NotesState) => state.saveDraft);
|
||||||
const workspaces = useWorkspaceStore((state: WorkspaceState) => state.workspaces);
|
const workspaces = useWorkspaceStore((state: WorkspaceState) => state.workspaces);
|
||||||
const activeWorkspaceId = useWorkspaceStore((state: WorkspaceState) => state.activeWorkspaceId);
|
const activeWorkspaceId = useWorkspaceStore((state: WorkspaceState) => state.activeWorkspaceId);
|
||||||
|
const setActiveWorkspace = useWorkspaceStore((state: WorkspaceState) => state.setActiveWorkspace);
|
||||||
const activeWorkspaceName =
|
const activeWorkspaceName =
|
||||||
workspaces.find((workspace: MobileWorkspace) => workspace.id === activeWorkspaceId)?.name ?? 'Drafts';
|
workspaces.find((workspace: MobileWorkspace) => workspace.id === activeWorkspaceId)?.name ?? 'Drafts';
|
||||||
|
|
||||||
@ -22,6 +23,22 @@ export default function CaptureScreen() {
|
|||||||
<Text style={styles.subtitle}>
|
<Text style={styles.subtitle}>
|
||||||
Create a lightweight mobile draft in {activeWorkspaceName}. Offline queue wiring comes in a later batch.
|
Create a lightweight mobile draft in {activeWorkspaceName}. Offline queue wiring comes in a later batch.
|
||||||
</Text>
|
</Text>
|
||||||
|
<View style={styles.workspaceRow}>
|
||||||
|
{workspaces.map((workspace: MobileWorkspace) => {
|
||||||
|
const isActive = workspace.id === activeWorkspaceId;
|
||||||
|
return (
|
||||||
|
<Pressable
|
||||||
|
key={workspace.id}
|
||||||
|
onPress={() => setActiveWorkspace(workspace.id)}
|
||||||
|
style={[styles.workspaceChip, isActive ? styles.workspaceChipActive : null]}
|
||||||
|
>
|
||||||
|
<Text style={[styles.workspaceChipText, isActive ? styles.workspaceChipTextActive : null]}>
|
||||||
|
{workspace.name}
|
||||||
|
</Text>
|
||||||
|
</Pressable>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
<TextInput
|
<TextInput
|
||||||
value={title}
|
value={title}
|
||||||
onChangeText={(value: string) => {
|
onChangeText={(value: string) => {
|
||||||
@ -121,6 +138,31 @@ const styles = StyleSheet.create({
|
|||||||
padding: 14,
|
padding: 14,
|
||||||
gap: 6,
|
gap: 6,
|
||||||
},
|
},
|
||||||
|
workspaceRow: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
gap: 8,
|
||||||
|
},
|
||||||
|
workspaceChip: {
|
||||||
|
borderRadius: 999,
|
||||||
|
borderWidth: 1,
|
||||||
|
borderColor: colors.borderDefault,
|
||||||
|
paddingHorizontal: 12,
|
||||||
|
paddingVertical: 8,
|
||||||
|
backgroundColor: colors.surfaceCard,
|
||||||
|
},
|
||||||
|
workspaceChipActive: {
|
||||||
|
backgroundColor: colors.accentPrimary,
|
||||||
|
borderColor: colors.accentPrimary,
|
||||||
|
},
|
||||||
|
workspaceChipText: {
|
||||||
|
color: colors.textSecondary,
|
||||||
|
fontSize: 13,
|
||||||
|
fontWeight: '600',
|
||||||
|
},
|
||||||
|
workspaceChipTextActive: {
|
||||||
|
color: colors.textPrimary,
|
||||||
|
},
|
||||||
cardTitle: {
|
cardTitle: {
|
||||||
color: colors.textPrimary,
|
color: colors.textPrimary,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user