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

View file

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

View file

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