-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
35 lines (27 loc) · 883 Bytes
/
App.js
File metadata and controls
35 lines (27 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React, { useState } from 'react'
import { StatusBar } from 'expo-status-bar'
import { StyleSheet, Text, View } from 'react-native'
import WelcomeScreen from './app/screens/WelcomeScreen'
import RecordScreen from './app/screens/RecordScreen'
import RecordedScreen from './app/screens/RecordedScreen'
import SavedSoundsScreen from './app/screens/SavedSoundsScreen'
const components = {
'Welcome': WelcomeScreen,
'Record': RecordScreen,
'Recorded': RecordedScreen,
'SavedSounds': SavedSoundsScreen
}
export default function App() {
const [page, setPage] = useState('Welcome')
const CurrentComponent = components[page]
// const CurrentComponent = SavedSoundsScreen
const handlePageUpdate = (newPage) => {
setPage(newPage)
}
return (
<CurrentComponent
handlePageUpdate={ handlePageUpdate } />
)
}
const styles = StyleSheet.create({
})