diff --git a/package.json b/package.json index a17a57b..9674aae 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "my-app", "version": "0.1.0", "private": true, - "homepage": ".", + "homepage": "/~alpt22/editor", "dependencies": { "@testing-library/user-event": "^13.5.0", "@types/jest": "^27.5.2", diff --git a/public/arches.png b/public/arches.png new file mode 100644 index 0000000..c85fdf8 Binary files /dev/null and b/public/arches.png differ diff --git a/public/manifest.json b/public/manifest.json index 080d6c7..0d73090 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -18,7 +18,7 @@ "sizes": "512x512" } ], - "start_url": ".", + "start_url": "/~alpt22/editor", "display": "standalone", "theme_color": "#000000", "background_color": "#ffffff" diff --git a/src/App.css b/src/App.css index 1ff8974..6f14890 100644 --- a/src/App.css +++ b/src/App.css @@ -22,11 +22,13 @@ ul { list-style: none; margin: 0 auto; - max-width: 600px; + max-width: 80%; } li { - max-width: 600px; + border-bottom: 1px solid #c2c4c9; + padding: 1rem; + max-width: 100%; text-align: left; margin-bottom: 20px; } @@ -35,13 +37,15 @@ li a { font-size: 1.6rem; } +.doc-content-div { + padding-top: 2rem; +} + label { margin-right: 5px; font-size: 1.6rem; } - - .ql-editor { min-height: 200px; } @@ -69,3 +73,9 @@ label { transform: rotate(360deg); } } + +.docs { + padding: 2rem; + border-radius: 15px; + background-color: rgb(236, 229, 216); +} diff --git a/src/App.jsx b/src/App.jsx index dfb0573..8945ac6 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -18,7 +18,7 @@ import './App.css'; export default function App() { return ( - +
diff --git a/src/all-documents.jsx b/src/all-documents.jsx index 6ffa219..88bcb1f 100644 --- a/src/all-documents.jsx +++ b/src/all-documents.jsx @@ -6,6 +6,7 @@ import { getAll } from "./models/fetch"; //Components import DocContent from "./doc-content"; +import { Link } from "react-router-dom"; export default function AllDocuments() { const [docs, setDocs] = useState([]); @@ -26,12 +27,12 @@ export default function AllDocuments() { const docItems = docs.map(doc =>
  • - {doc.title} + {doc.title}
  • ); - return
      {docItems}
    ; + return
      {docItems}
    ; } catch (error) { console.error("An error occurred.", error); return ( diff --git a/src/doc.css b/src/doc.css new file mode 100644 index 0000000..6dee917 --- /dev/null +++ b/src/doc.css @@ -0,0 +1,18 @@ +form { + padding: 2rem; + border-radius: 15px; + background-color: rgb(236, 229, 216); + margin: 1rem 2rem; + label { + font-size: 1rem; + } +} + +.ql-editor { + background-color: #fff; +} + +#title { + font-size: 1rem; +} + diff --git a/src/forms/new-form.jsx b/src/forms/new-form.jsx index 20f0d5a..16559ae 100644 --- a/src/forms/new-form.jsx +++ b/src/forms/new-form.jsx @@ -17,6 +17,7 @@ export function NewForm() { } = useForm(); const onSubmit = async (data) => { + data.content = value; console.log("Data: ", data); const response = await addOne(data); @@ -30,7 +31,20 @@ export function NewForm() {
    {/* register your input into the hook by invoking the "register" function */} - + { + e.currentTarget.setCustomValidity("A document title is required"); + }} + onChange={e => { + e.currentTarget.setCustomValidity(""); + }} + /> {/* include validation with required or other standard HTML validation rules */} diff --git a/src/header.css b/src/header.css new file mode 100644 index 0000000..0b5e03b --- /dev/null +++ b/src/header.css @@ -0,0 +1,23 @@ +.top { + display: flex; + gap: 10px; + row-gap: 10px; + column-gap: 10px; + justify-content: space-between; + margin-left: 3rem; + margin-right: 4rem; + img { + margin: 1rem; + border-radius: 15px; + } +} + +.nav { + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-end; + a { + text-decoration: none; + } +} diff --git a/src/header.jsx b/src/header.jsx index efe6d50..b865ea9 100644 --- a/src/header.jsx +++ b/src/header.jsx @@ -1,10 +1,16 @@ +import { Link } from "react-router-dom"; +import "./header.css"; + function Header() { return (
    { -
    -

    Home

    -

    New

    +
    + +
    +

    Home

    +

    New

    +
    }
    diff --git a/src/index.css b/src/index.css index ec2585e..a3d854a 100644 --- a/src/index.css +++ b/src/index.css @@ -5,6 +5,8 @@ body { sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; + background-color: #009fe8; + background-image: url("../public/arches.png"); } code { diff --git a/src/new-doc.jsx b/src/new-doc.jsx index 39248a4..2f0ef6f 100644 --- a/src/new-doc.jsx +++ b/src/new-doc.jsx @@ -1,3 +1,4 @@ +import "./doc.css"; import { NewForm } from './forms/new-form.jsx'; export default function NewDoc() { diff --git a/src/update-doc.jsx b/src/update-doc.jsx index 3e25be2..8f46105 100644 --- a/src/update-doc.jsx +++ b/src/update-doc.jsx @@ -1,3 +1,4 @@ +import "./doc.css"; import { UpdateForm } from './forms/update-form.jsx'; export default function UpdateDoc() {