Skip to content

Commit

Permalink
♻️(demo) refactor Onboarding modal display
Browse files Browse the repository at this point in the history
Here is a shorter way to achieve the same result as before.
  • Loading branch information
NathanVss committed Feb 21, 2024
1 parent 7f12f4d commit 3ef7744
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/demo/src/Onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import React from "react";
import { Button, Modal, ModalSize, useModal } from "@openfun/cunningham-react";

const Onboarding = () => {
const modal = useModal({ isOpenDefault: true });
const modal = useModal({
isOpenDefault: !sessionStorage.getItem("onboarded"),
});

const handleClose = () => {
sessionStorage.setItem("onboarded", "1");
modal.close();
};

if (sessionStorage.getItem("onboarded")) return null;

return (
<Modal
size={ModalSize.MEDIUM}
Expand Down

0 comments on commit 3ef7744

Please sign in to comment.