diff --git a/src/__tests__/formatTime.test.tsx b/src/__tests__/formatTime.test.tsx deleted file mode 100644 index 5a695ae..0000000 --- a/src/__tests__/formatTime.test.tsx +++ /dev/null @@ -1,39 +0,0 @@ -// eslint-disable-next-line import/extensions -import { formatTime } from '@/utils/formatTime'; - -describe('formatTime', () => { - it('should format the time correctly for a valid Date object', () => { - const date = new Date('2024-07-08T14:34:56Z'); - const formattedTime = formatTime(date); - - // Adjust the expected time based on your local time zone or set the date to UTC. - const expectedHours = date.getUTCHours().toString().padStart(2, '0'); - const expectedMinutes = date.getUTCMinutes().toString().padStart(2, '0'); - const expectedSeconds = date.getUTCSeconds().toString().padStart(2, '0'); - const expectedTime = `${expectedHours}:${expectedMinutes}:${expectedSeconds}`; - - expect(formattedTime).toBe(expectedTime); - }); - - it('should return "NaN:NaN:NaN" for an invalid date string', () => { - const invalidDate = 'invalid-date-string'; - const formattedTime = formatTime(invalidDate as any); - expect(formattedTime).toBe('NaN:NaN:NaN'); - }); - - it('should return "NaN:NaN:NaN" for a number input', () => { - const invalidNumber = 12345; - const formattedTime = formatTime(invalidNumber as any); - expect(formattedTime).toBe('NaN:NaN:NaN'); - }); - - it('should return "NaN:NaN:NaN" for null input', () => { - const formattedTime = formatTime(null as any); - expect(formattedTime).toBe('NaN:NaN:NaN'); - }); - - it('should return "NaN:NaN:NaN" for undefined input', () => { - const formattedTime = formatTime(undefined as any); - expect(formattedTime).toBe('NaN:NaN:NaN'); - }); -}); diff --git a/src/app/globals.css b/src/app/globals.css index 34bf3a5..58148d9 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -241,9 +241,9 @@ body {} } /* Scroll */ -.o-hidden{overflow: hidden !important;} +/* .o-hidden{overflow: hidden !important;} .o-x-scroll{overflow-y: scroll !important;} -.opacity-0{opacity: 0 !important;} +.opacity-0{opacity: 0 !important;} */ /* doubleshricked*/ /* width */ .scroll-double-shrinked::-webkit-scrollbar { @@ -264,4 +264,4 @@ body {} margin-top: 4px !important ; margin-bottom: 4px !important ; height: 90% !important; -} \ No newline at end of file +} diff --git a/src/app/page.tsx b/src/app/page.tsx index a4b18c8..91baf78 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -7,15 +7,15 @@ import Header from '@/components/Header'; import HeroSection from '@/components/HeroSection'; import { LatestSection } from '@/components/LatestSection'; import Footer from '@/components/Footer'; -import { MdOutlineChat } from 'react-icons/md'; -import { IoMdClose } from 'react-icons/io'; + import { HomeAds } from '@/components/HomeAds'; + import { ProductWithFilter } from '@/components/allProducts'; -import Link from 'next/link'; -import ChatRoomsList from '@/components/ChatRoomsList'; import ChatPopUp from '@/hooks/ChatPopUp'; import ChatWrapper from '@/components/chatWrapper'; - +import Link from 'next/link'; +import { MdOutlineChat } from 'react-icons/md'; +import { checkUserLoggedIn } from '@/components/isLogged'; export interface FormDataType { confirmPassword: string; @@ -24,9 +24,8 @@ export interface FormDataType { } export default function Home() { - // const [isOpen, setIsOpen] = useState(false); - const [showlModal, setShowmodal] = useState(false); const { isChatPopUpOpen, setIsChatPopUpOpen, toggleChatPopUp } = ChatPopUp(); + const [showlModal, setShowmodal] = useState(false); const { register, handleSubmit, @@ -43,42 +42,12 @@ export default function Home() { reset(); }; - // function handlePopUp(): void { - // setIsOpen(!isOpen); - // } - return (
-
- {/*
-
- -
-
*/} -
- {/* Startttttttt */} -
-
-
- -
- {isChatPopUpOpen && ( - // - - )} -
-
- {/* Enddddddddd */} +
+ {/* The Image adds */} {/* LAtest Product */} @@ -98,6 +67,26 @@ export default function Home() {
+ {/* Startttttttt */} +
+ {checkUserLoggedIn() && ( +
+ +
+ )} +
+ {isChatPopUpOpen && ( + // + + )} +
+
+ {/* Enddddddddd */} {/* Footer Sections */}