-
-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds initial support for restricting reports by user roles (#451)
Closes #395
- Loading branch information
1 parent
c032234
commit 15a7643
Showing
7 changed files
with
142 additions
and
27 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
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,30 @@ | ||
import Text from "components/atoms/Typography/text"; | ||
import Button from "components/atoms/Button/button"; | ||
|
||
interface WaitlistButtonProps { | ||
waitlisted: boolean | undefined; | ||
submitting: boolean; | ||
handleJoinClick: (e: React.MouseEvent<HTMLButtonElement>) => void; | ||
} | ||
|
||
const WaitlistButton = ({ submitting, waitlisted, handleJoinClick }: WaitlistButtonProps) => { | ||
return ( | ||
<> | ||
{waitlisted === true ? ( | ||
<Text className="!font-medium">You're on the waitlist to gain access to generate custom reports!</Text> | ||
) : ( | ||
<div> | ||
<Text className="!font-medium">Join the waitlist to gain access to generate custom reports!</Text> | ||
|
||
<p className="flex justify-center py-4 px-2"> | ||
<Button type="primary" onClick={handleJoinClick} disabled={submitting} className="w-52 h-[38px]"> | ||
Join Waitlist | ||
</Button> | ||
</p> | ||
</div> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default WaitlistButton; |
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
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,29 @@ | ||
import React from "react"; | ||
import { ComponentStory } from "@storybook/react"; | ||
import WaitlistButton from "../../components/molecules/WaitlistButton/waitlist-button"; | ||
|
||
const StoryConfig = { | ||
title: "Design System/Molecules/Waitlist Button" | ||
}; | ||
|
||
export default StoryConfig; | ||
|
||
|
||
const WaitlistButtonTemplate: ComponentStory<typeof WaitlistButton> = (args) => <WaitlistButton {...args} />; | ||
|
||
export const Default = WaitlistButtonTemplate.bind({}); | ||
export const Submitting = WaitlistButtonTemplate.bind({}); | ||
export const Waitlisted = WaitlistButtonTemplate.bind({}); | ||
|
||
Default.args = { | ||
waitlisted: false | ||
}; | ||
|
||
Submitting.args = { | ||
waitlisted: false, | ||
submitting: true | ||
}; | ||
|
||
Waitlisted.args = { | ||
waitlisted: true, | ||
} |