Jelajahi Sumber

fix: deleted default export for components | refactored screens

Oleksandr Honcharov 1 tahun lalu
induk
melakukan
6a54d9cc37

+ 1 - 3
src/components/BigText/index.tsx

@@ -6,8 +6,6 @@ type Props = {
   children: ReactNode;
 };
 
-const BigText: FC<Props> = ({ children }) => {
+export const BigText: FC<Props> = ({ children }) => {
   return <Text style={styles.text}>{children}</Text>;
 };
-
-export default BigText;

+ 1 - 3
src/components/Button/index.tsx

@@ -10,7 +10,7 @@ type Props = {
   onPress?: () => void;
 };
 
-const Button: FC<Props> = ({ children, variant, onPress }) => {
+export const Button: FC<Props> = ({ children, variant, onPress }) => {
   return (
     <>
       {variant === ButtonVariants.OPACITY ? (
@@ -48,5 +48,3 @@ const TextButton: FC<VariantProps> = ({ onPress, children }) => (
     <Text style={[styles.text, styles.textButtonText]}>{children}</Text>
   </TouchableOpacity>
 );
-
-export default Button;

+ 1 - 3
src/components/CheckBox/index.tsx

@@ -11,7 +11,7 @@ type Props = {
   label?: string;
 };
 
-const CheckBox: FC<Props> = ({ value, onChange, label }) => {
+export const CheckBox: FC<Props> = ({ value, onChange, label }) => {
   return (
     <View style={styles.wrapper}>
       <Checkbox
@@ -24,5 +24,3 @@ const CheckBox: FC<Props> = ({ value, onChange, label }) => {
     </View>
   );
 };
-
-export default CheckBox;

+ 1 - 3
src/components/Header/index.tsx

@@ -10,7 +10,7 @@ type Props = {
   label: string;
 };
 
-const Header: FC<Props> = ({ label }) => {
+export const Header: FC<Props> = ({ label }) => {
   const navigation = useNavigation();
 
   // navigation.setOptions() TODO
@@ -29,5 +29,3 @@ const Header: FC<Props> = ({ label }) => {
     </View>
   );
 };
-
-export default Header;

+ 1 - 3
src/components/Input/index.tsx

@@ -10,7 +10,7 @@ type Props = {
   inputMode?: InputModeOptions;
 };
 
-const Input: FC<Props> = ({ onChange, placeholder, header, isPrivate, inputMode }) => {
+export const Input: FC<Props> = ({ onChange, placeholder, header, isPrivate, inputMode }) => {
   const [focused, setFocused] = useState(false);
 
   const styles = styling(focused);
@@ -30,5 +30,3 @@ const Input: FC<Props> = ({ onChange, placeholder, header, isPrivate, inputMode
     </View>
   );
 };
-
-export default Input;

+ 1 - 3
src/components/Modal/ModalHeader/modal-header.tsx

@@ -9,12 +9,10 @@ type Props = {
   textHeader: string;
 };
 
-const ModalHeader: FC<Props> = ({ textHeader }) => {
+export const ModalHeader: FC<Props> = ({ textHeader }) => {
   return (
     <View>
       <Text style={styles.textHeader}>{textHeader}</Text>
     </View>
   );
 };
-
-export default ModalHeader;

+ 1 - 3
src/components/Modal/index.tsx

@@ -7,7 +7,7 @@ type Props = {
   onRequestClose?: () => void;
 };
 
-const Modal: FC<Props> = ({ children, onRequestClose, visible }) => {
+export const Modal: FC<Props> = ({ children, onRequestClose, visible }) => {
   return (
     <ReactModal
       animationType={'slide'}
@@ -20,5 +20,3 @@ const Modal: FC<Props> = ({ children, onRequestClose, visible }) => {
     </ReactModal>
   );
 };
-
-export default Modal;

+ 1 - 3
src/components/PageWrapper/index.tsx

@@ -8,8 +8,6 @@ type Props = {
   style?: StyleProp<ViewStyle>;
 };
 
-const PageWrapper: FC<Props> = ({ children, style }) => {
+export const PageWrapper: FC<Props> = ({ children, style }) => {
   return <SafeAreaView style={[styles.wrapper, style]}>{children}</SafeAreaView>;
 };
-
-export default PageWrapper;

+ 1 - 5
src/screens/LoginScreen/index.tsx

@@ -2,11 +2,7 @@ import { FC, useState } from 'react';
 import { View } from 'react-native';
 import { NavigationProp } from '@react-navigation/native';
 
-import Header from '../../components/Header';
-import Input from '../../components/Input';
-import Button from '../../components/Button';
-import BigText from '../../components/BigText';
-import PageWrapper from '../../components/PageWrapper';
+import { Header, Input, Button, BigText, PageWrapper } from '../../components';
 
 import { ButtonVariants } from '../../types/components';
 import { storageSet } from '../../storage';

+ 8 - 8
src/screens/RegisterScreen/JoinUs/index.tsx

@@ -1,14 +1,14 @@
-import React, { useState } from 'react';
+import React, { FC, useState } from 'react';
 import { View } from 'react-native';
+import { NavigationProp } from '@react-navigation/native';
 
-import PageWrapper from '../../../components/PageWrapper';
-import Header from '../../../components/Header';
-import BigText from '../../../components/BigText';
-import Input from '../../../components/Input';
-import Button from '../../../components/Button';
-import CheckBox from '../../../components/CheckBox';
+import { PageWrapper, Header, Button, BigText, CheckBox, Input } from '../../../components';
 
-const JoinUsScreen = () => {
+type Props = {
+  navigation: NavigationProp<any>;
+};
+
+const JoinUsScreen: FC<Props> = ({ navigation }) => {
   const [agreed, setAgreed] = useState(false);
 
   return (

+ 1 - 4
src/screens/ResetPasswordDeepScreen/index.tsx

@@ -1,10 +1,7 @@
 import React, { useState } from 'react';
 import { Text, View } from 'react-native';
 
-import PageWrapper from '../../components/PageWrapper';
-import BigText from '../../components/BigText';
-import Input from '../../components/Input';
-import Button from '../../components/Button';
+import { PageWrapper, BigText, Input, Button } from '../../components/';
 
 import { styles } from './styles';
 

+ 1 - 6
src/screens/ResetPasswordScreen/index.tsx

@@ -2,12 +2,7 @@ import React, { FC, useState } from 'react';
 import { Text, View } from 'react-native';
 import type { NavigationProp } from '@react-navigation/native';
 
-import PageWrapper from '../../components/PageWrapper';
-import Header from '../../components/Header';
-import BigText from '../../components/BigText';
-import Button from '../../components/Button';
-import Input from '../../components/Input';
-
+import { PageWrapper, Header, BigText, Button, Input } from '../../components/';
 import { NAVIGATION_PAGES } from '../../types';
 
 import { styles } from './styles';

+ 1 - 1
src/screens/WelcomeScreen/index.tsx

@@ -2,7 +2,7 @@ import { FC } from 'react';
 import { ImageBackground, SafeAreaView, View, Text } from 'react-native';
 import type { NavigationProp } from '@react-navigation/native';
 
-import Button from '../../components/Button';
+import { Button } from '../../components/';
 import { ButtonVariants } from '../../types/components';
 
 import { styles } from './style';