-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BannerOverlay: VR Certification Fixes (#3878)
- Loading branch information
1 parent
e236428
commit 4ebb697
Showing
6 changed files
with
753 additions
and
645 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,28 @@ | ||
import { useState } from 'react'; | ||
import { BannerOverlay, Button, FixedZIndex, Icon } from 'gestalt'; | ||
|
||
export default function Example() { | ||
const [showComponent, setShowComponent] = useState(true); | ||
|
||
return !showComponent ? ( | ||
<Button | ||
onClick={() => { | ||
setShowComponent(true); | ||
}} | ||
text="Show BannerOverlay" | ||
/> | ||
) : ( | ||
<BannerOverlay | ||
message="You can dismiss this banner with the dismiss button!" | ||
offset={{ top: 130, bottom: 24 }} | ||
onDismiss={() => { | ||
setShowComponent(false); | ||
}} | ||
thumbnail={{ | ||
icon: <Icon accessibilityLabel="Sparkle" color="info" icon="info-circle" />, | ||
}} | ||
title="Dismissable Banner" | ||
zIndex={new FixedZIndex(100)} | ||
/> | ||
); | ||
} |
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,57 @@ | ||
import { useState } from 'react'; | ||
import { BannerOverlay, Button, FixedZIndex, Image, Link, Text } from 'gestalt'; | ||
|
||
export default function Example() { | ||
const [showComponent, setShowComponent] = useState(true); | ||
|
||
return !showComponent ? ( | ||
<Button | ||
onClick={() => { | ||
setShowComponent(true); | ||
}} | ||
text="Show BannerOverlay" | ||
/> | ||
) : ( | ||
<BannerOverlay | ||
message={ | ||
<Text inline> | ||
Discover{' '} | ||
<Link display="inlineBlock" href="#" target="self"> | ||
trending fashion ideas | ||
</Link>{' '} | ||
in the app! | ||
</Text> | ||
} | ||
offset={{ top: 130, bottom: 24 }} | ||
onDismiss={() => { | ||
setShowComponent(false); | ||
}} | ||
primaryAction={{ | ||
role: 'button', | ||
onClick: () => { | ||
setShowComponent(false); | ||
}, | ||
label: 'Get the app', | ||
accessibilityLabel: 'Get the app', | ||
}} | ||
secondaryAction={{ | ||
role: 'button', | ||
onClick: () => {}, | ||
label: 'Not now', | ||
accessibilityLabel: 'Not now', | ||
}} | ||
thumbnail={{ | ||
image: ( | ||
<Image | ||
alt="Pinterest Logo" | ||
naturalHeight={1} | ||
naturalWidth={1} | ||
src="https://i.ibb.co/LQc8ynn/image.png" | ||
/> | ||
), | ||
}} | ||
title="More to Explore" | ||
zIndex={new FixedZIndex(100)} | ||
/> | ||
); | ||
} |
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.