1+ import { useReducer } from 'react' ;
2+ import { Pressable , Text , View } from 'react-native' ;
3+ import { Panel , PanelGroup , assert } from 'react-native-resizable-panels' ;
4+
15import {
26 TUTORIAL_CODE_CSS ,
37 TUTORIAL_CODE_HTML ,
@@ -7,10 +11,8 @@ import {
711import { Code } from '@/components/Code' ;
812import { ExamplePage } from '@/components/ExamplePage' ;
913import { Icon } from '@/components/Icon' ;
14+ import { ResizeHandle } from '@/components/ResizeHandle' ;
1015import { colors , styles } from '@/styles/common' ;
11- import { useReducer } from 'react' ;
12- import { Pressable , Text , View } from 'react-native' ;
13- import { Panel , PanelGroup , PanelResizeHandle , assert } from 'react-native-resizable-panels' ;
1416
1517function Description ( ) {
1618 return (
@@ -25,7 +27,7 @@ const code = `<PanelGroup direction="horizontal">
2527 <Panel collapsible={true} collapsedSize={35} minSize={10}>
2628 <SourceBrowser />
2729 </Panel>
28- <PanelResizeHandle />
30+ <ResizeHandle />
2931 <Panel>
3032 <SourceViewer />
3133 </Panel>
@@ -38,7 +40,7 @@ type File = {
3840 path : string [ ] ;
3941} ;
4042
41- const FILE_PATHS : Array < [ path : string , code : string ] > = [
43+ const FILE_PATHS : [ path : string , code : string ] [ ] = [
4244 [ 'source/index.html' , TUTORIAL_CODE_HTML ] ,
4345 [ 'source/README.md' , TUTORIAL_CODE_README ] ,
4446 [ 'source/styles.css' , TUTORIAL_CODE_CSS ] ,
@@ -84,7 +86,7 @@ function reducer(state: FilesState, action: FilesAction): FilesState {
8486 const { file } = action ;
8587 const { currentFileIndex, openFiles } = state ;
8688
87- let fileIndex = openFiles . findIndex ( ( { fileName } ) => fileName === file . fileName ) ;
89+ const fileIndex = openFiles . findIndex ( ( { fileName } ) => fileName === file . fileName ) ;
8890 if ( fileIndex === - 1 ) {
8991 // File not open; this shouldn't happen.
9092 return state ;
@@ -188,9 +190,7 @@ export default function CollapsiblePanelsScreen() {
188190 ) ) }
189191 </ View >
190192 </ Panel >
191- < PanelResizeHandle
192- style = { fileListCollapsed ? styles . ResizeHandleCollapsed : styles . ResizeHandle }
193- />
193+ < ResizeHandle />
194194 < Panel style = { styles . PanelColumn } minSize = { 50 } >
195195 { currentFile && (
196196 < Code code = { currentFile . code . trim ( ) } language = { currentFile . language } showLineNumbers />
0 commit comments