Skip to content

Commit

Permalink
Merge pull request #161 from Vizzuality/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
mluena authored Oct 18, 2024
2 parents ec64ba1 + 74746d0 commit fb1edd5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 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/app/api/auth/[...nextauth]/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export const authOptions: AuthOptions = {

if (sessionToken) {
const now = new Date().getTime();
const exp = decoded.iat ? decoded.iat * 1000 + SESSION_MAX_AGE * 1000 : 0;
const exp = decoded.iat
? decoded.iat * 1000 + SESSION_MAX_AGE * 1000
: SESSION_MAX_AGE * 1000;

if (now < exp) {
return {
Expand Down
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 fb1edd5

Please sign in to comment.