-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BannerCallout: VR Implementation Changes (#3804)
- Loading branch information
1 parent
79bbb17
commit c1be5ee
Showing
13 changed files
with
653 additions
and
60 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 { BannerCallout, Flex } from 'gestalt'; | ||
|
||
export default function Example() { | ||
return ( | ||
<Flex alignItems="center" height="100%" justifyContent="center" width="100%"> | ||
<BannerCallout | ||
dismissButton={{ | ||
onDismiss: () => {}, | ||
}} | ||
message="Inspiration to build the life you love." | ||
primaryAction={{ | ||
accessibilityLabel: 'Log in', | ||
href: 'https://pinterest.com', | ||
label: 'Sign up', | ||
target: 'blank', | ||
role: 'link', | ||
}} | ||
secondaryAction={{ | ||
accessibilityLabel: 'Log in', | ||
href: 'https://pinterest.com', | ||
label: 'Log in', | ||
target: 'blank', | ||
role: 'link', | ||
}} | ||
title="Pinterest is the place for inspiration" | ||
type="default" | ||
/> | ||
</Flex> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,11 +1,33 @@ | ||
.dismissButton { | ||
position: absolute; | ||
} | ||
|
||
html[dir="rtl"] .rtlPos { | ||
left: 0; | ||
position: absolute; | ||
top: 0; | ||
} | ||
|
||
html:not([dir="rtl"]) .rtlPos { | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
} | ||
|
||
html[dir="rtl"] .smRtlVRPos { | ||
left: var(--sema-space-300); | ||
top: var(--sema-space-500); | ||
} | ||
|
||
html:not([dir="rtl"]) .smRtlVRPos { | ||
right: var(--sema-space-300); | ||
top: var(--sema-space-500); | ||
} | ||
|
||
html[dir="rtl"] .lgRtlVRPos { | ||
left: var(--sema-space-400); | ||
top: var(--sema-space-400); | ||
} | ||
|
||
html:not([dir="rtl"]) .lgRtlVRPos { | ||
right: var(--sema-space-400); | ||
top: var(--sema-space-400); | ||
} |
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,33 @@ | ||
import classnames from 'classnames'; | ||
import styles from '../BannerCallout.css'; | ||
import { useDefaultLabelContext } from '../contexts/DefaultLabelProvider'; | ||
import IconButton from '../IconButton'; | ||
|
||
type Props = { | ||
size?: 'sm' | 'lg'; | ||
dismissButton?: { | ||
accessibilityLabel?: string; | ||
onDismiss: () => void; | ||
}; | ||
}; | ||
|
||
export default function DismissButton({ dismissButton, size = 'lg' }: Props) { | ||
const { accessibilityDismissButtonLabel } = useDefaultLabelContext('BannerCallout'); | ||
|
||
return ( | ||
<div | ||
className={classnames( | ||
styles.dismissButton, | ||
size === 'lg' ? styles.lgRtlVRPos : styles.smRtlVRPos, | ||
)} | ||
> | ||
<IconButton | ||
accessibilityLabel={dismissButton?.accessibilityLabel ?? accessibilityDismissButtonLabel} | ||
icon="cancel" | ||
iconColor="darkGray" | ||
onClick={dismissButton?.onDismiss} | ||
size="sm" | ||
/> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.