Compare commits

..

No commits in common. "6fc4988506d20eae89dc4a72cf1c6f3302ef8910" and "cab69a41e930d4e09b7281e0c173f5d94f4d360f" have entirely different histories.

13 changed files with 177 additions and 204 deletions

View File

@ -3908,8 +3908,8 @@ a.logo:hover {
display: none;
}
.social-nav:hover {
color: #00abad;
.body-scrolled .social-nav {
color: var(--color-dark-3);
}
/* Menu sub */

View File

@ -33,7 +33,9 @@ export default function MainLayout({
<body className="appear-animate body">
<div className="theme-slick">
<div className="page" id="top">
<nav className="main-nav dark transparent stick-fixed wow-menubar wch-unset">
<Header links={navMenuData} />
</nav>
<main id="main">{children}</main>
<Footer />
</div>

View File

@ -1,16 +1,10 @@
import formatSlug from "@/utils/payload/formatSlug";
import setAuthor from "@/utils/payload/setAuthor";
import { lexicalEditor } from "@payloadcms/richtext-lexical";
import type { CollectionConfig } from "payload";
export const Blogs: CollectionConfig = {
slug: "blogs",
labels: { plural: "Posts", singular: "Post" },
versions: {
drafts: {
validate: true,
},
},
fields: [
{
name: "title",
@ -71,27 +65,32 @@ export const Blogs: CollectionConfig = {
},
],
},
{
name: "is_published",
label: "Published",
type: "checkbox",
defaultValue: true,
admin: {
position: "sidebar",
},
},
{
name: "createdBy",
type: "relationship",
relationTo: "users",
hooks: {
beforeChange: [setAuthor],
},
admin: {
hidden: true,
},
// hooks: {
// beforeChange: [setAuthor],
// },
},
{
name: "updatedBy",
type: "relationship",
relationTo: "users",
hooks: {
beforeChange: [setAuthor],
},
admin: {
hidden: true,
},
// hooks: {
// beforeChange: [setAuthor],
// },
},
],
admin: {

View File

@ -8,16 +8,10 @@ import { HorizontalImageContentBlock } from "@/blocks/HorizontalImageContent";
import { ImageSliderBlock } from "@/blocks/ImageSlider";
import { OurTeamBlock } from "@/blocks/OurTeam";
import formatSlug from "@/utils/payload/formatSlug";
import setAuthor from "@/utils/payload/setAuthor";
import { CollectionConfig } from "payload";
export const Pages: CollectionConfig = {
slug: "pages",
versions: {
drafts: {
validate: true,
},
},
fields: [
{
name: "title",
@ -35,6 +29,9 @@ export const Pages: CollectionConfig = {
name: "slug",
label: "Page Slug",
type: "text",
admin: {
position: "sidebar",
},
hooks: {
beforeValidate: [formatSlug("title")],
},
@ -78,28 +75,6 @@ export const Pages: CollectionConfig = {
},
],
},
{
name: "createdBy",
type: "relationship",
relationTo: "users",
hooks: {
beforeChange: [setAuthor],
},
admin: {
hidden: true,
},
},
{
name: "updatedBy",
type: "relationship",
relationTo: "users",
hooks: {
beforeChange: [setAuthor],
},
admin: {
hidden: true,
},
},
],
admin: {
hideAPIURL: true,

View File

@ -15,12 +15,24 @@ export default async function Blog() {
<div className="row mb-60 mb-sm-40">
<div className="col-lg-8 offset-lg-2 text-center mb-md-30">
<h2 className="section-caption-slick mb-30 mb-sm-20">Our Blog</h2>
<h3 className="section-title-large mb-30">Knowledge and Support for Your Cancer Journey</h3>
<p className="mb-0">
Cancer treatment involves a team of specialists providing personalized, comprehensive care. Staying
informed and engaged empowers you to choose the best approach. Remember, youre not alone in this journey.
<h3 className="section-title mb-30">Check the latest news about our company in our blog.</h3>
<p className="section-descr mb-0">
There are three kinds of web developer specialization front-end developer, back-end developer, and
full-stack developer.
</p>
</div>
<div className="col-lg-2 d-flex align-items-end">
<div className="local-scroll text-center text-lg-end w-100">
<Link href={`/slick-blog-dark`} className="link-hover-anim" data-link-animate="y">
<span className="link-strong link-strong-unhovered">
Our blog <i className="mi-arrow-right size-24" aria-hidden="true"></i>
</span>
<span className="link-strong link-strong-hovered" aria-hidden="true">
Our blog <i className="mi-arrow-right size-24" aria-hidden="true"></i>
</span>
</Link>
</div>
</div>
</div>
{/* Blog Posts Grid */}
<div className="row mt-n30">

View File

@ -4,7 +4,6 @@ import { RichText } from "@payloadcms/richtext-lexical/react";
import { headers } from "next/headers";
import Image from "next/image";
import { notFound } from "next/navigation";
import Blog from "./Blog";
export interface BlogDetailProps {
slug: string | undefined;
@ -49,14 +48,10 @@ export default async function BlogDetail({ slug }: BlogDetailProps) {
{/* End Post */}
</div>
{/* End Content */}
<hr style={{ width: "100%", border: "1px solid #aaa" }} />
</div>
</div>
</section>
{/* End Section */}
<div className="mb-5">
<Blog />
</div>
</>
);
}

View File

@ -5,30 +5,15 @@ import { navMenuData } from "@/data/menu";
import { toggleMobileMenu } from "@/utils/toggleMobileMenu";
import Image from "next/image";
import Link from "next/link";
import { FaFacebook, FaLinkedin, FaPhone } from "react-icons/fa";
import { FaFacebook, FaLinkedin, FaTwitter } from "react-icons/fa";
const shareIcons: Record<string, any> = {
phone: {
link: "tel:+15208036644",
dom: (
<span className="social-nav flex gap-3 text-2xl lg:text-[#00898b]">
<FaPhone />
<b className="text-sm">(520) 803-6644</b>
</span>
),
},
facebook: {
link: "https://www.facebook.com/p/Cochise-Oncology-61556262839823",
dom: <FaFacebook className="social-nav text-2xl lg:text-[#00898b]" />,
},
linkedin: {
link: "https://linkedin.com/company/cochise-oncology",
dom: <FaLinkedin className="social-nav text-2xl lg:text-[#00898b]" />,
},
facebook: <FaFacebook className="social-nav text-2xl lg:text-gray-300" />,
linkedin: <FaLinkedin className="social-nav text-2xl lg:text-gray-300" />,
twitter: <FaTwitter className="social-nav text-2xl lg:text-gray-300" />,
};
export default function Header({ links }: { links: typeof navMenuData }) {
return (
<nav className="main-nav dark stick-fixed wow-menubar wch-unset relative">
<div className="main-nav-sub full-wrapper">
{/* Logo (* Add your text or image to the link tag. Use SVG or PNG image format.
If you use a PNG logo image, the image resolution must be equal 200% of the visible logo
@ -64,20 +49,22 @@ export default function Header({ links }: { links: typeof navMenuData }) {
{/* End Item With Sub */}
</ul>
<ul className="items-end clearlist">
{Object.keys(shareIcons).map((k, idx) => {
return (
<li key={idx} className="!p-0 !m-0">
<a className="cursor-pointer" href={shareIcons[k].link} target="_blank">
{shareIcons[k].dom}
</a>
</li>
);
})}
{/* Languages */}
{/* <LanguageSelect /> */}
{/* End Languages */}
<li></li>
</ul>
</div>
<div className="flex mt-4 gap-3">
{Object.keys(shareIcons).map((k, idx) => {
return (
<a key={idx} className="cursor-pointer" href={"/"} target="_blank">
{shareIcons[k]}
</a>
);
})}
</div>
{/* End Main Menu */}
</div>
</nav>
);
}

View File

@ -56,7 +56,7 @@ export default function HeaderNav({ links, animateY = false }: { links: typeof n
{Array.isArray(link?.child) && (
<>
<Link href={link?.href ?? "#"} className="mn-has-sub flex justify-between">
<Link href={link?.href ?? "#"} className="mn-has-sub">
{link.text} <i className="mi-chevron-down" onClick={() => toggleDropdown([link.text])} />
</Link>
@ -70,8 +70,8 @@ export default function HeaderNav({ links, animateY = false }: { links: typeof n
)}
{Array.isArray(subLink?.child) && (
<>
<Link href={subLink?.href ?? "#"} className="mn-has-sub !flex !justify-between">
<span>{subLink.text}</span>
<Link href={subLink?.href ?? "#"} className="mn-has-sub">
{subLink.text}
<i className="mi-chevron-down" onClick={() => toggleDropdown([link.text, subLink.text])} />
</Link>

View File

@ -57,61 +57,55 @@ export default function homepage({ dark = false }) {
</Link>
</div>
</section>
<section className="py-5 w-full flex flex-col">
<div className="relative flex justify-center">
<div className="w-full md:w-1/2 self-center mt-[-70px] mb-50 flex justify-center">
<div className="bg-white h-full flex flex-col lg:flex-row flex-wrap justify-center p-4 lg:p-8 gap-3 rounded-xl shadow-xl">
<blockquote
className="self-center border-teal-500 pl-4 italic text-gray-800"
style={{ borderLeft: "4px solid #eee" }}
>
I was diagnosed with cancer up in Tucson. The doctor was said to be best oncologist in the state.
<section className="w-full py-10 flex flex-col items-center">
<div className="w-11/12 md:w-3/4 lg:w-2/3 bg-white p-6 md:p-8 rounded-lg shadow-lg">
<p className="italic text-gray-700">
I was diagnosed with cancer up in Tucson. The doctor was said to be best oncologist in the state. Problem
was I needed radiation for 45 days not counting weekends and holidays.
</p>
<p className="italic text-gray-700 mt-4">
I had to tell her that that was not doable. I couldn't commute daily and I couldn't rent. I told her that I
could get treatment of some sort in Sierra Vista. She told me that normally she would fight me, but only 2
Clinics in the state had this latest and greatest radiation hardware. Hers and Cochise Oncology in Sierra
Vista.
</p>
<p className="italic text-gray-700 mt-4">
I had to tell her that that was not doable. I couldn't commute daily and I couldn't rent. I told her that I
could get treatment of some sort in Sierra Vista. She told me that normally she would fight me, but only 2
Clinics in the state had this latest and greatest radiation hardware. Hers and Cochise Oncology in Sierra
Vista.
</p>
<p className="italic text-gray-700 mt-4">Do yourself a favor and see Dr. Vedula.</p>
<p className="font-bold text-indigo-600 mt-4">- a Cochise Oncology patient</p>
<p className="text-sm text-gray-500 text-center mt-4">*Individual Results May Vary</p>
</div>
</section>
<section className="py-5 w-full items-center">
<div className="max-w-7xl mx-auto p-6 text-center">
<h2>Testimonials</h2>
<div className="text-left text-gray-700 space-y-4">
<p className="italic">
I was diagnosed with cancer up in Tucson. The doctor was said to be the best oncologist in the state.
Problem was I needed radiation for 45 days not counting weekends and holidays.
<br />
<br />
I had to tell her that that was not doable. I couldn&apos;t commute daily and I couldn&apos;t rent. I
told her that I could get treatment of some sort in Sierra Vista. She told me that normally she would
fight me, but only 2 Clinics in the state had this latest and greatest radiation hardware. Hers and
Cochise Oncology in Sierra Vista.
<br />
<br />
At Cochise Oncology I was introduced to Dr. Vedula. What a good man and what a great doctor. Check out
his credentials. I am now cancer free for 9 months. It was still 45 days of treatment but no side
effects. Plus, I would go home every day after undergoing treatment. I forget, maybe 15 minutes of
treatment.
<br />
<br />
Do yourself a favor and see Dr. Vedula.
<br></br>
<b>-a Cochise Oncology patient</b>
</blockquote>
</div>
</div>
</div>
<h1 className="w-full text-center !font-light">Testimonials</h1>
<blockquote
className="w-full md:w-8/12 self-center border-teal-500 pl-4 italic text-gray-800"
style={{ borderLeft: "4px solid #eee" }}
>
I was diagnosed with cancer up in Tucson. The doctor was said to be best oncologist in the state. Problem was
I needed radiation for 45 days not counting weekends and holidays.
<br />
<br />
I had to tell her that that was not doable. I couldn&apos;t commute daily and I couldn&apos;t rent. I told her
that I could get treatment of some sort in Sierra Vista. She told me that normally she would fight me, but
only 2 Clinics in the state had this latest and greatest radiation hardware. Hers and Cochise Oncology in
</p>
<p className="italic">
I had to tell her that that was not doable. I couldn't commute daily and I couldn't rent. I told her that
I could get treatment of some sort in Sierra Vista. She told me that normally she would fight me, but only
2 clinics in the state had this latest and greatest radiation hardware. Hers and Cochise Oncology in
Sierra Vista.
<br />
<br />
</p>
<p className="italic">
At Cochise Oncology I was introduced to Dr. Vedula. What a good man and what a great doctor. Check out his
credentials. I am now cancer free for 9 months. It was still 45 days of treatment but no side effects. Plus, I
would go home every day after undergoing treatment. I forget, maybe 15 minutes of treatment.
<br />
<br />
Do yourself a favor and see Dr. Vedula.
<br></br>
<b>-a Cochise Oncology patient</b>
</blockquote>
credentials. I am now cancer free for 9 months. It was still 45 days of treatment but no side effects.
Plus, I would go home every day after undergoing treatment. I forget, maybe 15 minutes of treatment.
</p>
<p>Do yourself a favor and see Dr. Vedula.</p>
<p className="font-bold text-gray-900">- a Cochise Oncology patient</p>
</div>
<p className="text-sm text-gray-500 mt-4">*Individual Results May Vary</p>
</div>
</section>
<section className="py-5 w-full items-center">
<Testimonials />
</section>
<section className="page-section bg-scroll light-content bg-[url(/assets/images/demo-modern/section-bg-3.jpeg)] bg-cover">

View File

@ -146,11 +146,11 @@ export interface Blog {
description?: string | null;
canonical_url?: string | null;
};
is_published?: boolean | null;
createdBy?: (number | null) | User;
updatedBy?: (number | null) | User;
updatedAt: string;
createdAt: string;
_status?: ('draft' | 'published') | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
@ -306,11 +306,8 @@ export interface Page {
description?: string | null;
cannonical_url?: string | null;
};
createdBy?: (number | null) | User;
updatedBy?: (number | null) | User;
updatedAt: string;
createdAt: string;
_status?: ('draft' | 'published') | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
@ -647,11 +644,11 @@ export interface BlogsSelect<T extends boolean = true> {
description?: T;
canonical_url?: T;
};
is_published?: T;
createdBy?: T;
updatedBy?: T;
updatedAt?: T;
createdAt?: T;
_status?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
@ -750,11 +747,8 @@ export interface PagesSelect<T extends boolean = true> {
description?: T;
cannonical_url?: T;
};
createdBy?: T;
updatedBy?: T;
updatedAt?: T;
createdAt?: T;
_status?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema

View File

@ -10,12 +10,25 @@ export async function fetchBlog(page: number | undefined, search: string = "") {
pagination: true,
limit: 6,
where: !search
? undefined
? {
is_published: {
equals: true,
},
}
: {
and: [
{
is_published: {
equals: true,
},
},
{
title: {
contains: search,
},
},
],
},
});
const formattedData = blogDataQuery.docs.map((item) => {
@ -38,6 +51,9 @@ export async function fetchBlogDetail(slug: string | undefined) {
collection: "blogs",
where: {
slug: { equals: slug },
is_published: {
equals: true,
},
},
limit: 1,
pagination: false,

View File

@ -2,9 +2,11 @@ export const headerChangeOnScroll = () => {
const mainNav = document.querySelector(".main-nav");
const lightAfterScroll = document.querySelector(".light-after-scroll");
if (window.scrollY > 0) {
mainNav?.classList.remove("transparent");
mainNav?.classList.add("body-scrolled");
if (lightAfterScroll) lightAfterScroll.classList.remove("dark");
} else if (window.scrollY === 0) {
mainNav?.classList.add("transparent");
mainNav?.classList.remove("body-scrolled");
if (lightAfterScroll) lightAfterScroll.classList.add("dark");
}

View File

@ -1,17 +1,14 @@
import { FieldHook } from "payload";
const setAuthor: FieldHook = ({ value, req, data, field, operation }) => {
if (req.user && !!data) {
if (operation === "create") {
return req.user.id;
} else {
if (field.name === "updatedBy") {
return req.user.id;
}
}
}
const setAuthor: FieldHook = ({ req, operation, data, value }) => {
// if (req.user && !!data) {
// if (operation === "create") {
// data.createdBy = req.user.id;
// }
// data.updatedBy = req.user.id;
// }
return value;
return data;
};
export default setAuthor;