diff options
| author | realtradam <[email protected]> | 2024-07-27 23:55:51 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2024-07-27 23:55:51 -0400 |
| commit | c24839e8f8b4b6868f8ee383b589ce01dcdc81e1 (patch) | |
| tree | b8678e31f75ad441affc8c89aea0e349337a9c8a | |
| parent | 55ec4c9dbd9fa1b98cab03f046c98d33125fb484 (diff) | |
| download | spring-blog-c24839e8f8b4b6868f8ee383b589ce01dcdc81e1.tar.gz spring-blog-c24839e8f8b4b6868f8ee383b589ce01dcdc81e1.zip | |
cleanup frontend
| -rw-r--r-- | frontend/src/components/Layout.tsx | 6 | ||||
| -rw-r--r-- | frontend/src/pages/Home.tsx | 70 | ||||
| -rw-r--r-- | frontend/src/pages/articles/Edit.tsx | 9 | ||||
| -rw-r--r-- | frontend/src/pages/articles/New.tsx | 11 | ||||
| -rw-r--r-- | frontend/src/pages/auth/Login.tsx | 2 | ||||
| -rw-r--r-- | frontend/src/pages/auth/Register.tsx | 12 |
6 files changed, 10 insertions, 100 deletions
diff --git a/frontend/src/components/Layout.tsx b/frontend/src/components/Layout.tsx index d8613d5..9a7576e 100644 --- a/frontend/src/components/Layout.tsx +++ b/frontend/src/components/Layout.tsx @@ -61,12 +61,14 @@ export default function Layout({ <nav className="bg-gray-900 p-4 mt-0 w-full"> <div className="container mx-auto flex items-center"> <div className="flex text-white font-extrabold"> - {/*th:if="${(user == null || user.username == null)}"*/} <a className="flex text-white text-base no-underline whitespace-nowrap hover:text-white hover:no-underline" href="#" > - ☕ {user.value === null ? "Spring!" : user.value} + ☕{" "} + {user.value === null + ? "Spring!" + : `Logged in as: ${user.value}`} <span className="hidden w-0 md:w-auto md:block pl-1"></span> </a> </div> diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx index df9b4c1..2ec0ecd 100644 --- a/frontend/src/pages/Home.tsx +++ b/frontend/src/pages/Home.tsx @@ -26,7 +26,7 @@ export default function Home({ const [allArticles, setAllArticles] = useState<JSX.Element[]>([]); const handleDelete = async (e: FormEvent<HTMLFormElement>) => { - e.preventDefault(); //stops submit from happening + e.preventDefault(); const target = e.target as typeof e.target & { id: { value: string }; @@ -108,7 +108,7 @@ export default function Home({ > <img src={article.photoUrl} - className="h-full w-full rounded-t pb-6" + className="h-full w-full rounded-t pb-6 max-h-72 object-cover" /> <div className="w-full font-bold text-xl text-gray-900 px-6"> {article.title} @@ -135,71 +135,9 @@ export default function Home({ {/*<!--Nav-->*/} <nav className="mt-0 w-full"> <div className="container mx-auto flex items-center"> - <div className="flex w-1/2 pl-4 text-sm"> - <ul className="list-reset flex justify-between flex-1 md:flex-none items-center"> - <li className="mr-2"> - <a - className="inline-block py-2 px-2 text-white no-underline hover:underline" - href="post.html" - > - POST - </a> - </li> - <li className="mr-2"> - <a - className="inline-block text-gray-600 no-underline hover:text-gray-200 hover:underline py-2 px-2" - href="multimenu post.html" - > - MULTIMENU POST - </a> - </li> - <li className="mr-2"> - <a - className="inline-block text-gray-600 no-underline hover:text-gray-200 hover:underline py-2 px-2" - href="#" - > - LINK - </a> - </li> - <li className="mr-2"> - <a - className="inline-block text-gray-600 no-underline hover:text-gray-200 hover:underline py-2 px-2" - href="post_vue.html" - > - POST_VUE - </a> - </li> - </ul> - </div> + <div className="flex w-1/2 pl-4 text-sm"></div> - <div className="flex w-1/2 justify-end content-center"> - <a - className="inline-block text-gray-500 no-underline hover:text-white hover:text-underline text-center h-10 p-2 md:h-auto md:p-4 avatar" - data-tippy-content="@twitter_handle" - href="https://twitter.com/intent/tweet?url=#" - > - <svg - className="fill-current h-4" - xmlns="http://www.w3.org/2000/svg" - viewBox="0 0 32 32" - > - <path d="M30.063 7.313c-.813 1.125-1.75 2.125-2.875 2.938v.75c0 1.563-.188 3.125-.688 4.625a15.088 15.088 0 0 1-2.063 4.438c-.875 1.438-2 2.688-3.25 3.813a15.015 15.015 0 0 1-4.625 2.563c-1.813.688-3.75 1-5.75 1-3.25 0-6.188-.875-8.875-2.625.438.063.875.125 1.375.125 2.688 0 5.063-.875 7.188-2.5-1.25 0-2.375-.375-3.375-1.125s-1.688-1.688-2.063-2.875c.438.063.813.125 1.125.125.5 0 1-.063 1.5-.25-1.313-.25-2.438-.938-3.313-1.938a5.673 5.673 0 0 1-1.313-3.688v-.063c.813.438 1.688.688 2.625.688a5.228 5.228 0 0 1-1.875-2c-.5-.875-.688-1.813-.688-2.75 0-1.063.25-2.063.75-2.938 1.438 1.75 3.188 3.188 5.25 4.25s4.313 1.688 6.688 1.813a5.579 5.579 0 0 1 1.5-5.438c1.125-1.125 2.5-1.688 4.125-1.688s3.063.625 4.188 1.813a11.48 11.48 0 0 0 3.688-1.375c-.438 1.375-1.313 2.438-2.563 3.188 1.125-.125 2.188-.438 3.313-.875z"></path> - </svg> - </a> - <a - className="inline-block text-gray-500 no-underline hover:text-white hover:text-underline text-center h-10 p-2 md:h-auto md:p-4 avatar" - data-tippy-content="#facebook_id" - href="https://www.facebook.com/sharer/sharer.php?u=#" - > - <svg - className="fill-current h-4" - xmlns="http://www.w3.org/2000/svg" - viewBox="0 0 32 32" - > - <path d="M19 6h5V0h-5c-3.86 0-7 3.14-7 7v3H8v6h4v16h6V16h5l1-6h-6V7c0-.542.458-1 1-1z"></path> - </svg> - </a> - </div> + <div className="flex w-1/2 my-8 justify-end content-center"></div> </div> </nav> diff --git a/frontend/src/pages/articles/Edit.tsx b/frontend/src/pages/articles/Edit.tsx index 4d8e2d8..4c832c1 100644 --- a/frontend/src/pages/articles/Edit.tsx +++ b/frontend/src/pages/articles/Edit.tsx @@ -87,9 +87,6 @@ export default function EditArticle() { onChange={handleChange} placeholder="Yep" /> - <p className="text-red-500 text-xs italic"> - Please fill out this field. - </p> </div> <div className="w-full md:w-1/2 px-3"> <label className="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2"> @@ -104,9 +101,6 @@ export default function EditArticle() { onChange={handleChange} placeholder="Doe" /> - <p className="text-red-500 text-xs italic"> - Please fill out this field. - </p> </div> </div> <div className="flex flex-wrap -mx-3 mb-6"> @@ -123,9 +117,6 @@ export default function EditArticle() { onChange={handleChange} placeholder="Doe" /> - <p className="text-red-500 text-xs italic"> - Please fill out this field. - </p> </div> </div> <div className="flex flex-wrap mb-2"></div> diff --git a/frontend/src/pages/articles/New.tsx b/frontend/src/pages/articles/New.tsx index f98c19a..ec904f5 100644 --- a/frontend/src/pages/articles/New.tsx +++ b/frontend/src/pages/articles/New.tsx @@ -43,15 +43,12 @@ export default function NewArticle() { Title </label> <input - className="appearance-none block w-full bg-gray-200 text-gray-700 border border-red-500 rounded py-3 px-4 mb-3 leading-tight focus:outline-none focus:bg-white" + className="appearance-none block w-full bg-gray-200 text-gray-700 rounded py-3 px-4 mb-3 leading-tight focus:outline-none focus:bg-white" id="title" type="text" name="title" placeholder="Yep" /> - <p className="text-red-500 text-xs italic"> - Please fill out this field. - </p> </div> <div className="w-full md:w-1/2 px-3"> <label className="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2"> @@ -64,9 +61,6 @@ export default function NewArticle() { name="photoUrl" placeholder="Doe" /> - <p className="text-red-500 text-xs italic"> - Please fill out this field. - </p> </div> </div> <div className="flex flex-wrap -mx-3 mb-6"> @@ -81,9 +75,6 @@ export default function NewArticle() { name="content" placeholder="Doe" /> - <p className="text-red-500 text-xs italic"> - Please fill out this field. - </p> </div> </div> <div className="flex flex-wrap mb-2"></div> diff --git a/frontend/src/pages/auth/Login.tsx b/frontend/src/pages/auth/Login.tsx index 33529a8..5815adb 100644 --- a/frontend/src/pages/auth/Login.tsx +++ b/frontend/src/pages/auth/Login.tsx @@ -65,7 +65,7 @@ export default function Login({ user }: { user: user }) { <div className="flex flex-wrap -mx-3 mb-6"> <div className="w-full md:w-1/2 px-3 mb-6 md:mb-0"> <label className="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2"> - Title + Username </label> <input className="appearance-none block w-full bg-gray-200 text-gray-700 border rounded py-3 px-4 mb-3 leading-tight focus:outline-none focus:bg-white" diff --git a/frontend/src/pages/auth/Register.tsx b/frontend/src/pages/auth/Register.tsx index cf1972a..b81f22c 100644 --- a/frontend/src/pages/auth/Register.tsx +++ b/frontend/src/pages/auth/Register.tsx @@ -36,9 +36,6 @@ export default function Register() { return ( <> <div className="flex flex-col items-center justify-center bg-white p-12"> - <div className="text-xl w-full text-center mb-8 p-4 bg-black text-red-500"> - Username or Email already exists - </div> <form onSubmit={handleSubmit} method="post" className="w-full max-w-lg"> <div className="flex flex-wrap -mx-3 mb-6"> <div className="w-full md:w-1/2 px-3 mb-6 md:mb-0"> @@ -52,9 +49,6 @@ export default function Register() { name="username" placeholder="Ted" /> - <p className="text-red-500 text-xs italic"> - Please fill out this field. - </p> </div> <div className="w-full md:w-1/2 px-3"> <label className="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2"> @@ -67,9 +61,6 @@ export default function Register() { name="email" placeholder="[email protected]" /> - <p className="text-red-500 text-xs italic"> - Please fill out this field. - </p> </div> </div> <div className="flex flex-wrap -mx-3 mb-6"> @@ -84,9 +75,6 @@ export default function Register() { name="password" placeholder="Doe" /> - <p className="text-red-500 text-xs italic"> - Please fill out this field. - </p> </div> </div> <div className="flex flex-wrap mb-2"></div> |
