/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 */

import {
  Animated,
  Button,
  Image,
  StatusBar,
  StyleSheet,
  useColorScheme,
  View,
} from 'react-native';
import * as navigation from '@common/NavigationHelper.ts';
import { Apps } from '@common/NavigationHelper.ts';
import ScrollView = Animated.ScrollView;
import TestNativeInfo from '@app/TestNativeInfo';
import { showMessage } from '@common/ToastHelper.ts';
import Toast from 'react-native-toast-message';

function App() {
  const isDarkMode = useColorScheme() === 'dark';

  return (
    <View style={styles.container}>
      <StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
      <View style={{ height: 100 }} />
      <Button
        title={'进入互联网医院'}
        onPress={() => {
          navigation.pushByName('hospital', {});
        }}
      />
      <View style={{ height: 15 }} />
      <Button
        title={'进入医网签'}
        onPress={() => {
          navigation.pushByName(Apps.Ywq, {});
        }}
      />
      <View style={{ height: 15 }} />
      <Button
        title={'Toast'}
        onPress={() => {
          showMessage('APP页面弹出toast')
        }}
      />
      <ScrollView style={styles.flatContainer}>
        <View style={styles.imgView}>
          <Image
            resizeMethod="resize"
            resizeMode="contain"
            source={require('@app/resource/images/icon_sign_scan.png')}
          />
          <TestNativeInfo />
        </View>
      </ScrollView>
      <Toast />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  imgView: {
    width: "100%",
  },
  img: {
    width: "100%",
    height: 600,
  },
  flatContainer: {
    flex: 1,
  },
});

export default App;
