-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
031bcb3
commit 3f02d78
Showing
9 changed files
with
629 additions
and
839 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
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
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,76 @@ | ||
--- | ||
searchable: true | ||
--- | ||
|
||
import { CodeEditor } from '@components/code-editor'; | ||
|
||
# DraggableModal | ||
|
||
Component to render a draggable modal, based on `react-native-bottom-sheet` | ||
|
||
https://github.com/gorhom/react-native-bottom-sheet | ||
|
||
## Import | ||
|
||
```js | ||
import { DraggableModal } from 'react-native-ficus-ui'; | ||
``` | ||
|
||
## Usage | ||
|
||
<CodeEditor code={`const TestModal = () => { | ||
const { isOpen, onOpen, onClose } = useDisclosure(); | ||
return ( | ||
<ThemeProvider> | ||
<Box h={500} bg="gray.50" p="xl"> | ||
<Button | ||
colorScheme={!isOpen ? 'green' : 'red'} | ||
onPress={() => { | ||
if (!isOpen) { | ||
onOpen(); | ||
} else { | ||
onClose(); | ||
} | ||
}} | ||
> | ||
{!isOpen ? 'Show Modal' : 'Hide Modal'} | ||
</Button> | ||
<DraggableModal | ||
isOpen={isOpen} | ||
onClose={onClose} | ||
snapPoints={['30%', '80%']} | ||
p="xl" | ||
> | ||
<Text fontSize="4xl" fontWeight="bold"> | ||
Settings | ||
</Text> | ||
<Text mt="xl">Your settings</Text> | ||
</DraggableModal> | ||
</Box> | ||
</ThemeProvider> | ||
); | ||
} | ||
render(<TestModal />)`} noInline /> | ||
|
||
## Props | ||
|
||
Extends every `Box` props and `BottomSheetModalProps` from `react-native-bottom-sheet` | ||
|
||
### `isOpen` | ||
|
||
Boolean to indicate if modal is opened or not. | ||
|
||
| Type | Required | Default | | ||
| ------- | -------- | ------- | | ||
| boolean | No | false | | ||
|
||
### `onClose` | ||
|
||
Method called when modal is closed by user. | ||
|
||
| Type | Required | | ||
| ------- | -------- | | ||
| () => void | No | |
Oops, something went wrong.