added store hours based on day
This commit is contained in:
parent
3c46ff58e6
commit
e9ba7d0639
@ -11,6 +11,7 @@ import { AiOutlineInstagram, AiOutlineFacebook } from "react-icons/ai";
|
|||||||
import { FaTiktok } from "react-icons/fa";
|
import { FaTiktok } from "react-icons/fa";
|
||||||
import { RiCellphoneLine } from "react-icons/ri";
|
import { RiCellphoneLine } from "react-icons/ri";
|
||||||
import { FaPhone } from "react-icons/fa6";
|
import { FaPhone } from "react-icons/fa6";
|
||||||
|
import StoreHours from "../StoreHours/StoreHours";
|
||||||
|
|
||||||
const NavBar = () => {
|
const NavBar = () => {
|
||||||
const currentPath = usePathname();
|
const currentPath = usePathname();
|
||||||
@ -69,10 +70,13 @@ const NavBar = () => {
|
|||||||
: "hidden"
|
: "hidden"
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
<div className="flex flex-row items-center justify-center gap-4">
|
||||||
<div className="flex items-center justify-center space-x-1.5">
|
<div className="flex items-center justify-center space-x-1.5">
|
||||||
<FaPhone />
|
<FaPhone />
|
||||||
<span>(918) 888-0844</span>
|
<span>(918) 888-0844</span>
|
||||||
</div>
|
</div>
|
||||||
|
<StoreHours />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ul
|
<ul
|
||||||
className={
|
className={
|
||||||
|
|||||||
@ -0,0 +1,50 @@
|
|||||||
|
import { getDay } from "date-fns";
|
||||||
|
import React from "react";
|
||||||
|
import { FaRegClock } from "react-icons/fa";
|
||||||
|
|
||||||
|
const StoreHours = () => {
|
||||||
|
var week = [
|
||||||
|
{ day: "Sunday", hours: "11:00am - 8:00pm" },
|
||||||
|
{ day: "Monday", hours: "11:00am - 9:00pm" },
|
||||||
|
{ day: "Tuesday", hours: "11:00am - 9:00pm" },
|
||||||
|
{ day: "Wednesday", hours: "11:00am - 9:00pm" },
|
||||||
|
{ day: "Thursday", hours: "11:00am - 9:00pm" },
|
||||||
|
{ day: "Friday", hours: "11:00am - 9:30pm" },
|
||||||
|
{ day: "Saturday", hours: "11:00am - 9:30pm" },
|
||||||
|
];
|
||||||
|
|
||||||
|
var months = [
|
||||||
|
"January",
|
||||||
|
"February",
|
||||||
|
"March",
|
||||||
|
"April",
|
||||||
|
"May",
|
||||||
|
"June",
|
||||||
|
"July",
|
||||||
|
"August",
|
||||||
|
"September",
|
||||||
|
"October",
|
||||||
|
"November",
|
||||||
|
"December",
|
||||||
|
];
|
||||||
|
|
||||||
|
function getHoursByDay(day: String) {
|
||||||
|
const foundDay = week.find((item) => item.day === day);
|
||||||
|
return foundDay ? foundDay.hours : "Hours not found";
|
||||||
|
}
|
||||||
|
var curr_day = new Date().toLocaleDateString("en-US", { weekday: "long" });
|
||||||
|
|
||||||
|
var hours = getHoursByDay(curr_day);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="flex flex-row gap-1 items-center justify-center">
|
||||||
|
<div className="flex">
|
||||||
|
<FaRegClock />
|
||||||
|
</div>
|
||||||
|
<div className="flex">{hours}</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default StoreHours;
|
||||||
@ -2,7 +2,6 @@ import React from "react";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { BsChevronCompactLeft, BsChevronCompactRight } from "react-icons/bs";
|
import { BsChevronCompactLeft, BsChevronCompactRight } from "react-icons/bs";
|
||||||
import { RxDotFilled } from "react-icons/rx";
|
import { RxDotFilled } from "react-icons/rx";
|
||||||
import { EmblaCarousel } from "./carousel";
|
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import WSPGallery from "../components/WSPGallery/page";
|
import WSPGallery from "../components/WSPGallery/page";
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ const Footer = () => {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<p className="flex flex-wrap w-[90%] relative items-center text-start justify-center text-base ">
|
<p className="flex flex-wrap w-[90%] relative items-center text-start justify-center text-base ">
|
||||||
Jefe's Mexican Cocina Y Cantina serves the best Mexican food in
|
Jefes Mexican Cocina Y Cantina serves the best Mexican food in
|
||||||
Broken Arrow, OK.
|
Broken Arrow, OK.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user