Skip to content

Commit

Permalink
pop up embed
Browse files Browse the repository at this point in the history
  • Loading branch information
mluena committed Oct 18, 2024
1 parent c33be83 commit e570e8b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 11 additions & 3 deletions client/src/app/(embed)/embed/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
"use client";
import CountryDetail from "@/containers/countries/countries-detail";
import Popup from "@/containers/popup";

import { useSyncCountry } from "@/app/store";

export default function EmbedPage() {
const [country] = useSyncCountry();

return (
<div className="max-w-md xl:max-w-xl 2xl:max-w-4xl">
<CountryDetail embed />
</div>
<Popup visibleKey={country} className="left-0 z-10">
<div className=" max-w-md xl:max-w-xl 2xl:max-w-4xl">
<CountryDetail embed />
</div>
</Popup>
);
}
4 changes: 3 additions & 1 deletion client/src/containers/popup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { cn } from "@/lib/classnames";
const Popup = ({
visibleKey,
children,
}: PropsWithChildren<{ visibleKey: string | number | null }>): JSX.Element => {
className,
}: PropsWithChildren<{ visibleKey: string | number | null; className?: string }>): JSX.Element => {
const [open, setOpen] = useState(false);

const toggleOpen = () => setOpen((prev) => !prev);
Expand All @@ -25,6 +26,7 @@ const Popup = ({
true,
"-translate-x-full": !open && visibleKey,
"translate-x-0": open && visibleKey,
[className || ""]: !!className,
})}
>
<div className="relative z-10 h-full max-h-screen w-full overflow-auto rounded-br-3xl bg-white">
Expand Down

0 comments on commit e570e8b

Please sign in to comment.