Download User/src/components/ui/Loader.tsx from 0xarchit/CityTrack: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/0xarchit/CityTrack/resolve/main/User/src/components/ui/Loader.tsx
- Command line
-
hf download hf://spaces/0xarchit/CityTrack/User/src/components/ui/Loader.tsx
-
curl -L -o Loader.tsx https://huggingface.co/spaces/0xarchit/CityTrack/resolve/main/User/src/components/ui/Loader.tsx
1.01 kB
| import React from 'react'; | |
| import { View, ActivityIndicator, StyleSheet, ViewStyle } from 'react-native'; | |
| import { colors } from '../../theme'; | |
| interface LoaderProps { | |
| size?: 'small' | 'large'; | |
| color?: string; | |
| style?: ViewStyle; | |
| fullScreen?: boolean; | |
| } | |
| export const Loader: React.FC<LoaderProps> = ({ | |
| size = 'small', | |
| color = colors.primary.main, | |
| style, | |
| fullScreen = false | |
| }) => { | |
| if (fullScreen) { | |
| return ( | |
| <View style={[styles.fullScreen, style]}> | |
| <ActivityIndicator size={size} color={color} /> | |
| </View> | |
| ); | |
| } | |
| return ( | |
| <View style={[styles.container, style]}> | |
| <ActivityIndicator size={size} color={color} /> | |
| </View> | |
| ); | |
| }; | |
| const styles = StyleSheet.create({ | |
| container: { | |
| justifyContent: 'center', | |
| alignItems: 'center', | |
| padding: 10, | |
| }, | |
| fullScreen: { | |
| ...StyleSheet.absoluteFillObject, | |
| backgroundColor: 'rgba(255,255,255,0.8)', | |
| justifyContent: 'center', | |
| alignItems: 'center', | |
| zIndex: 999, | |
| }, | |
| }); | |