mirror of
https://github.com/lemeow125/React-NotesApp.git
synced 2024-11-16 22:19:27 +08:00
Made note input and note body preview bigger
This commit is contained in:
parent
2e6c5fbef8
commit
d73da74004
3 changed files with 17 additions and 9 deletions
|
@ -19,7 +19,11 @@ export default function Note(props: NoteProps) {
|
|||
<p style={styles.text_medium}>Owner: {props.owner}</p>
|
||||
<p style={styles.text_medium}>Title: {props.title}</p>
|
||||
<div style={styles.note_content}>
|
||||
<p style={styles.text_small}>{props.content}</p>
|
||||
<textarea
|
||||
style={styles.input_notebody}
|
||||
disabled={true}
|
||||
value={props.content}
|
||||
/>
|
||||
</div>
|
||||
<p style={styles.text_medium}>Timestamp: {props.date_created}</p>
|
||||
<Button
|
||||
|
|
|
@ -42,8 +42,8 @@ export default function NewNote() {
|
|||
<div style={styles.note_content}>
|
||||
<textarea
|
||||
style={styles.input_notebody}
|
||||
onChange={(e: { target: { value: any } }) => {
|
||||
setNote({ ...note, content: e.target.value });
|
||||
onChange={async (e: { target: { value: any } }) => {
|
||||
await setNote({ ...note, content: e.target.value });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
@ -51,11 +51,13 @@ export default function NewNote() {
|
|||
style={styles.button_green}
|
||||
variant="contained"
|
||||
onClick={async () => {
|
||||
mutation.mutate({
|
||||
title: note.title,
|
||||
content: note.content,
|
||||
});
|
||||
navigate("/");
|
||||
try {
|
||||
await mutation.mutate({
|
||||
title: note.title,
|
||||
content: note.content,
|
||||
});
|
||||
navigate("/");
|
||||
} catch (error) {}
|
||||
}}
|
||||
>
|
||||
Add Note
|
||||
|
|
|
@ -47,6 +47,7 @@ const styles: { [key: string]: React.CSSProperties } = {
|
|||
},
|
||||
note_content: {
|
||||
display: "flex",
|
||||
flexWrap: "wrap",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
|
@ -80,7 +81,8 @@ const styles: { [key: string]: React.CSSProperties } = {
|
|||
height: "100%",
|
||||
width: "100%",
|
||||
minWidth: "100%",
|
||||
maxHeight: "200px",
|
||||
minHeight: "512px",
|
||||
|
||||
fontSize: "2vh",
|
||||
fontWeight: "bold",
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue