also looking at this
feat: native trail maps and complete native mobile screens
#1017
60 files
+2505
-823
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -161,7 +161,7 @@ onMount(() => onNativeAccountChange(craft, () => { rows.set([]); void load() })) | ||
| 161 | 161 | </View> |
| 162 | 162 | |
| 163 | 163 | <View :show="past().length > 0" class="mt-5 gap-2"> |
| 164 | <Text testID="past-heading" class="text-xs font-semibold uppercase text-slate-600">Finished</Text> | |
| 164 | <Text testID="past-heading" class="text-xs font-semibold uppercase text-[#64745f] dark:text-[#91a28b]">Finished</Text> | |
| 165 | 165 | <Pressable :for="row in past()" :key="row.id" testID="past-row" class="rounded-xl bg-white dark:bg-[#1b2c22]/60 p-3" @click="openEvent(row)"> |
| 166 | 166 | <Text class="text-sm font-semibold text-[#253321] dark:text-[#e3ecdf]" :text="row.name" /> |
| 167 | 167 | <Text class="text-xs text-[#64745f] dark:text-[#91a28b]" :text="kind(row) + ' · ' + when(row)" /> |
| @@ -2,6 +2,7 @@ | ||
| 2 | 2 | import { nativeApiOrigin } from '../functions/native-api' |
| 3 | 3 | import type { NativeCraft } from '@stacksjs/stx/native' |
| 4 | 4 | import { ACTIVITY_VISIBILITIES, buildManualActivity, MANUAL_ACTIVITY_TYPES, todayLocal } from '../functions/manual-activity' |
| 5 | import { nativeUi as ui } from '../functions/native-ui' | |
| 5 | 6 | |
| 6 | 7 | const craft = (globalThis as typeof globalThis & { craft: NativeCraft }).craft |
| 7 | 8 | const types = [...MANUAL_ACTIVITY_TYPES] |
| @@ -114,34 +115,34 @@ onDestroy(() => { | ||
| 114 | 115 | }) |
| 115 | 116 | </script> |
| 116 | 117 | |
| 117 | <SafeAreaView class="flex-1 bg-[#f2f4ef] dark:bg-[#101c16]"> | |
| 118 | <ScrollView class="p-4" testID="manual-scroll"> | |
| 119 | <Text class="mt-1 text-sm text-[#51604e] dark:text-[#b0bfac]">The same manual entry saved by the Wildloop web feed.</Text> | |
| 118 | <SafeAreaView :class="ui.screen"> | |
| 119 | <ScrollView class="flex-1 p-4" testID="manual-scroll"> | |
| 120 | <Text class="mt-1" :class="ui.caption">Add a run, hike, walk, or ride to your log.</Text> | |
| 120 | 121 | |
| 121 | 122 | <View class="mt-5 gap-2"> |
| 122 | <Text class="text-sm font-semibold text-slate-200">Activity</Text> | |
| 123 | <Text :class="ui.title">Activity</Text> | |
| 123 | 124 | <Text testID="activity-type" class="text-lg text-[#24724b] dark:text-[#9be579]" :text="types[typeIndex()]" /> |
| 124 | <Button testID="cycle-type" @click="cycleType()">Change activity type</Button> | |
| 125 | <Button testID="cycle-type" :class="ui.secondary" @click="cycleType()">Change activity type</Button> | |
| 125 | 126 | </View> |
| 126 | 127 | |
| 127 | 128 | <View class="mt-4 gap-2"> |
| 128 | <Text class="text-sm text-slate-200">Distance (miles)</Text> | |
| 129 | <TextInput testID="distance-input" placeholder="5.0" :value="distance" @input="distance.set(eventText($event))" /> | |
| 130 | <Text class="text-sm text-slate-200">Duration (MM:SS or H:MM:SS)</Text> | |
| 131 | <TextInput testID="duration-input" placeholder="45:30" :value="duration" @input="duration.set(eventText($event))" /> | |
| 132 | <Text class="text-sm text-slate-200">Elevation gain (feet)</Text> | |
| 133 | <TextInput testID="elevation-input" placeholder="800" :value="elevation" @input="elevation.set(eventText($event))" /> | |
| 134 | <Text class="text-sm text-slate-200">Trail id (optional)</Text> | |
| 135 | <TextInput testID="trail-input" placeholder="42" :value="trailId" @input="trailId.set(eventText($event))" /> | |
| 136 | <Text class="text-sm text-slate-200">Date</Text> | |
| 137 | <TextInput testID="date-input" placeholder="YYYY-MM-DD" :value="date" @input="date.set(eventText($event))" /> | |
| 138 | <Text class="text-sm text-slate-200">Notes</Text> | |
| 139 | <TextInput testID="notes-input" placeholder="How did it go?" :value="notes" @input="notes.set(eventText($event))" /> | |
| 129 | <Text :class="ui.caption">Distance (miles)</Text> | |
| 130 | <TextInput testID="distance-input" :class="ui.input" placeholder="5.0" :value="distance" @input="distance.set(eventText($event))" /> | |
| 131 | <Text :class="ui.caption">Duration (MM:SS or H:MM:SS)</Text> | |
| 132 | <TextInput testID="duration-input" :class="ui.input" placeholder="45:30" :value="duration" @input="duration.set(eventText($event))" /> | |
| 133 | <Text :class="ui.caption">Elevation gain (feet)</Text> | |
| 134 | <TextInput testID="elevation-input" :class="ui.input" placeholder="800" :value="elevation" @input="elevation.set(eventText($event))" /> | |
| 135 | <Text :class="ui.caption">Trail id (optional)</Text> | |
| 136 | <TextInput testID="trail-input" :class="ui.input" placeholder="42" :value="trailId" @input="trailId.set(eventText($event))" /> | |
| 137 | <Text :class="ui.caption">Date</Text> | |
| 138 | <TextInput testID="date-input" :class="ui.input" placeholder="YYYY-MM-DD" :value="date" @input="date.set(eventText($event))" /> | |
| 139 | <Text :class="ui.caption">Notes</Text> | |
| 140 | <TextInput testID="notes-input" :class="ui.input" placeholder="How did it go?" :value="notes" @input="notes.set(eventText($event))" /> | |
| 140 | 141 | </View> |
| 141 | 142 | |
| 142 | 143 | <View class="mt-4 gap-2"> |
| 143 | 144 | <Text testID="visibility" class="text-sm text-[#253321] dark:text-[#e3ecdf]" :text="'Visible to ' + visibilities[visibilityIndex()]" /> |
| 144 | <Button testID="cycle-visibility" @click="cycleVisibility()">Change visibility</Button> | |
| 145 | <Button testID="cycle-visibility" :class="ui.secondary" @click="cycleVisibility()">Change visibility</Button> | |
| 145 | 146 | </View> |
| 146 | 147 | |
| 147 | 148 | <View class="mt-5 gap-2"> |
| @@ -154,7 +155,7 @@ onDestroy(() => { | ||
| 154 | 155 | </View> |
| 155 | 156 | |
| 156 | 157 | <Text :show="error" testID="manual-error" class="mt-4 text-[#b4232a] dark:text-[#ff8487]" :text="error" /> |
| 157 | <Button testID="save-activity" class="mt-5" @click="submit()">Save activity</Button> | |
| 158 | <Button testID="manual-back" class="mt-2" @click="goBack()">Back</Button> | |
| 158 | <Button testID="save-activity" class="mt-5" :class="ui.action" :disabled="saving" :title="saving() ? 'Saving…' : 'Save activity'" @click="submit()" /> | |
| 159 | <Button testID="manual-back" class="mt-2" :class="ui.secondary" @click="goBack()">Back</Button> | |
| 159 | 160 | </ScrollView> |
| 160 | 161 | </SafeAreaView> |
| @@ -226,7 +226,7 @@ onMount(() => onNativeAccountChange(craft, () => { rows.set([]); void load() })) | ||
| 226 | 226 | <Text class="text-sm font-semibold text-[#192414] dark:text-[#f0f5ec]" :text="holderName(holder)" /> |
| 227 | 227 | <Text testID="holder-zones" class="text-xs text-[#64745f] dark:text-[#91a28b]" :text="holderZones(holder)" /> |
| 228 | 228 | </View> |
| 229 | <Text testID="holder-area" class="text-sm font-semibold text-slate-200" :text="holderArea(holder)" /> | |
| 229 | <Text testID="holder-area" class="text-sm font-semibold text-[#192414] dark:text-[#f0f5ec]" :text="holderArea(holder)" /> | |
| 230 | 230 | </View> |
| 231 | 231 | </View> |
| 232 | 232 | </View> |