-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Observation & Track Detail view #52
Labels
Comments
ximenabb
changed the title
Obvservation & Track Detail view
Observation & Track Detail view
Dec 4, 2024
3 tasks
Proposed architecture: export function Observation() {
const {observation, preset, attachments} = useObservationWithPresetAndAttachments()
const {data:fields} = useSingleDocByDocId({projectId, docType: 'field', docId: preset.fields})
// Any component with `Styled` in the name refers to a styledcomponent with no internal logic or state (aka styled wrappers)
return (
<StyledContainer>
<StyledHeader>header text</StyledHeader>
<Text>{formattedDate(observation.createdAt)}</Text>
<StylePresetAndLocationWrapper>
<StylePreset>
{preset.iconRef.docId ? <PresetImage iconId={preset.iconRef.docId} projectId={projectId}/> :
<DefaultIconImage />
{preset.name}
</StylePreset>
{observation.lat + observation.lon}
</StylePresetAndLocationWrapper>
<Text>Notes</Text>
{observation.tags.notes && <Text>{observation.tags.notes}</Text>}
<StyledGrid>
{/* Ignore on press for now */}
{attachments.map((attachment) => {
if (isPhoto(attachment)) {
return (<SavedPhoto projectId={projectId} blobId={attachment.blobId} />)
}
if (isAudio(attachment)) {
return (
<StyledPressable onPress={onPress}>
<AudioPlayImage />
</StyledPressable>
)
}
})}
</StyledGrid>
<Text>Details</Text>
<Text>Observed by</Text>
<Text>{authorName}</Text>
{fields.length > 0 &&
fields.map((field) => {
return {Fields details need to be fleshed out here}
})}
</StyledContainer>
)
}
const SavedPhoto = ({projectId, blobId, onPress}) => {
const{data:url} = useAttachmentUrl({projectId, blobId}) // form @comapeo-core/react
return (
// Same styled StyledPressable as above
<StyledPressable disabled={!!isLoading} onPress={onPress}>
{isLoading ?
(<LoadingIndicator/>) :
(<Image uri={uri} />)
}
</StyledPressable>
)
}
const PresetImage ={... similar to SavedPhoto, but uses useIconUrl} Main points:
To Do
|
The track screen should follow suite. The reusable components should be the smaller Styled wrapper components. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
User has joined a project with observations and/or tracks, or a user created a project and imported observations.
Observation Detail View
Design Notes:
Both View Observation and View Track are exactly as they are on Mobile with the exception is that the map preview is now displayed on the map pane to the right.
Track Detail View
Figma
https://www.figma.com/design/UIA00RSP8Sz24V0vXvQHeL/(Desktop)-CoMapeo?node-id=447-444&node-type=section&t=wrAswGbGPcuFsB0Y-0
The text was updated successfully, but these errors were encountered: