File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' @react-native-ama/extras ' : minor
3+ ---
4+
5+ Added new ` <Loading /> ` component to ` extras ` package
Original file line number Diff line number Diff line change 1+ ---
2+ ' @react-native-ama/core ' : patch
3+ ---
4+
5+ add export for ` AutofocusContainerProps ` type from ` core ` package
Original file line number Diff line number Diff line change 1+ ---
2+ ' @examples/shared-ui ' : minor
3+ ' amaexample ' : minor
4+ ' ama-expo-example ' : minor
5+ ---
6+
7+ Added ` <Loading /> ` component example screens
Original file line number Diff line number Diff line change 99 FormScreen ,
1010 Header ,
1111 HomeScreen ,
12+ LoadingScreen ,
1213 PressableScreen ,
1314 SwitchListItemScreen ,
1415 TextScreen ,
@@ -195,6 +196,14 @@ export const AppNavigator = () => {
195196 headerTitle : ( ) => < Header title = { 'Carousel Demo' } autofocus /> ,
196197 } }
197198 />
199+ < Stack . Screen
200+ name = "Loading"
201+ component = { LoadingScreen }
202+ options = { {
203+ headerLeft : ( ) => < BackButton /> ,
204+ headerTitle : ( ) => < Header title = { 'Carousel Demo' } autofocus /> ,
205+ } }
206+ />
198207 < Stack . Screen
199208 name = "UseTimedAction"
200209 component = { UseTimedActionScreen }
@@ -245,6 +254,7 @@ type StackParamList = {
245254 FlatListStatic : undefined ;
246255 BottomSheet : undefined ;
247256 Carousel : undefined ;
257+ Loading : undefined ;
248258 UseTimedAction : undefined ;
249259 UseAMAContext : undefined ;
250260} ;
Original file line number Diff line number Diff line change 99 FormScreen ,
1010 Header ,
1111 HomeScreen ,
12+ LoadingScreen ,
1213 PressableScreen ,
1314 SwitchListItemScreen ,
1415 TextScreen ,
@@ -195,6 +196,14 @@ export const AppNavigator = () => {
195196 headerTitle : ( ) => < Header title = { 'Carousel Demo' } autofocus /> ,
196197 } }
197198 />
199+ < Stack . Screen
200+ name = "Loading"
201+ component = { LoadingScreen }
202+ options = { {
203+ headerLeft : ( ) => < BackButton /> ,
204+ headerTitle : ( ) => < Header title = { 'Carousel Demo' } autofocus /> ,
205+ } }
206+ />
198207 < Stack . Screen
199208 name = "UseTimedAction"
200209 component = { UseTimedActionScreen }
@@ -245,6 +254,7 @@ type StackParamList = {
245254 FlatListStatic : undefined ;
246255 BottomSheet : undefined ;
247256 Carousel : undefined ;
257+ Loading : undefined ;
248258 UseTimedAction : undefined ;
249259 UseAMAContext : undefined ;
250260} ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ export { Header } from './src/components/Header';
77export { Spacer } from './src/components/Spacer' ;
88
99// Screens
10+ export { LoadingScreen } from './src/screens/Loading.screen' ;
1011export { CarouselScreen } from './src/screens/Carousel.screen' ;
1112export { BottomSheetScreen } from './src/screens/BottomSheet.screen' ;
1213export { ExpandablePressableScreen } from './src/screens/ExpandablePressableScreen' ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @examples/shared-ui" ,
3- "version" : " 0 .0.1" ,
3+ "version" : " 1 .0.1" ,
44 "description" : " Example Apps shared UI components" ,
55 "private" : true ,
66 "react-native" : " index" ,
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ export const HomeScreen = ({ navigation }) => {
5757 < Spacer height = { 'normal' } />
5858
5959 < CTAPressable title = "Carousel" onPress = { ( ) => navigate ( 'Carousel' ) } />
60+ < Spacer height = { 'normal' } />
61+ < CTAPressable title = "Loading" onPress = { ( ) => navigate ( 'Loading' ) } />
6062
6163 { /* */ }
6264 < Spacer height = { 'big' } />
Original file line number Diff line number Diff line change 1+ import { Loading } from '@react-native-ama/extras' ;
2+ import React from 'react' ;
3+ import { StyleSheet , View } from 'react-native' ;
4+
5+ import { CTAPressable } from '../components/CTAPressable' ;
6+ import { theme } from '../theme' ;
7+
8+ export const LoadingScreen = ( ) => {
9+ const [ isLoading , setIsLoading ] = React . useState ( false ) ;
10+
11+ const triggerLoading = ( ) => {
12+ setIsLoading ( true ) ;
13+ setTimeout ( ( ) => {
14+ setIsLoading ( false ) ;
15+ } , 1500 ) ;
16+ } ;
17+
18+ return (
19+ < View style = { styles . container } >
20+ < Loading isLoading = { isLoading } />
21+ < CTAPressable title = "Trigger Loading" onPress = { triggerLoading } />
22+ </ View >
23+ ) ;
24+ } ;
25+
26+ const styles = StyleSheet . create ( {
27+ container : {
28+ flex : 1 ,
29+ paddingHorizontal : theme . padding . big ,
30+ paddingTop : theme . padding . big ,
31+ } ,
32+ } ) ;
Original file line number Diff line number Diff line change 11// Components
2- export { AutofocusContainer } from './components/AutofocusContainer' ;
2+ export {
3+ AutofocusContainer ,
4+ type AutofocusContainerProps ,
5+ } from './components/AutofocusContainer' ;
36export {
47 AMAProvider ,
58 useAMAContext ,
You can’t perform that action at this time.
0 commit comments