Skip to content

Commit

Permalink
Add back note check
Browse files Browse the repository at this point in the history
  • Loading branch information
Eprince-hub committed Nov 4, 2024
1 parent 083f7f9 commit 70a5ee4
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions app/notes/[noteId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,25 @@ export default function Note() {
);
}

if (!note) {
return (
<View style={styles.container}>
<Text style={styles.title}>Access Denied</Text>
<Text style={styles.textContent}>
You do not have permission to access this note
</Text>
<Link href="/(tabs)/notes" style={{ color: colors.text }}>
Back to notes
</Link>
</View>
);
}

return (
<View style={styles.container}>
<View style={styles.textContainer}>
<Text style={styles.title}>{note?.title}</Text>
<Text style={styles.textContent}>{note?.textContent}</Text>
<Text style={styles.title}>{note.title}</Text>
<Text style={styles.textContent}>{note.textContent}</Text>
</View>
</View>
);
Expand Down

0 comments on commit 70a5ee4

Please sign in to comment.