feat(mobile): polish note detail loading state
This commit is contained in:
parent
02dea5cd80
commit
cb02b85237
@ -8,6 +8,7 @@ export default function NoteDetailScreen() {
|
||||
const params = useLocalSearchParams<{ id: string }>();
|
||||
const noteId = params.id ?? 'unknown';
|
||||
const selectedNote = useNotesStore((state: NotesState) => state.selectedNote);
|
||||
const isLoading = useNotesStore((state: NotesState) => state.isLoading);
|
||||
const openNote = useNotesStore((state: NotesState) => state.openNote);
|
||||
const updateNote = useNotesStore((state: NotesState) => state.updateNote);
|
||||
const [isEditing, setIsEditing] = useState(false);
|
||||
@ -33,6 +34,7 @@ export default function NoteDetailScreen() {
|
||||
|
||||
<View style={styles.card}>
|
||||
<Text style={styles.sectionTitle}>Summary</Text>
|
||||
{isLoading ? <Text style={styles.body}>Loading note…</Text> : null}
|
||||
{isEditing ? (
|
||||
<>
|
||||
<TextInput
|
||||
@ -73,7 +75,7 @@ export default function NoteDetailScreen() {
|
||||
</Pressable>
|
||||
</View>
|
||||
</>
|
||||
) : (
|
||||
) : !isLoading ? (
|
||||
<>
|
||||
<Text style={styles.body}>
|
||||
{selectedNote?.body ??
|
||||
@ -83,7 +85,7 @@ export default function NoteDetailScreen() {
|
||||
<Text style={styles.primaryButtonText}>Edit note</Text>
|
||||
</Pressable>
|
||||
</>
|
||||
)}
|
||||
) : null}
|
||||
</View>
|
||||
|
||||
<View style={styles.card}>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user