Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2327a04
box props correction
makkarMeenu Aug 3, 2021
0a17dd1
moved excess docs to unreleased list
makkarMeenu Aug 6, 2021
dd5ce8d
Merge pull request #70 from GeekyAnts/minor
surajahmed Sep 13, 2021
cd5b358
Merge branch 'main' of github.com:GeekyAnts/nativebase-docs into feat…
Sep 14, 2021
620170e
Changed flex and created v3.2.0 again
Sep 14, 2021
9b961d3
Merge branch 'minor' of github.com:GeekyAnts/nativebase-docs into sta…
himanshu-satija Sep 17, 2021
5ee41f9
Merge pull request #36 from GeekyAnts/fix/box-props
Ajamuar Sep 20, 2021
e88d0c9
Merge pull request #80 from GeekyAnts/minor
surajahmed Sep 20, 2021
09b6dc2
Merge pull request #83 from GeekyAnts/minor
surajahmed Sep 21, 2021
5be0ea7
Merge branch 'staging' of github.com:GeekyAnts/nativebase-docs into f…
Sep 21, 2021
9cf053e
Merge pull request #84 from GeekyAnts/fix/testing
Ajamuar Sep 21, 2021
d0748f0
using theme file design changes
makkarMeenu Sep 21, 2021
3bb1aa0
Resolved Conflicts
Sep 21, 2021
31fb437
Merge pull request #86 from GeekyAnts/fix/using-theme-design-changes
Ajamuar Sep 21, 2021
a876646
Resolved Conflicts
Sep 21, 2021
22acc62
Changed version for snackplayer
Sep 21, 2021
d82bba2
Snack player version updated
surajahmed Sep 21, 2021
2145d2a
Merge branch 'main' of github.com:GeekyAnts/nativebase-docs into feat…
surajahmed Sep 21, 2021
75db6ff
design changes
makkarMeenu Sep 21, 2021
a881d43
Snack player version updated
surajahmed Sep 21, 2021
0411511
Updated migration guide
surajahmed Sep 21, 2021
7ff9686
Merge pull request #87 from GeekyAnts/fix/hotfixes
Ajamuar Sep 21, 2021
165df60
Merge branch 'minor' into feat/strict-mode-changes
Ajamuar Sep 21, 2021
0560249
Merge pull request #89 from GeekyAnts/fix/migration-guide
Ajamuar Sep 21, 2021
15b38ef
Merge pull request #88 from GeekyAnts/feat/strict-mode-changes
Ajamuar Sep 21, 2021
852a717
Updated version
surajahmed Sep 21, 2021
849ef39
Merge pull request #90 from GeekyAnts/fix/version-3.2.0
surajahmed Sep 21, 2021
de5424a
Merge branch 'staging' of github.com:GeekyAnts/nativebase-docs into m…
surajahmed Sep 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion build-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ const cloneRepos = () => {
shellJS.exec('git clone ' + URL);
shellJS.cd('NativeBase');

const a = shellJS.exec('git checkout ' + 'v' + v);
let a = shellJS.exec('git checkout ' + 'v' + v);

//TODO: 3.2.0-hack
if (v === '3.2.0') {
a = shellJS.exec('git checkout ' + 'master');
}
if (a.code !== 0) {
shellJS.exec('git checkout ' + FALLBACK_BRANCH);
shellJS.exec('git pull');
Expand Down
118 changes: 8 additions & 110 deletions docs/alertDialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,110 +24,8 @@ import { AlertDialog } from 'native-base';

### Basic

```SnackPlayer name=AlertDialog%20Basic
import React from "react";
import {
AlertDialog,
Button,
Center,
NativeBaseProvider,
} from "native-base";

function AlertDialogComponent() {
const [isOpen, setIsOpen] = React.useState(false);
const onClose = () => setIsOpen(false);
const cancelRef = React.useRef();
return (
<Center>
<AlertDialog
leastDestructiveRef={cancelRef}
isOpen={isOpen}
onClose={onClose}
motionPreset={"fade"}
>
<AlertDialog.Content>
<AlertDialog.Header fontSize="lg" fontWeight="bold">
Delete Customer
</AlertDialog.Header>
<AlertDialog.Body>
Are you sure? You can't undo this action afterwards.
</AlertDialog.Body>
<AlertDialog.Footer>
<Button ref={cancelRef} onPress={onClose}>
Cancel
</Button>
<Button colorScheme="red" onPress={onClose} ml="3">
Delete
</Button>
</AlertDialog.Footer>
</AlertDialog.Content>
</AlertDialog>
<Button colorScheme="danger" onPress={() => setIsOpen(!isOpen)}>
Delete Customer
</Button>
</Center>
);
}
export default function () {
return (
<NativeBaseProvider>
<Center flex="1">
<AlertDialogComponent />
</Center>
</NativeBaseProvider>
);
}
```
```ComponentSnackPlayer path=composites,AlertDialog,basic.tsx

### Transition

```SnackPlayer name=AlertDialog%20Transition
import React from "react";
import { AlertDialog, Button, Center, NativeBaseProvider } from "native-base";

function AlertDialogComponent() {
const [isOpen, setIsOpen] = React.useState(false);
const onClose = () => setIsOpen(false);
const cancelRef = React.useRef();
return (
<Center>
<AlertDialog
motionPreset="fade"
leastDestructiveRef={cancelRef}
onClose={onClose}
isOpen={isOpen}
isCentered
>
<AlertDialog.Content>
<AlertDialog.CloseButton />
<AlertDialog.Header>Discard Changes?</AlertDialog.Header>
<AlertDialog.Body>
Are you sure you want to discard all of your notes? 44 words will be
deleted.
</AlertDialog.Body>
<AlertDialog.Footer>
<Button ref={cancelRef} onPress={onClose}>
No
</Button>
<Button colorScheme="red" ml={3}>
Yes
</Button>
</AlertDialog.Footer>
</AlertDialog.Content>
</AlertDialog>
<Button onPress={() => setIsOpen(!isOpen)}>Discard</Button>
</Center>
);
}
export default function () {
return (
<NativeBaseProvider>
<Center flex="1">
<AlertDialogComponent />
</Center>
</NativeBaseProvider>
);
}
```

## Styling
Expand All @@ -149,12 +47,12 @@ Adheres to the [Alert and Message Dialogs WAI-ARIA design pattern.](https://www.

### Keyboard Interactions

| Name | Description |
| --------------------|-------------|
| Space | Opens/closes the dialog. |
| Enter | Opens/closes the dialog. |
| Tab | Moves focus to the next focusable element. |
| Shift + Tab | Moves focus to the previous focusable element. |
| Esc | Closes the dialog and moves focus to AlertDialog.Trigger. |
| Name | Description |
| ----------- | --------------------------------------------------------- |
| Space | Opens/closes the dialog. |
| Enter | Opens/closes the dialog. |
| Tab | Moves focus to the next focusable element. |
| Shift + Tab | Moves focus to the previous focusable element. |
| Esc | Closes the dialog and moves focus to AlertDialog.Trigger. |


15 changes: 8 additions & 7 deletions docs/box.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,21 @@ import { Box, Center, NativeBaseProvider } from "native-base"

export const Example = () => {
return (
<Box
<Box
bg={{
linearGradient: {
colors: ["lightBlue.300", "violet.800"],
colors: ['lightBlue.300', 'violet.800'],
start: [0, 0],
end: [1, 0],
},
}}
p="12"
rounded="lg"
rounded="xl"
_text={{
fontSize: "md",
fontWeight: "bold",
color: "white",
fontSize: 'md',
fontWeight: 'medium',
color: 'warmGray.50',
textAlign: 'center',
}}
>
This is a Box with Linear Gradient
Expand All @@ -63,7 +64,7 @@ const config = {
export default () => {
return (
<NativeBaseProvider config={config}>
<Center flex="1">
<Center flex={1} px="3">
<Example />
</Center>
</NativeBaseProvider>
Expand Down
4 changes: 2 additions & 2 deletions docs/buildingDrawerNavigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function Component(props) {
<Pressable onPress={() => props.navigation.toggleDrawer()} position="absolute" ml="2" zIndex="1">
<HamburgerIcon ml="2" size="sm"/>
</Pressable>
<Center flex="1" >
<Center flex={1} >
<Heading size="md">{props.route.name}</Heading>
</Center>
</HStack>
Expand Down Expand Up @@ -148,7 +148,7 @@ function CustomDrawerContent(props) {
}
function MyDrawer() {
return (
<Box safeArea flex="1" >
<Box safeArea flex={1} >
<Drawer.Navigator
drawerContent={(props) => <CustomDrawerContent {...props} />}
>
Expand Down
21 changes: 12 additions & 9 deletions docs/buildingFooterTabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ export default function App() {
const [selected, setSelected] = React.useState(1);
return (
<NativeBaseProvider>
<Box flex="1" bg="white" safeAreaTop>
<Center flex="1"></Center>
<Box flex={1} bg="white" safeAreaTop>
<Center flex={1}></Center>
<HStack bg="indigo.600" alignItems="center" safeAreaBottom shadow={6}>
<Pressable
cursor="pointer"
opacity={selected === 0 ? 1 : 0.5}
py="3"
flex="1"
flex={1}
onPress={() => setSelected(0)}>
<Center>
<Icon
Expand All @@ -59,9 +59,10 @@ export default function App() {
<Pressable
cursor="pointer"
opacity={selected === 1 ? 1 : 0.5}
py={2}
py="2"
flex={1}
onPress={() => setSelected(1)}>
onPress={() => setSelected(1)}
>
<Center>
<Icon
mb="1"
Expand All @@ -78,8 +79,9 @@ export default function App() {
cursor="pointer"
opacity={selected === 2 ? 1 : 0.6}
py="2"
flex="1"
onPress={() => setSelected(2)}>
flex={1}
onPress={() => setSelected(2)}
>
<Center>
<Icon
mb={1}
Expand All @@ -100,8 +102,9 @@ export default function App() {
cursor="pointer"
opacity={selected === 3 ? 1 : 0.5}
py="2"
flex="1"
onPress={() => setSelected(3)}>
flex={1}
onPress={() => setSelected(3)}
>
<Center>
<Icon
mb={1}
Expand Down
4 changes: 2 additions & 2 deletions docs/buildingSearchBar.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ function SearchBar() {
export default function () {
return (
<NativeBaseProvider>
<Center flex="1" px="2">
<SearchBar />
<Center flex={1} px="2">
<SearchBar/>
</Center>
</NativeBaseProvider>
);
Expand Down
3 changes: 0 additions & 3 deletions docs/buildingSwipeList.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,9 @@ function Basic() {
<Box>
<Pressable onPress={() => console.log('You touched me')} bg="white">
<Box
borderBottomWidth="1"
borderColor="coolGray.200"
pl="4"
pr="5"
py="2"
_dark={{ borderColor: 'gray.600' }}
>
<HStack alignItems="center" space={3}>
<Avatar size="48px" source={{ uri: item.avatarUrl }} />
Expand Down
10 changes: 5 additions & 5 deletions docs/buildingTabView.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import { TabView, SceneMap } from 'react-native-tab-view';
import { NativeBaseProvider, Box, Text, Center } from 'native-base';
import Constants from 'expo-constants';

const FirstRoute = () => <Center flex="1">This is Tab 1</Center>;
const FirstRoute = () => <Center flex={1}>This is Tab 1</Center>;

const SecondRoute = () => <Center flex="1">This is Tab 2</Center>;
const SecondRoute = () => <Center flex={1}>This is Tab 2</Center>;

const ThirdRoute = () => <Center flex="1">This is Tab 3</Center>;
const ThirdRoute = () => <Center flex={1}>This is Tab 3</Center>;

const FourthRoute = () => <Center flex="1">This is Tab 4 </Center>;
const FourthRoute = () => <Center flex={1}>This is Tab 4 </Center>;

const initialLayout = { width: Dimensions.get('window').width };

Expand Down Expand Up @@ -69,7 +69,7 @@ export default function TabViewExample() {
<Box
borderBottomWidth="3"
borderColor={borderColor}
flex="1"
flex={1}
alignItems="center"
p="3"
cursor="pointer">
Expand Down
2 changes: 1 addition & 1 deletion docs/builldingCard.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function CardComponent(){
export default function () {
return (
<NativeBaseProvider>
<Center flex="1" px="3">
<Center flex={1} px="3">
<CardComponent/>
</Center>
</NativeBaseProvider>
Expand Down
Loading