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}>Owner: {props.owner}</p>
|
||||||
<p style={styles.text_medium}>Title: {props.title}</p>
|
<p style={styles.text_medium}>Title: {props.title}</p>
|
||||||
<div style={styles.note_content}>
|
<div style={styles.note_content}>
|
||||||
<p style={styles.text_small}>{props.content}</p>
|
<textarea
|
||||||
|
style={styles.input_notebody}
|
||||||
|
disabled={true}
|
||||||
|
value={props.content}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<p style={styles.text_medium}>Timestamp: {props.date_created}</p>
|
<p style={styles.text_medium}>Timestamp: {props.date_created}</p>
|
||||||
<Button
|
<Button
|
||||||
|
|
|
@ -42,8 +42,8 @@ export default function NewNote() {
|
||||||
<div style={styles.note_content}>
|
<div style={styles.note_content}>
|
||||||
<textarea
|
<textarea
|
||||||
style={styles.input_notebody}
|
style={styles.input_notebody}
|
||||||
onChange={(e: { target: { value: any } }) => {
|
onChange={async (e: { target: { value: any } }) => {
|
||||||
setNote({ ...note, content: e.target.value });
|
await setNote({ ...note, content: e.target.value });
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -51,11 +51,13 @@ export default function NewNote() {
|
||||||
style={styles.button_green}
|
style={styles.button_green}
|
||||||
variant="contained"
|
variant="contained"
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
mutation.mutate({
|
try {
|
||||||
title: note.title,
|
await mutation.mutate({
|
||||||
content: note.content,
|
title: note.title,
|
||||||
});
|
content: note.content,
|
||||||
navigate("/");
|
});
|
||||||
|
navigate("/");
|
||||||
|
} catch (error) {}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Add Note
|
Add Note
|
||||||
|
|
|
@ -47,6 +47,7 @@ const styles: { [key: string]: React.CSSProperties } = {
|
||||||
},
|
},
|
||||||
note_content: {
|
note_content: {
|
||||||
display: "flex",
|
display: "flex",
|
||||||
|
flexWrap: "wrap",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
|
@ -80,7 +81,8 @@ const styles: { [key: string]: React.CSSProperties } = {
|
||||||
height: "100%",
|
height: "100%",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
minWidth: "100%",
|
minWidth: "100%",
|
||||||
maxHeight: "200px",
|
minHeight: "512px",
|
||||||
|
|
||||||
fontSize: "2vh",
|
fontSize: "2vh",
|
||||||
fontWeight: "bold",
|
fontWeight: "bold",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue