2024-02-19 17:02:15 +01:00
|
|
|
|
import React from "react";
|
2024-02-15 11:12:27 +01:00
|
|
|
|
import { Button, Modal, ModalSize, useModal } from "@openfun/cunningham-react";
|
|
|
|
|
|
|
|
|
|
|
|
const Onboarding = () => {
|
|
|
|
|
|
const modal = useModal({ isOpenDefault: true });
|
|
|
|
|
|
|
|
|
|
|
|
const handleClose = () => {
|
|
|
|
|
|
sessionStorage.setItem("onboarded", "1");
|
|
|
|
|
|
modal.close();
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2024-02-19 17:02:15 +01:00
|
|
|
|
if (sessionStorage.getItem("onboarded")) return null;
|
2024-02-15 11:12:27 +01:00
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<Modal
|
|
|
|
|
|
size={ModalSize.MEDIUM}
|
|
|
|
|
|
isOpen={modal.isOpen}
|
|
|
|
|
|
onClose={handleClose}
|
|
|
|
|
|
closeOnClickOutside
|
|
|
|
|
|
rightActions={
|
|
|
|
|
|
<div className="onboarding__footer">
|
|
|
|
|
|
<Button color="primary" iconPosition="right" onClick={handleClose}>
|
|
|
|
|
|
Let's go!
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
href="https://openfun.github.io/cunningham/storybook"
|
|
|
|
|
|
color="tertiary-text"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
icon={<span className="material-icons">open_in_new</span>}
|
|
|
|
|
|
>
|
|
|
|
|
|
Go to the documentation
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
}
|
|
|
|
|
|
>
|
|
|
|
|
|
<header className="mb-b">
|
|
|
|
|
|
<span className="onboarding__title-icon">👋</span>
|
|
|
|
|
|
<h2 className="onboarding__title">Hey there!</h2>
|
|
|
|
|
|
<p>Welcome on the Cunningham Design System showcase.</p>
|
|
|
|
|
|
</header>
|
|
|
|
|
|
<section className="onboarding__content">
|
|
|
|
|
|
<p>
|
|
|
|
|
|
👀 Through this demo, you will be able to discover{" "}
|
|
|
|
|
|
<strong>a bunch of Cunningham components</strong>. Take a look at the{" "}
|
|
|
|
|
|
<a href="https://openfun.github.io/cunningham/storybook">
|
|
|
|
|
|
documentation
|
|
|
|
|
|
</a>{" "}
|
|
|
|
|
|
to see how to use them.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
<p>
|
|
|
|
|
|
🖌️ You will also discover the <strong>theme feature</strong> of the
|
|
|
|
|
|
Cunningham Design System. You can switch theme through the components
|
|
|
|
|
|
in the top right corner.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</section>
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default Onboarding;
|