YwqMain.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /**
  2. * Sample React Native App
  3. * https://github.com/facebook/react-native
  4. *
  5. * @format
  6. */
  7. import {
  8. Button,
  9. StatusBar,
  10. StyleSheet,
  11. Text,
  12. useColorScheme,
  13. View,
  14. } from 'react-native';
  15. import { showMessage } from '@common/ToastHelper.ts';
  16. import Toast from 'react-native-toast-message';
  17. import Alert from '@common/components/Alert.tsx';
  18. import { NavigationPop } from '@common/NavigationHelper.ts';
  19. import { versionName } from '@ywx/ywq.ts';
  20. function YwqMain() {
  21. const isDarkMode = useColorScheme() === 'dark';
  22. return (
  23. <View style={styles.container}>
  24. <StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
  25. <View style={{ height: 100 }} />
  26. <Text>医网签{versionName}</Text>
  27. <Button
  28. title={'onConfirm'}
  29. onPress={() => {
  30. Alert.show('hello Alert', undefined, {
  31. action: () => {
  32. NavigationPop();
  33. },
  34. });
  35. }}
  36. />
  37. <View style={{ height: 15 }} />
  38. <Button
  39. title={'Toast'}
  40. onPress={() => {
  41. showMessage('医网签弹出toast-error', 'error');
  42. }}
  43. />
  44. <Toast />
  45. {/*<Alert ref={ref => Alert.setRef(ref)} />*/}
  46. </View>
  47. );
  48. }
  49. const styles = StyleSheet.create({
  50. container: {
  51. flex: 1,
  52. },
  53. });
  54. export default YwqMain;