Skip to content

Commit

Permalink
prettier fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wenhwang97 committed May 8, 2024
1 parent 7c3830f commit f30172a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 11 deletions.
22 changes: 18 additions & 4 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ const Navbar = () => {

useEffect(() => {
const closeDropdown = (e: MouseEvent) => {
if (open && !document.querySelector("#navbar-dropdown")?.contains(e.target as Node)) setOpen(false);
if (
open &&
!document.querySelector("#navbar-dropdown")?.contains(e.target as Node)
)
setOpen(false);
};

document.addEventListener("mousedown", closeDropdown);
Expand All @@ -42,7 +46,12 @@ const Navbar = () => {
<div className="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4">
<Link to="/">
{/* <h1 className="font-bold text-4xl dark:text-gray-800">CYCM</h1> */}
<img src="/cycm-logo.svg" alt="CYCM" className="h-12 w-auto px-4 py-2" loading="lazy" />
<img
src="/cycm-logo.svg"
alt="CYCM"
className="h-12 w-auto px-4 py-2"
loading="lazy"
/>
</Link>
<button
data-collapse-toggle="navbar-dropdown"
Expand Down Expand Up @@ -79,13 +88,18 @@ const Navbar = () => {
)}
</svg>
</button>
<div className={`w-full md:block md:w-auto ${!mobileOpen && "hidden"}`} id="navbar-dropdown">
<div
className={`w-full md:block md:w-auto ${!mobileOpen && "hidden"}`}
id="navbar-dropdown"
>
<ul
className="flex flex-col font-medium mt-4 md:items-center md:p-0 md:flex-row md:space-x-8 md:mt-0 md:border-0 md:bg-white"
style={{ listStyle: "none", margin: 0, padding: 0 }}
>
{navigation.map((item) => {
const color = location.pathname.includes(item.href) ? "bg-orange-400" : "bg-orange-600";
const color = location.pathname.includes(item.href)
? "bg-orange-400"
: "bg-orange-600";

return (
<li key={item.name}>
Expand Down
30 changes: 23 additions & 7 deletions src/pages/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,17 @@ const Post: React.FC = () => {
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<path d="M6 13L10 3" stroke="currentColor" strokeLinecap="round"></path>
<path
d="M6 13L10 3"
stroke="currentColor"
strokeLinecap="round"
></path>
</svg>
</li>
<li className="inline-flex items-center text-sm font-semibold text-gray-800 truncate" aria-current="page">
<li
className="inline-flex items-center text-sm font-semibold text-gray-800 truncate"
aria-current="page"
>
Article
</li>
</ol>
Expand All @@ -76,13 +83,17 @@ const Post: React.FC = () => {
{/* <p>{article?.description}</p> */}
{/* place holder text */}
<p className="text-md tracking-wider text-[#101066]">
Explore our collection of informative mental health resources designed to help teens navigate their
emotional well-being and find support.
Explore our collection of informative mental health resources
designed to help teens navigate their emotional well-being and
find support.
</p>
{/* <span>{article?.attributes.author}</span> */}
<div className="flex text-md tracking-wider align-middle text-[#101066]">
<div className="flex pr-4 gap-3">
<TwitterShareButton url={window.location.href} title={article?.attributes.title}>
<TwitterShareButton
url={window.location.href}
title={article?.attributes.title}
>
<svg
xmlns="http://www.w3.org/2000/svg"
x="0px"
Expand All @@ -95,7 +106,10 @@ const Post: React.FC = () => {
<path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z"></path>
</svg>
</TwitterShareButton>
<FacebookShareButton url={window.location.href} title={article?.attributes.title}>
<FacebookShareButton
url={window.location.href}
title={article?.attributes.title}
>
<svg
xmlns="http://www.w3.org/2000/svg"
x="0px"
Expand All @@ -112,7 +126,9 @@ const Post: React.FC = () => {
<div>{article?.attributes.author ?? "CYCM Team"}</div>
<div className="px-2">&#183;</div>
<div>
{new Date(article?.attributes.published_date).toLocaleDateString("en-US", {
{new Date(
article?.attributes.published_date
).toLocaleDateString("en-US", {
year: "numeric",
month: "long",
day: "numeric",
Expand Down

0 comments on commit f30172a

Please sign in to comment.