File tree Expand file tree Collapse file tree 6 files changed +77
-25
lines changed Expand file tree Collapse file tree 6 files changed +77
-25
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import { ShowcaseApp } from '@gorhom/showcase-template' ;
3- import { screens } from './src/screens' ;
4- import { version , description } from '../package.json' ;
5-
2+ import { StyleSheet } from 'react-native' ;
63import { GestureHandlerRootView } from 'react-native-gesture-handler' ;
4+ import Main from './src/Main' ;
75
86import { enableScreens } from 'react-native-screens' ;
97enableScreens ( true ) ;
@@ -12,23 +10,10 @@ enableScreens(true);
1210import { enableLogging } from '@gorhom/bottom-sheet' ;
1311enableLogging ( ) ;
1412
15- import { StyleSheet } from 'react-native' ;
16-
17- const author = {
18- username : 'Mo Gorhom' ,
19- url : 'https://gorhom.dev' ,
20- } ;
21-
2213export default function App ( ) {
2314 return (
2415 < GestureHandlerRootView style = { styles . container } >
25- < ShowcaseApp
26- name = "Bottom Sheet"
27- description = { description }
28- version = { version }
29- author = { author }
30- data = { screens }
31- />
16+ < Main />
3217 </ GestureHandlerRootView >
3318 ) ;
3419}
Original file line number Diff line number Diff line change 1+ import React , { useCallback , useMemo , useRef } from 'react' ;
2+ import { View , Text , StyleSheet } from 'react-native' ;
3+ import BottomSheet from '@gorhom/bottom-sheet' ;
4+
5+ const App = ( ) => {
6+ // ref
7+ const bottomSheetRef = useRef < BottomSheet > ( null ) ;
8+
9+ // variables
10+ const snapPoints = useMemo ( ( ) => [ '25%' , '50%' ] , [ ] ) ;
11+
12+ // callbacks
13+ const handleSheetChanges = useCallback ( ( index : number ) => {
14+ // eslint-disable-next-line no-console
15+ console . log ( 'handleSheetChanges' , index ) ;
16+ } , [ ] ) ;
17+
18+ // renders
19+ return (
20+ < View style = { styles . container } >
21+ < BottomSheet
22+ ref = { bottomSheetRef }
23+ index = { 1 }
24+ snapPoints = { snapPoints }
25+ onChange = { handleSheetChanges }
26+ >
27+ < View style = { styles . contentContainer } >
28+ < Text > Awesome 🎉</ Text >
29+ </ View >
30+ </ BottomSheet >
31+ </ View >
32+ ) ;
33+ } ;
34+
35+ const styles = StyleSheet . create ( {
36+ container : {
37+ flex : 1 ,
38+ padding : 24 ,
39+ backgroundColor : 'grey' ,
40+ } ,
41+ contentContainer : {
42+ flex : 1 ,
43+ alignItems : 'center' ,
44+ } ,
45+ } ) ;
46+
47+ export default App ;
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { ShowcaseApp } from '@gorhom/showcase-template' ;
3+ import { screens } from './screens' ;
4+ import { version , description } from '../../package.json' ;
5+
6+ const author = {
7+ username : 'Mo Gorhom' ,
8+ url : 'https://gorhom.dev' ,
9+ } ;
10+
11+ export default ( ) => (
12+ < ShowcaseApp
13+ name = "Bottom Sheet"
14+ description = { description }
15+ version = { version }
16+ author = { author }
17+ data = { screens }
18+ />
19+ ) ;
Original file line number Diff line number Diff line change 1+ import { ShowcaseExampleScreenSectionType } from '@gorhom/showcase-template' ;
12import { Platform } from 'react-native' ;
23
3- const screens = [ ] ;
4+ const screens : ShowcaseExampleScreenSectionType [ ] = [ ] ;
45
56//#region Basic Section
67const basicSection = {
Original file line number Diff line number Diff line change 4949 "@react-native/eslint-config" : " ^0.72.2" ,
5050 "@release-it/conventional-changelog" : " ^5.1.1" ,
5151 "@types/invariant" : " ^2.2.34" ,
52- "@types/react" : " ~ 18.2.45" ,
53- "@types/react-native" : " ^ 0.73.0" ,
52+ "@types/react" : " 18.2.45" ,
53+ "@types/react-native" : " 0.73.0" ,
5454 "auto-changelog" : " ^2.4.0" ,
5555 "copyfiles" : " ^2.4.1" ,
5656 "eslint" : " ^8.21.0" ,
6565 "react-native-gesture-handler" : " ^2.14.0" ,
6666 "react-native-reanimated" : " ^3.6.0" ,
6767 "release-it" : " ^15.11.0" ,
68- "typescript" : " ^5.0.2 "
68+ "typescript" : " ^5.3.0 "
6969 },
7070 "peerDependencies" : {
7171 "@types/react" : " *" ,
Original file line number Diff line number Diff line change 21932193 resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.11.tgz#2596fb352ee96a1379c657734d4b913a613ad563"
21942194 integrity sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==
21952195
2196- " @types/react-native@^ 0.73.0 " :
2196+ " @types/react-native@0.73.0 " :
21972197 version "0.73.0"
21982198 resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.73.0.tgz#b316be230745779814caa533360262140b0f5984"
21992199 integrity sha512-6ZRPQrYM72qYKGWidEttRe6M5DZBEV5F+MHMHqd4TTYx0tfkcdrUFGdef6CCxY0jXU7wldvd/zA/b0A/kTeJmA==
22002200 dependencies :
22012201 react-native "*"
22022202
2203- " @types/react@~ 18.2.45 " :
2203+ " @types/react@18.2.45 " :
22042204 version "18.2.45"
22052205 resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.45.tgz#253f4fac288e7e751ab3dc542000fb687422c15c"
22062206 integrity sha512-TtAxCNrlrBp8GoeEp1npd5g+d/OejJHFxS3OWmrPBMFaVQMSN0OFySozJio5BHxTuTeug00AVXVAjfDSfk+lUg==
@@ -8418,7 +8418,7 @@ typedarray@^0.0.6:
84188418 resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
84198419 integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==
84208420
8421- " typescript@^4.6.4 || ^5.2.2" , typescript@^5.0.2 :
8421+ " typescript@^4.6.4 || ^5.2.2" , typescript@^5.3.0 :
84228422 version "5.3.3"
84238423 resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37"
84248424 integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==
You can’t perform that action at this time.
0 commit comments