Made note input and note body preview bigger

This commit is contained in:
keannu125 2023-03-03 23:46:07 +08:00
parent 2e6c5fbef8
commit d73da74004
3 changed files with 17 additions and 9 deletions

View file

@ -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

View file

@ -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({
try {
await mutation.mutate({
title: note.title,
content: note.content,
});
navigate("/");
} catch (error) {}
}}
>
Add Note

View file

@ -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",
},