From b39cfaa64bf59a70f7be3785506e7581f0687764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwa=C5=9Bniewski?= Date: Mon, 4 Nov 2024 09:32:48 +0100 Subject: [PATCH] docs: update getting started (#120) --- .../docs/docs/getting-started/quick-start.mdx | 34 ++--------- .../guides/usage-with-react-navigation.mdx | 59 +++++++++++++------ .../docs/guides/usage-with-vector-icons.md | 30 +++++----- 3 files changed, 61 insertions(+), 62 deletions(-) diff --git a/docs/docs/docs/getting-started/quick-start.mdx b/docs/docs/docs/getting-started/quick-start.mdx index dac3072..bab492c 100644 --- a/docs/docs/docs/getting-started/quick-start.mdx +++ b/docs/docs/docs/getting-started/quick-start.mdx @@ -75,33 +75,9 @@ Here you can read more about [Android Native Styling](/docs/guides/android-nativ ## Example usage -:::warning -To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](https://reactnavigation.org/docs/getting-started). -::: +Please follow the guides below to integrate the library with your navigation library: -```tsx -import {createNativeBottomTabNavigator} from 'react-native-bottom-tabs/react-navigation'; - -const Tabs = createNativeBottomTabNavigator(); - -function NativeBottomTabs() { - return ( - - ({ sfSymbol: "house" }), - }} - /> - ({ sfSymbol: "person" }), - }} - /> - - ); -} -``` +- [Usage with React Navigation](/docs/guides/usage-with-react-navigation) +- [Usage with Expo Router](/docs/guides/usage-with-expo-router) +- [Usage with One](/docs/guides/usage-with-one) +- [Standalone usage](/docs/guides/standalone-usage) diff --git a/docs/docs/docs/guides/usage-with-react-navigation.mdx b/docs/docs/docs/guides/usage-with-react-navigation.mdx index c302c7d..a2cdf65 100644 --- a/docs/docs/docs/guides/usage-with-react-navigation.mdx +++ b/docs/docs/docs/guides/usage-with-react-navigation.mdx @@ -6,29 +6,52 @@ import { Badge } from '@theme'; To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](https://reactnavigation.org/docs/getting-started). ::: +Minimal example of using `createNativeBottomTabNavigator` with React Navigation: + ```tsx +import * as React from 'react'; +import { Text, View } from 'react-native'; +import { NavigationContainer } from '@react-navigation/native'; import { createNativeBottomTabNavigator } from 'react-native-bottom-tabs/react-navigation'; -const Tabs = createNativeBottomTabNavigator(); +const Tab = createNativeBottomTabNavigator(); + +function HomeScreen() { + return ( + + Home! + + ); +} + +function SettingsScreen() { + return ( + + Settings! + + ); +} -function NativeBottomTabs() { +export default function App() { return ( - - ({ sfSymbol: 'house' }), - }} - /> - ({ sfSymbol: 'person' }), - }} - /> - + + + ({ sfSymbol: 'book' }), + }} + /> + ({ sfSymbol: 'gear' }), + }} + /> + + ); } ``` diff --git a/docs/docs/docs/guides/usage-with-vector-icons.md b/docs/docs/docs/guides/usage-with-vector-icons.md index 9d91341..78adbe8 100644 --- a/docs/docs/docs/guides/usage-with-vector-icons.md +++ b/docs/docs/docs/guides/usage-with-vector-icons.md @@ -21,21 +21,21 @@ const Tabs = createNativeBottomTabNavigator(); function NativeBottomTabs() { return ( - - homeIcon, - }} - /> - exploreIcon, - }} - /> + + homeIcon, + }} + /> + exploreIcon, + }} + /> ); }