Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"react-native": "0.85.3",
"react-native-encrypted-storage": "^4.0.3",
"react-native-safe-area-context": "^5.5.2",
"react-native-screens": "^4.25.2"
"react-native-screens": "^4.25.2",
"rn-emoji-keyboard": "^1.7.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
Expand Down
83 changes: 81 additions & 2 deletions src/graphql/__generated__/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/graphql/queries/elementDetail.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ query ElementDetail($id: String!) {
icon
description
completed
uri
labels
trips {
id
}
location {
id
address
latitude
longitude
placeId
}
photos {
id
Expand All @@ -25,6 +30,8 @@ query ElementDetail($id: String!) {
endDate
startTime
endTime
startTz
endTz
}
}
}
37 changes: 37 additions & 0 deletions src/graphql/queries/updateElement.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
mutation UpdateElement($input: ElementInput!) {
updateElement(input: $input) {
id
name
icon
description
completed
uri
labels
trips {
id
}
location {
id
address
latitude
longitude
placeId
}
photos {
id
thumbnail
regular
description
}
schedule {
id
allDay
startDate
endDate
startTime
endTime
startTz
endTz
}
}
}
22 changes: 22 additions & 0 deletions src/map/ElementDetailScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export function ElementDetailScreen({route, navigation}: Props) {
element={data?.element ?? null}
loading={loading}
onClose={() => navigation.goBack()}
onEdit={() => navigation.navigate('ElementEdit', {elementId})}
/>
</View>
);
Expand All @@ -38,10 +39,12 @@ function ModalContents({
element,
loading,
onClose,
onEdit,
}: {
element: ElementDetail | null;
loading: boolean;
onClose: () => void;
onEdit: () => void;
}) {
const safeAreaInsets = useSafeAreaInsets();

Expand All @@ -59,6 +62,16 @@ function ModalContents({
<Text style={styles.headerTitle} numberOfLines={1}>
{element?.name ?? (loading ? 'Loading…' : ' ')}
</Text>
{element ? (
<Pressable
accessibilityRole="button"
accessibilityLabel="Edit element"
hitSlop={10}
onPress={onEdit}
style={styles.editButton}>
<Text style={styles.editButtonText}>Edit</Text>
</Pressable>
) : null}
</View>

{element ? (
Expand Down Expand Up @@ -199,6 +212,15 @@ const styles = StyleSheet.create({
fontWeight: '600',
color: '#111',
},
editButton: {
marginLeft: 12,
paddingHorizontal: 4,
},
editButtonText: {
fontSize: 16,
color: '#0a7ea4',
fontWeight: '600',
},
scrollContent: {
padding: 16,
},
Expand Down
Loading
Loading