58 lines
1.5 KiB
TypeScript
Raw Normal View History

2024-05-26 02:14:59 -04:00
"use client";
import { createClient } from "@/utils/supabase/client";
import React, { useState, useEffect } from 'react';
import Search from "@/components/neroshitron/search";
2024-06-01 16:30:05 -04:00
import Gallery from "@/components/neroshitron/gallery";
2024-06-02 03:48:21 -04:00
import Link from "next/link";
2024-05-26 02:14:59 -04:00
function PageComponent() {
2024-06-01 16:30:05 -04:00
const [selectedGallery, setSelectedGallery] = useState<string | null>(null);
2024-05-26 02:14:59 -04:00
const supabase = createClient();
const getData = async () => {
}
2024-06-01 16:30:05 -04:00
2024-05-26 02:14:59 -04:00
useEffect(() => {
getData();
2024-06-01 16:30:05 -04:00
}, [selectedGallery]);
const closeGallery = () => {
setSelectedGallery(null);
}
2024-05-27 20:53:24 -04:00
2024-05-26 19:49:20 -04:00
return (
<div className="w-full">
2024-06-02 03:48:21 -04:00
<div className="w-2/3">
2024-06-01 16:30:05 -04:00
<Search gallerySelected={(gallery:string)=>{setSelectedGallery(gallery)}}/>
2024-06-02 03:48:21 -04:00
</div>
2024-06-01 16:30:05 -04:00
{selectedGallery!=null ? (
<>
{/*
This is the modal for holding the gallery
*/}
<div
className={`fixed inset-0 transition-opacity z-30 animate-in`}
aria-hidden="true"
>
<div
2024-06-02 01:24:14 -04:00
className="absolute inset-0 bg-secondary-dark opacity-70 z-30"
2024-06-01 16:30:05 -04:00
onClick={() => closeGallery()}
></div>
<div className="absolute inset-0 overflow-y-auto overflow-x-hidden no-scrollbar pt-2 w-full p-20 z-30">
<Gallery
id={selectedGallery as string}
columns={3}
closeMenu={() => closeGallery()}
></Gallery>
</div>
</div>
</>
) : null}
2024-05-27 16:38:34 -04:00
</div>
2024-05-26 19:49:20 -04:00
);
2024-05-26 02:14:59 -04:00
}
export default PageComponent;