-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from RotaractMora/static-content
Static content
- Loading branch information
Showing
38 changed files
with
836 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file is used to store environment variables that are specific to your local development environment. | ||
NEXT_PUBLIC_API_KEY=<firebase_api_key> | ||
NEXT_PUBLIC_AUTH_DOMAIN=<firebase_auth_domain> | ||
NEXT_PUBLIC_PROJECT_ID=<firebase_project_id> | ||
NEXT_PUBLIC_STORAGE_BUCKET=<firebase_storage_bucket> | ||
NEXT_PUBLIC_MESSAGING_SENDER_ID=<firebase_messaging_sender_id> | ||
NEXT_PUBLIC_APP_ID=<firebase_app_id> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// AdminDashboardLayout.tsx | ||
"use client"; | ||
import React, { ReactNode, useContext, useState } from "react"; | ||
import { cn } from "@/lib/utils"; | ||
import Footer from "@/components/blocks/footer"; | ||
import { Menu, MenuItem } from "../../components/ui/navbar-menu" | ||
import Image from "next/image"; | ||
import RootLayout, { ThemeContext } from "@/app/layout"; | ||
import { MoonIcon, SunIcon } from "@heroicons/react/24/solid"; | ||
import LOGO_SMALL from "../../../public/Images/logo/RUR20_small.png"; | ||
import { useAuth } from "@/context/auth-provider"; | ||
import { useRouter } from "next/navigation"; | ||
|
||
interface AdminDashboardLayoutProps { | ||
children: ReactNode; | ||
} | ||
|
||
export function AdminDashboardLayout({ children }: AdminDashboardLayoutProps) { | ||
|
||
console.log("AdminDashboardLayout"); | ||
|
||
return ( | ||
|
||
<RootLayout> | ||
|
||
<div className="min-h-screen flex flex-col"> | ||
<div className="relative w-full flex items-center justify-center mb-24"> | ||
<Navbar className="top-2" /> | ||
</div> | ||
|
||
<main className="flex-grow p-4"> | ||
{children} | ||
</main> | ||
|
||
<Footer /> | ||
</div> | ||
|
||
</RootLayout> | ||
|
||
); | ||
} | ||
|
||
function Navbar({ className }: { className?: string }) { | ||
|
||
const { user , logOut } = useAuth(); | ||
const router = useRouter(); | ||
const [active, setActive] = useState<string | null>(null); | ||
|
||
const [tougleTheme, currentTheme] = useContext<any>(ThemeContext); | ||
|
||
const handleLogout = async () => { | ||
await logOut(); | ||
router.push("/admin/"); | ||
} | ||
|
||
return ( | ||
<div className={cn("fixed top-10 inset-x-0 max-w-2xl mx-auto z-50", className)}> | ||
<Menu setActive={setActive}> | ||
|
||
<Image src={LOGO_SMALL} alt="RUR" width={50} height={37} className="p-0 rounded-lg dark:bg-black bg-white"/> | ||
|
||
<MenuItem setActive={setActive} active={null} link="/" item="Home" /> | ||
|
||
<MenuItem setActive={setActive} active={null} link="/admin/dashboard/timeline" item="Timeline" /> | ||
|
||
<MenuItem setActive={setActive} active={null} link="/admin/dashboard/sponsors" item="Sponsors"/> | ||
|
||
<MenuItem setActive={setActive} active={null} link="/admin/logout" item="Logout"/> | ||
|
||
<button | ||
onClick={()=>tougleTheme()} | ||
className="border text-sm font-medium relative border-neutral-200 dark:border-white/[0.2] text-black dark:text-white px-4 py-2 rounded-full" | ||
> | ||
{currentTheme() === "dark" ? ( | ||
<SunIcon className="h-5 w-5" /> | ||
) : ( | ||
<MoonIcon className="h-5 w-5" /> | ||
)} | ||
</button> | ||
|
||
|
||
{/* <MenuItem setActive={setActive} active={active} item="Logout"> | ||
<div className="flex flex-col space-y-4 text-sm"> | ||
<HoveredLink href="/logout">Logout</HoveredLink> | ||
</div> | ||
</MenuItem> */} | ||
|
||
</Menu> | ||
</div> | ||
|
||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use client'; | ||
|
||
import React, { useEffect } from 'react'; | ||
import { AdminDashboardLayout } from '@/app/admin/admin-dashboard-layout'; | ||
|
||
const AdminDashboard: React.FC = () => { | ||
|
||
|
||
|
||
return ( | ||
<AdminDashboardLayout> | ||
<div className="min-h-screen bg-custom-color-700 dark:bg-custom-dark-color-700 flex flex-col"> | ||
<header className="bg-custom-color-800 dark:bg-custom-dark-color-800 shadow"> | ||
<div className="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8"> | ||
<h1 className="text-3xl font-bold text-gray-900">Admin Dashboard</h1> | ||
</div> | ||
</header> | ||
<main className="flex-grow"> | ||
<div className="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8"> | ||
<div className="px-4 py-6 sm:px-0"> | ||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"> | ||
<div className="bg-custom-color-800 dark:bg-custom-dark-color-800 p-6 rounded-lg shadow-md"> | ||
<h2 className="text-xl font-bold mb-2">Operation 1</h2> | ||
<p className="text-gray-700">Description of operation 1.</p> | ||
</div> | ||
<div className="bg-custom-color-800 dark:bg-custom-dark-color-800 p-6 rounded-lg shadow-md"> | ||
<h2 className="text-xl font-bold mb-2">Operation 2</h2> | ||
<p className="text-gray-700">Description of operation 2.</p> | ||
</div> | ||
<div className="bg-custom-color-800 dark:bg-custom-dark-color-800 p-6 rounded-lg shadow-md"> | ||
<h2 className="text-xl font-bold mb-2">Operation 3</h2> | ||
<p className="text-gray-700">Description of operation 3.</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</main> | ||
</div> | ||
</AdminDashboardLayout> | ||
); | ||
}; | ||
|
||
export default AdminDashboard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
'use client'; | ||
|
||
import React, { useEffect } from 'react'; | ||
import { useAuth } from '@/context/auth-provider'; | ||
import { useRouter } from 'next/navigation'; | ||
import { AdminDashboardLayout } from '../admin-dashboard-layout'; | ||
|
||
const AdminLoginPage: React.FC = () => { | ||
const { googleSignIn, user } = useAuth(); | ||
const router = useRouter(); | ||
|
||
useEffect(() => { | ||
if (user) { | ||
router.push('/admin/dashboard'); | ||
} | ||
} | ||
, [user]); | ||
|
||
return ( | ||
<AdminDashboardLayout> | ||
|
||
<div className="flex flex-col items-center justify-center h-screen bg-white dark:bg-gray-900"> | ||
<h1 className="text-3xl font-bold mb-4 text-black dark:text-white">Admin Login</h1> | ||
<p className="mb-4 text-black dark:text-gray-300">Please log in using your Google account to access the admin panel.</p> | ||
<button onClick={() =>{googleSignIn(); console.log("clicked");}} className="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 dark:bg-blue-700 dark:hover:bg-blue-500"> | ||
Login with Google | ||
</button> | ||
</div> | ||
|
||
</AdminDashboardLayout> | ||
); | ||
}; | ||
|
||
export default AdminLoginPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use client'; | ||
|
||
import { useAuth } from "@/context/auth-provider"; | ||
import { useEffect } from "react"; | ||
import { AdminDashboardLayout } from "../admin-dashboard-layout"; | ||
|
||
export default function LogoutPage() { | ||
|
||
const { logOut } = useAuth(); | ||
useEffect(() => { | ||
logOut(); | ||
}, []); | ||
|
||
return ( | ||
<AdminDashboardLayout> | ||
|
||
<div className="flex flex-col items-center justify-center h-screen bg-white dark:bg-gray-900"> | ||
<h1 className="text-3xl font-bold mb-4 text-black dark:text-white">Admin Logout</h1> | ||
<p className="mb-4 text-black dark:text-gray-300">waiting for logout...</p> | ||
</div> | ||
|
||
</AdminDashboardLayout> | ||
); | ||
} |
Oops, something went wrong.