-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c30a8d5
commit eec434a
Showing
13 changed files
with
1,674 additions
and
636 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
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,36 @@ | ||
import { useTheme } from "next-themes"; | ||
import Image from "next/image"; | ||
import { useEffect, useState } from "react"; | ||
|
||
import darkIcon from "@/app/assets/icon-black.svg"; | ||
import lightIcon from "@/app/assets/icon-white.svg"; | ||
|
||
interface IconProps {} | ||
|
||
export const Icon: React.FC<IconProps> = () => { | ||
const [mounted, setMounted] = useState(false); | ||
const { resolvedTheme } = useTheme(); | ||
const lightSelected = resolvedTheme === "light"; | ||
|
||
// useEffect only runs on the client, so now we can safely show the UI | ||
useEffect(() => { | ||
setMounted(true); | ||
}, []); | ||
|
||
// uses placeholder of babylon logo with primary color | ||
// since before theme is resolved, we don't know which logo to show | ||
if (!mounted) { | ||
return <span className="h-[24px] w-[24px]" />; | ||
} | ||
|
||
return ( | ||
<span className="inline-block mx-2"> | ||
<Image | ||
src={lightSelected ? darkIcon : lightIcon} | ||
alt="Babylon" | ||
width={24} | ||
height={24} | ||
/> | ||
</span> | ||
); | ||
}; |
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,30 @@ | ||
import { IoMdClose } from "react-icons/io"; | ||
|
||
import { GeneralModal } from "../GeneralModal"; | ||
|
||
import { Privacy } from "./data/privacy"; | ||
|
||
interface PrivacyModalProps { | ||
open: boolean; | ||
onClose: (value: boolean) => void; | ||
} | ||
|
||
export const PrivacyModal: React.FC<PrivacyModalProps> = ({ | ||
open, | ||
onClose, | ||
}) => { | ||
return ( | ||
<GeneralModal open={open} onClose={onClose}> | ||
<div className="mb-4 flex items-center justify-between"> | ||
<h4 className="font-bold">Privacy Policy</h4> | ||
<button | ||
className="btn btn-circle btn-ghost btn-sm" | ||
onClick={() => onClose(false)} | ||
> | ||
<IoMdClose size={24} /> | ||
</button> | ||
</div> | ||
<Privacy /> | ||
</GeneralModal> | ||
); | ||
}; |
Oops, something went wrong.