diff --git a/packages/docs-gesture-handler/src/components/HeaderWithBadge/index.tsx b/packages/docs-gesture-handler/src/components/HeaderWithBadge/index.tsx deleted file mode 100644 index 1db156ae65..0000000000 --- a/packages/docs-gesture-handler/src/components/HeaderWithBadge/index.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import React from 'react'; -import { StyleSheet } from 'react-native'; - -type HeaderWithBadgeProps = { - platforms: string[]; - children?: React.ReactNode; -}; - -type Platform = 'android' | 'ios' | 'web'; - -const platformNameMap: Record = { - android: 'Android', - ios: 'iOS', - web: 'Web', -}; - -export function Badge({ platform }: { platform: Platform }) { - let platformBadgeStyle; - - switch (platform) { - case 'android': - platformBadgeStyle = styles.androidBadge; - break; - case 'ios': - platformBadgeStyle = styles.iosBadge; - break; - case 'web': - platformBadgeStyle = styles.webBadge; - break; - default: - platformBadgeStyle = {}; - } - - return ( -
- {platformNameMap[platform]} -
- ); -} - -export default function HeaderWithBadge({ - platforms, - children, -}: HeaderWithBadgeProps) { - return ( -
- {children} - - {platforms - .map((platform) => platform.toLowerCase() as Platform) - .sort() - .map((platform) => ( - - ))} -
- ); -} - -const styles = StyleSheet.create({ - container: { - display: 'flex', - flexDirection: 'row', - gap: 10, - marginBottom: 20, - }, - - badge: { - borderRadius: 10, - paddingTop: 2, - paddingBottom: 2, - paddingLeft: 10, - paddingRight: 10, - color: 'white', - - display: 'flex', - alignItems: 'center', - justifyContent: 'space-around', - }, - - androidBadge: { - backgroundColor: '#34a853', - }, - - iosBadge: { - backgroundColor: '#000000', - }, - - webBadge: { - backgroundColor: '#1067c4', - }, -}); diff --git a/packages/docs-gesture-handler/src/components/HeaderWithBadges/index.tsx b/packages/docs-gesture-handler/src/components/HeaderWithBadges/index.tsx index 1f706e21db..a4a37c167e 100644 --- a/packages/docs-gesture-handler/src/components/HeaderWithBadges/index.tsx +++ b/packages/docs-gesture-handler/src/components/HeaderWithBadges/index.tsx @@ -5,7 +5,7 @@ import styles from './styles.module.css'; import clsx from 'clsx'; type HeaderWithBadgesProps = { - platforms: string[]; + platforms?: string[]; version?: string; children?: React.ReactNode; };