-
Notifications
You must be signed in to change notification settings - Fork 949
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(playground): missing spinner showcases add
- Loading branch information
Showing
3 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 33 additions & 1 deletion
34
src/playground/src/ui/screen/spinner/spinnerShowcase.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,43 @@ | ||
import React from 'react'; | ||
import { | ||
StyleSheet, | ||
View, | ||
ViewProps, | ||
} from 'react-native'; | ||
import { | ||
Spinner, | ||
SpinnerProps, | ||
SpinnerElement, | ||
} from '@kitten/ui'; | ||
|
||
export const SpinnerShowcase = (props?: SpinnerProps): React.ReactElement<SpinnerProps> => { | ||
export const SpinnerShowcase = (props?: SpinnerProps): SpinnerElement => { | ||
if (props.status === 'white') { | ||
return WhiteSpinner(props); | ||
} else { | ||
return DefaultSpinner(props); | ||
} | ||
}; | ||
|
||
const DefaultSpinner = (props?: SpinnerProps): SpinnerElement => { | ||
return ( | ||
<Spinner {...props} /> | ||
); | ||
}; | ||
|
||
const WhiteSpinner = (props?: SpinnerProps): React.ReactElement<ViewProps> => { | ||
return ( | ||
<View style={styles.blackSpinnerContainer}> | ||
<Spinner {...props} /> | ||
</View> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
blackSpinnerContainer: { | ||
width: 40, | ||
height: 40, | ||
backgroundColor: '#7f7e82', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters