-
Notifications
You must be signed in to change notification settings - Fork 783
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): onboarding experience using Frigade (#2357)
- Loading branch information
Showing
9 changed files
with
1,005 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"use client"; | ||
|
||
import * as Frigade from "@frigade/react"; | ||
import { useSession } from "next-auth/react"; | ||
export const FrigadeProvider = ({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) => { | ||
const { data: session } = useSession(); | ||
return ( | ||
<Frigade.Provider | ||
apiKey="api_public_6BKR7bUv0YZ5dqnjLGeHpRWCHaDWeb5cVobG3A9YkW0gOgafOEBvtJGZgvhp8PGb" | ||
userId={ | ||
session?.user.email === "keep" | ||
? undefined | ||
: session?.user.email ?? session?.user.name | ||
} | ||
theme={{ | ||
colors: { | ||
primary: { | ||
surface: "rgb(249 115 22)", | ||
border: "rgb(249 115 22)", | ||
hover: { surface: "rgb(234 88 12)" }, | ||
}, | ||
}, | ||
}} | ||
> | ||
{children} | ||
</Frigade.Provider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { Fragment } from "react"; | ||
import { Dialog, Transition } from "@headlessui/react"; | ||
import { Badge, Button, Title } from "@tremor/react"; | ||
import { IoMdClose } from "react-icons/io"; | ||
import * as Frigade from "@frigade/react"; | ||
|
||
interface OnboardingProps { | ||
isOpen: boolean; | ||
toggle: () => void; | ||
variables?: Record<string, unknown>; | ||
} | ||
|
||
export default function Onboarding({ | ||
isOpen, | ||
toggle, | ||
variables, | ||
}: OnboardingProps) { | ||
return ( | ||
<Transition appear show={isOpen} as={Fragment}> | ||
<Dialog onClose={toggle}> | ||
<Transition.Child | ||
as={Fragment} | ||
enter="ease-out duration-300" | ||
enterFrom="opacity-0" | ||
enterTo="opacity-100" | ||
leave="ease-in duration-200" | ||
leaveFrom="opacity-100" | ||
leaveTo="opacity-0" | ||
> | ||
<div className="fixed inset-0 bg-black/30 z-20" aria-hidden="true" /> | ||
</Transition.Child> | ||
<Transition.Child | ||
as={Fragment} | ||
enter="transition ease-in-out duration-300 transform" | ||
enterFrom="translate-x-full" | ||
enterTo="translate-x-0" | ||
leave="transition ease-in-out duration-300 transform" | ||
leaveFrom="translate-x-0" | ||
leaveTo="translate-x-full" | ||
> | ||
<Dialog.Panel className="fixed right-0 inset-y-0 w-2/4 bg-white z-30 p-6 overflow-auto flex flex-col"> | ||
<Frigade.Checklist.Collapsible | ||
flowId="flow_FHDz1hit" | ||
sequential={true} | ||
variables={variables} | ||
/> | ||
</Dialog.Panel> | ||
</Transition.Child> | ||
</Dialog> | ||
</Transition> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.