-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DDFLSBP-651-implement-cookie-blocking-placeholder
Added CookiePlaceholder to the design system.
- Loading branch information
Showing
4 changed files
with
77 additions
and
0 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
31 changes: 31 additions & 0 deletions
31
src/stories/Library/cookie-placeholder/CookiePLaceholder.stories.tsx
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,31 @@ | ||
import { ComponentMeta, ComponentStory } from "@storybook/react"; | ||
import { CookiePlaceholder } from "./CookiePlaceholder"; | ||
|
||
export default { | ||
title: "Library / Cookie Placeholder", | ||
component: CookiePlaceholder, | ||
parameters: { | ||
design: { | ||
type: "figma", | ||
url: "https://www.figma.com/design/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=16042-22933&t=kwXRJW0pZzoQmJHm-1", | ||
}, | ||
layout: "fullscreen", | ||
}, | ||
argTypes: { | ||
info: { | ||
defaultValue: | ||
"To view this content, we need your consent to use cookies.", | ||
type: "string", | ||
}, | ||
buttonText: { | ||
defaultValue: "Manage consent", | ||
type: "string", | ||
}, | ||
}, | ||
} as ComponentMeta<typeof CookiePlaceholder>; | ||
|
||
const Template: ComponentStory<typeof CookiePlaceholder> = (props) => ( | ||
<CookiePlaceholder {...props} /> | ||
); | ||
|
||
export const CookiesBlocked = Template.bind({}); |
31 changes: 31 additions & 0 deletions
31
src/stories/Library/cookie-placeholder/CookiePlaceholder.tsx
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,31 @@ | ||
import { Button } from "../Buttons/button/Button"; | ||
|
||
type CookiePlaceholderProps = { | ||
info: string; | ||
buttonText: string; | ||
}; | ||
|
||
export const CookiePlaceholder = ({ | ||
info, | ||
buttonText, | ||
}: CookiePlaceholderProps) => { | ||
return ( | ||
<div className="cookie-placeholder"> | ||
<div className="cookie-placeholder__description"> | ||
<div id="dpl-react-apps-cookie-placeholder">{info}</div> | ||
</div> | ||
|
||
<Button | ||
classNames="cookie-placeholder__manage-consent-button" | ||
size="xlarge" | ||
label={buttonText} | ||
buttonType="none" | ||
variant="outline" | ||
collapsible={false} | ||
disabled={false} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CookiePlaceholder; |
14 changes: 14 additions & 0 deletions
14
src/stories/Library/cookie-placeholder/cookie-placeholder.scss
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,14 @@ | ||
.cookie-placeholder { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 20px; | ||
border-radius: 5px; | ||
} | ||
|
||
.cookie-placeholder__description { | ||
font-family: $font__body; | ||
font-weight: $font__weight--normal; | ||
margin-bottom: 20px; | ||
} |