components APIs
- Header
- Button
- Layout
- Footer
- Text
- Box
- Card
- Table
- Loading
- Select
- Loader
- Toolbar
- Icon
- CodeInput
- BottomSheet
- InfoBlock
- LanguageToggle
- ProgressCircles
- Ripple
- Toggle
- Tag
- Input
- Paginator
- Filter
- AsyncSelect
- CatalogBigButton
- ReadMore
- ConditionalWrapper
- LastCheckedDisplay
- PriceLabel
- PageTitle
- CartTable
- CartFinalPriceTable
- LoadingSpin
- InfoModal
- ProductCard
- RecommendCoupon
- PriceVales
- NomalLayout
- Web3ReactManager
- Popups
- CurrencyInput
- TransactionErrorContent
- TransactionConfirmationModal
- ConfirmationModalContent
- DoubleCurrencyLogo
- CustomModal
- CurrencySearchModal
- CurrencyLogo
- NumericalInput
- Logo
- QuestionHelper
- ListLogo
- DataTable
- WalletModal
- CustomTable
- MinimalPositionCard
- RemoveLiquidityModal
- CustomTooltip
- ColoredSlider
- ToggleSwitch
- FormattedPriceImpact
- SettingsModal
- ConfirmSwapModal
- AdvancedSwapDetails
- AddressInput
- LineChart
- StakeSyrupModal
- AccountDetails
- BetaWarningBanner
- AreaChart
- ChartType
- TokensTable
- PairTable
- TopMovers
- BarChart
- TransactionsTable
- StakeQuickModal
- UnstakeQuickModal
- SyrupCard
- CustomMenu
- SearchInput
- CustomSwitch
- FarmCard
- BuyFiatModal
- MoonpayModal
- RewardSlider
- Swap
- AddLiquidity
- PoolFinderModal
- PoolPositionCard
- SwapTokenDetails
- SuperHeader
- GlobalStyles
- PrimaryButton
- SectionTitle
- Section
- AccentSection
- ChainSelection
- CoinSelection
- AddressSelection
- SendAction
- Buttons
- Content
- Particles
- IconButton
- NotSupported
- InputSearch
- RouteGuard
- SearchBar
- FileInput
- GovBanner
- AuthForm
- DomainDetails
- Subnav
- ColumnFilter
- ImportExport
- selectFilter
- TaggedArrayInput
- FacetFilter
- ButtonSingleLine
- TextMultiline
- ButtonSelect
- BottomSheetBehavior
- InfoButton
- BulletPointX
- BulletPointCheck
- Title
- LoadingIcon
- SelectFilterControls
- CORInputForm
- SdnInputForm
- Navbar
- HomeRoute
- AuthRoute
- DocumentDetails
- DocumentStepper
- AddGame
- Auth
- Effectiveness
- Export
- PokemonType
- Moves
- Member
- MoveSelector
- Type
- Natures
- Move
- PokeInfo
- Share
- Badges
- Status
- UpdateSW
- About
- Builder
- Calculator
- Changelog
- Import
- Pokestats
- Report
- Rules
- Settings
- Tracker
- DarkThemeProvider
- NotificationHandler
- Background
- Indicator
- StyledButton
- StyledText
- Illustration
- OnboardingSlider
- FlexList
- AppLayout
- ScrollableList
- Visualization
- DataSearch
- Region
- App
- CompareApiLegend
- CompareApiBreadcrumbs
- CompareApiLink
- CompareApiCard
- ExploreApiBreadcrumbs
- ExploreApiLink
- ExploreApiSearch
- ExploreApiConst
- ApiLoader
- RefreshButton
- Listing
- PriceModal
- ConfirmationModal
- Transition
- AutoComplete
- useInput
- Avatar
- Badge
- Breadcrumbs
- ButtonDropdown
- ButtonGroup
- Capacity
- Checkbox
- Code
- Collapse
- CssBaseline
- GeistProvider
- Description
- Display
- Divider
- Dot
- Drawer
- useModal
- Fieldset
- Grid
- Image
- Keyboard
- Link
- Modal
- Note
- Page
- Pagination
- Popover
- Progress
- Radio
- Rating
- Slider
- Snippet
- Spacer
- Spinner
- Tabs
- Textarea
- Tooltip
- Tree
- useBodyScroll
- useClasses
- useClickAway
- useClipboard
- useCurrentState
- useKeyboard
- KeyMod
- KeyCode
- useMediaQuery
- useTabs
- useToasts
- User
- useTheme
- Themes
- GeistUIThemes
- useAllThemes
- CollapsableDialog
- Map
- IPForm
- IPMenu
- Container
- Parallax
- Nav
- SEO
- BlogNav
- ExtensionCard
- MenuComp
Other Related APIs
- react#useState
- react#useEffect
- react#useCallback
- react#useRef
- react#useLayoutEffect
- react-native#View
- react-native#TouchableOpacity
- react-native#Animated
- react-native#StyleSheet
- react-native#DevSettings
- react-native#Linking
- @react-navigation/native#useNavigation
- react-native-safe-area-context#SafeAreaView
- react-native-reanimated#pow
- react-native-reanimated#sub
- react-native-reanimated#abs
- components#Text
- components#Box
- components#Icon
- components#BottomSheet
- components#Header
components#BottomSheetBehavior TypeScript Examples
The following examples show how to use
components#BottomSheetBehavior.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HomeScreen.tsx From mobile with Apache License 2.0 | 6 votes |
CollapsedContent = (bottomSheetBehavior: BottomSheetBehavior) => {
const [systemStatus] = useSystemStatus();
const [notificationStatus, turnNotificationsOn] = useNotificationPermissionStatus();
const showNotificationWarning = notificationStatus !== 'granted';
return (
<CollapsedOverlayView
status={systemStatus}
notificationWarning={showNotificationWarning}
turnNotificationsOn={turnNotificationsOn}
bottomSheetBehavior={bottomSheetBehavior}
/>
);
}
Example #2
Source File: HomeScreen.tsx From mobile with Apache License 2.0 | 6 votes |
ExpandedContent = (bottomSheetBehavior: BottomSheetBehavior) => {
const [systemStatus] = useSystemStatus();
const [notificationStatus, turnNotificationsOn] = useNotificationPermissionStatus();
const showNotificationWarning = notificationStatus !== 'granted';
const toSettings = useCallback(() => {
Linking.openSettings();
}, []);
const turnNotificationsOnFn = notificationStatus === 'blocked' ? toSettings : turnNotificationsOn;
return (
<OverlayView
status={systemStatus}
notificationWarning={showNotificationWarning}
turnNotificationsOn={turnNotificationsOnFn}
bottomSheetBehavior={bottomSheetBehavior}
/>
);
}
Example #3
Source File: HomeScreen.tsx From mobile with Apache License 2.0 | 5 votes |
HomeScreen = () => {
const navigation = useNavigation();
useEffect(() => {
if (__DEV__ && TEST_MODE) {
DevSettings.addMenuItem('Show Demo Menu', () => {
navigation.navigate('TestScreen');
});
}
}, [navigation]);
// This only initiate system status updater.
// The actual updates will be delivered in useSystemStatus().
const subscribeToStatusUpdates = useExposureNotificationSystemStatusAutomaticUpdater();
useEffect(() => {
return subscribeToStatusUpdates();
}, [subscribeToStatusUpdates]);
const startExposureNotificationService = useStartExposureNotificationService();
const updateExposureStatus = useUpdateExposureStatus();
useEffect(() => {
startExposureNotificationService();
updateExposureStatus();
}, [startExposureNotificationService, updateExposureStatus]);
const bottomSheetRef = useRef<BottomSheetBehavior>(null);
const [isBottomSheetExpanded, setIsBottomSheetExpanded] = useState(false);
const currentStatus = useExposureStatus().type;
const previousStatus = usePrevious(currentStatus);
useLayoutEffect(() => {
if (previousStatus === ExposureStatusType.Monitoring && currentStatus === ExposureStatusType.Diagnosed) {
bottomSheetRef.current?.collapse();
}
}, [currentStatus, previousStatus]);
useLayoutEffect(() => {
bottomSheetRef.current?.setOnStateChange(setIsBottomSheetExpanded);
}, []);
const fadeAnim = useRef(new Animated.Value(0)).current;
React.useEffect(
() =>
Animated.timing(fadeAnim, {
toValue: 1,
delay: 1000,
duration: 10,
useNativeDriver: false,
}).start(),
[fadeAnim],
);
return (
<NotificationPermissionStatusProvider>
<Box flex={1} alignItems="center" backgroundColor="mainBackground">
<Box
flex={1}
paddingTop="m"
paddingBottom="m"
alignSelf="stretch"
accessibilityElementsHidden={isBottomSheetExpanded}
importantForAccessibility={isBottomSheetExpanded ? 'no-hide-descendants' : undefined}
>
<SafeAreaView>
<Header />
<Animated.View style={[styles.card, {opacity: fadeAnim}]}>
<Content isBottomSheetExpanded={isBottomSheetExpanded} />
</Animated.View>
</SafeAreaView>
</Box>
<BottomSheet ref={bottomSheetRef} expandedComponent={ExpandedContent} collapsedComponent={CollapsedContent} />
</Box>
</NotificationPermissionStatusProvider>
);
}