Skip to content

Commit

Permalink
Merge pull request #451 from GeekyAnts/feat/popup-2
Browse files Browse the repository at this point in the history
feat: linked popup with cookie
  • Loading branch information
surajahmed authored Oct 30, 2023
2 parents 4df9fe3 + 1b704a1 commit 30bc9f1
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions layouts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,20 @@ function Layout({
let href = "https://docs.nativebase.io/" + pages.currentPage.id;
const [showModal, setShowModal] = useState(true);

useEffect(() => {
const check = localStorage.getItem("EU_COOKIE_LAW_CONSENT_GLUESTACK_MODAL");
if (check) {
setShowModal(false);
} else {
setShowModal(true);
}
}, []);

const handleModalChange = () => {
localStorage.setItem("EU_COOKIE_LAW_CONSENT_GLUESTACK_MODAL", "true");
setShowModal(false);
};

return (
<>
<Head>
Expand Down Expand Up @@ -166,7 +180,7 @@ function Layout({
</Script>
{/* will replace it when nativebase has semantic tagging */}
<h1 style={{ display: "none" }}>{title}</h1>
<Modal isOpen={showModal} onClose={() => setShowModal(false)}>
<Modal isOpen={showModal} onClose={() => handleModalChange()}>
<Modal.Content
maxWidth="460"
alignItems="center"
Expand Down Expand Up @@ -196,7 +210,7 @@ function Layout({
</Text>

<HStack justifyContent="center">
<a href="https://ui.gluestack.io/">
<a href="https://gluestack.io/">
<Pressable
my="6"
borderWidth={1}
Expand Down Expand Up @@ -382,6 +396,25 @@ function Layout({
borderColor: "primary.800",
},
}}
_hover={{
bg: "primary.200",
borderColor: "primary.200",

_dark: {
bg: "primary.700",
borderColor: "primary.700",
},
}}
_focus={{
bg: "primary.300",
borderColor: "primary.300",

_dark: {
bg: "primary.800",
borderColor: "primary.800",
},
}}
pointerEvents="none"
>
<Text
fontSize="sm"
Expand Down

1 comment on commit 30bc9f1

@vercel
Copy link

@vercel vercel bot commented on 30bc9f1 Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.