diff --git a/.github/workflows/deploy.yml b/.github/workflows/build.yml similarity index 96% rename from .github/workflows/deploy.yml rename to .github/workflows/build.yml index 5d671c423..20b0a85e1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ concurrency: cancel-in-progress: true jobs: - deploy: + build-deploy: runs-on: ubuntu-latest defaults: run: @@ -51,6 +51,9 @@ jobs: - name: 📦 Install dependencies run: yarn install --pure-lockfile --non-interactive + - name: 📦 Run lint + run: yarn lint + - name: 📦 Publish staging if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }} run: expo publish --release-channel=staging --non-interactive diff --git a/.github/workflows/submit.yml b/.github/workflows/submit.yml new file mode 100644 index 000000000..afbad2cb1 --- /dev/null +++ b/.github/workflows/submit.yml @@ -0,0 +1,58 @@ +name: submit app to play store + + +on : + push : + branches : [ master ] + +jobs: + submit: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: ./app + + steps: + - name: 🏗 Setup repo + uses: actions/checkout@v3 + + - name: 🏗 Setup node + uses: actions/setup-node@v3 + with: + node-version: 16.x + cache: yarn + cache-dependency-path: app/yarn.lock + + - name: 🏗 Config files + run: | + echo "$GOOGLE_SERVICES" > google-services.json + echo "$FIREBASE_CONFIG_DEV" > ./src/config/authmiaajuda-firebase-dev.json + echo "$FIREBASE_CONFIG" > ./src/config/authmiaajuda-firebase.json + echo "$ENV_VARIABLE" > .env + echo "$SERVICE_ACCOUNT_KEY" > ./serviceAccountKey.json + env: + GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }} + FIREBASE_CONFIG_DEV: ${{ secrets.FIREBASE_CONFIG_DEV }} + FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }} + ENV_VARIABLE: ${{ secrets.ENV_VARIABLE }} + SERVICE_ACCOUNT_KEY: ${{ secrets.SERVICE_ACCOUNT_KEY }} + + - name: 🏗 Setup Expo and EAS + uses: expo/expo-github-action@v7 + with: + expo-version: latest + eas-version: latest + token: ${{ secrets.EXPO_TOKEN }} + + - name: 📦 Install dependencies + run: yarn install --pure-lockfile --non-interactive + + - name: 📦 Build prod aab by expo build + run: expo build:android -t app-bundle --release-channel=prod --non-interactive + + - name: 📦 Retrieve last build url version + run: echo "BUILD_URL=$(expo url:apk)" >> $GITHUB_ENV + + - name: 📦 Submit latest aab build to play store as production app + run: eas submit -p android --url ${{ env.BUILD_URL }} \ No newline at end of file diff --git a/app/App.js b/app/App.js index 7eff8fefa..0ad3138d2 100644 --- a/app/App.js +++ b/app/App.js @@ -2,8 +2,7 @@ import 'react-native-gesture-handler'; import React, { useEffect, useState } from 'react'; import Root from './src/index'; import loadFonts from './assets/fonts/loadFonts'; -import { View, LogBox } from 'react-native'; -import { AppRegistry } from 'react-native'; +import { View, LogBox, AppRegistry } from 'react-native'; LogBox.ignoreLogs(['Unrecognized WebSocket']); diff --git a/app/app.config.js b/app/app.config.js index c708ba245..1bdf52268 100644 --- a/app/app.config.js +++ b/app/app.config.js @@ -20,7 +20,7 @@ export default ({ config }) => { apiKey: MAPS_API_KEY, }, }, - versionCode: 211, + versionCode: 220, }, }; }; diff --git a/app/app.json b/app/app.json index 811d6d661..57db01cb4 100644 --- a/app/app.json +++ b/app/app.json @@ -9,7 +9,7 @@ "color": "#4b8ab9", "androidMode": "default" }, - "version": "2.1.0 Mutt", + "version": "2.2.0 Mutt", "orientation": "portrait", "icon": "./assets/images/logo.png", "splash": { diff --git a/app/eas.json b/app/eas.json new file mode 100644 index 000000000..300f4ac88 --- /dev/null +++ b/app/eas.json @@ -0,0 +1,19 @@ +{ + "cli": { + "version": ">= 0.57.0" + }, + "submit": { + "production": { + "android": { + "serviceAccountKeyPath": "./serviceAccountKey.json", + "track": "production" + } + }, + "alpha_test": { + "android": { + "serviceAccountKeyPath": "./serviceAccountKey.json", + "track": "alpha" + } + } + } +} diff --git a/app/metro.config.js b/app/metro.config.js index 906f852cd..62fbec05b 100644 --- a/app/metro.config.js +++ b/app/metro.config.js @@ -1,19 +1,14 @@ -const { getDefaultConfig } = require('metro-config'); +const { getDefaultConfig } = require('expo/metro-config'); -module.exports = (async () => { - const { - resolver: { sourceExts, assetExts }, - } = await getDefaultConfig(); +const config = getDefaultConfig(__dirname); - return { - transformer: { - babelTransformerPath: require.resolve( - 'react-native-svg-transformer', - ), - }, - resolver: { - assetExts: assetExts.filter((ext) => ext !== 'svg'), - sourceExts: [...sourceExts, 'svg'], - }, - }; -})(); +config.transformer.babelTransformerPath = require.resolve( + 'react-native-svg-transformer', +); + +config.resolver.assetExts = config.resolver.assetExts.filter( + (ext) => ext !== 'svg', +); +config.resolver.sourceExts = [...config.resolver.sourceExts, 'svg']; + +module.exports = config; diff --git a/app/package.json b/app/package.json index 8bb1ad4cd..0e2dd874b 100644 --- a/app/package.json +++ b/app/package.json @@ -25,12 +25,15 @@ "@react-navigation/stack": "^5.2.9", "axios": "^0.21.1", "expo": "^45.0.0", + "expo-dev-client": "~1.0.1", "expo-device": "~4.2.0", "expo-facebook": "~12.2.0", "expo-google-app-auth": "~8.3.0", "expo-image-picker": "~13.1.1", "expo-location": "~14.2.2", "expo-notifications": "~0.15.4", + "expo-splash-screen": "~0.15.1", + "expo-system-ui": "~1.2.0", "expo-updates": "~0.13.4", "firebase": "8.2.3", "jwt-decode": "^3.1.2", diff --git a/app/src/ExternalServices/ViaCep.js b/app/src/ExternalServices/ViaCep.js index 11889d30c..ac6ab0fb8 100644 --- a/app/src/ExternalServices/ViaCep.js +++ b/app/src/ExternalServices/ViaCep.js @@ -3,7 +3,7 @@ class Viacep { async getCepInformation(currentCep) { const url = `https://viacep.com.br/ws/${currentCep}/json/`; const cepInformation = await axios.get(url); - if (cepInformation.data.erro) throw { message: 'cep inválido' }; + if (cepInformation.data.erro) throw new Error('cep inválido'); return cepInformation.data; } } diff --git a/app/src/Navigation/MainNavigation/BottomNavigator/index.js b/app/src/Navigation/MainNavigation/BottomNavigator/index.js index 190c0e739..a24928e4a 100644 --- a/app/src/Navigation/MainNavigation/BottomNavigator/index.js +++ b/app/src/Navigation/MainNavigation/BottomNavigator/index.js @@ -23,7 +23,8 @@ const BottomTab = () => { navigationIconsConfig(focused, route), })} initialRouteName="main" - backBehavior="initialRoute"> + backBehavior="initialRoute" + > ( - - - {emergencyNumbers.map((numbers) => { - return ( - - {numbers.number} - - {' '} - {numbers.description}{' '} - - - ); - })} - - - ); - return ( - setVisible(false)} - animationType="fade"> - - - { - setVisible(false); - }} - style={styles.icon}> - - - {renderEmergencyNumbersList()} - - - + setVisible={setVisible} + list={emergencyNumbers} + /> ); } diff --git a/app/src/components/FAQModals/EmergencyNumbersModal/styles.js b/app/src/components/FAQModals/EmergencyNumbersModal/styles.js deleted file mode 100644 index 81c4fb868..000000000 --- a/app/src/components/FAQModals/EmergencyNumbersModal/styles.js +++ /dev/null @@ -1,46 +0,0 @@ -import { StyleSheet } from 'react-native'; -import colors from '../../../../assets/styles/colorVariables'; - -const minimumTextSize = 16; - -const styles = StyleSheet.create({ - modalContainer: { - width: '100%', - height: '100%', - backgroundColor: 'rgba(0,0,0,0.3)', - }, - - modalContent: { - paddingTop: 50, - backgroundColor: colors.light, - padding: 20, - marginBottom: 50, - borderRadius: 20, - top: '2.5%', - }, - - title: { - alignSelf: 'center', - marginBottom: 10, - fontFamily: 'montserrat-semibold', - color: colors.primary, - fontSize: minimumTextSize * 1.5, - }, - - description: { - textAlign: 'center', - marginBottom: 10, - fontFamily: 'montserrat-semibold', - color: colors.primary, - fontSize: minimumTextSize * 1.2, - }, - - icon: { - top: '5.5%', - right: 20, - position: 'absolute', - zIndex: 5, - }, -}); - -export default styles; diff --git a/app/src/components/FAQModals/HowToUseModal/HowToChoseHelpOfferModal/index.js b/app/src/components/FAQModals/HowToUseModal/HowToChoseHelpOfferModal/index.js deleted file mode 100644 index 8e303895a..000000000 --- a/app/src/components/FAQModals/HowToUseModal/HowToChoseHelpOfferModal/index.js +++ /dev/null @@ -1,50 +0,0 @@ -import React from 'react'; -import { Modal, ScrollView, TouchableOpacity, View, Text } from 'react-native'; -import { Icon } from 'react-native-elements'; -import Container from '../../../Container'; -import howToChoseHelpOfferRecomendations from '../../../../docs/FAQ/HowToChooseHelpOffered'; -import colors from '../../../../../assets/styles/colorVariables'; -import styles from './styles'; - -export default function HowToChoseHelpOffer({ visible, setVisible }) { - const renderHowToChoseHelpOfferStepsList = () => ( - - - {howToChoseHelpOfferRecomendations.map((item) => ( - - {item.title} - - {item.description} - - - ))} - - - ); - - return ( - setVisible(false)} - animationType="fade"> - - - { - setVisible(false); - }} - style={styles.icon}> - - - {renderHowToChoseHelpOfferStepsList()} - - - - ); -} diff --git a/app/src/components/FAQModals/HowToUseModal/HowToChoseHelpOfferModal/styles.js b/app/src/components/FAQModals/HowToUseModal/HowToChoseHelpOfferModal/styles.js deleted file mode 100644 index 637cf3133..000000000 --- a/app/src/components/FAQModals/HowToUseModal/HowToChoseHelpOfferModal/styles.js +++ /dev/null @@ -1,46 +0,0 @@ -import { StyleSheet } from 'react-native'; -import colors from '../../../../../assets/styles/colorVariables'; - -const minimumTextSize = 16; - -const styles = StyleSheet.create({ - modalContainer: { - width: '100%', - height: '100%', - backgroundColor: 'rgba(0,0,0,0.3)', - }, - - modalContent: { - paddingTop: 50, - backgroundColor: colors.light, - padding: 20, - marginBottom: 50, - borderRadius: 20, - top: '2.5%', - }, - - title: { - alignSelf: 'center', - marginBottom: 10, - fontFamily: 'montserrat-semibold', - color: colors.primary, - fontSize: minimumTextSize * 1.5, - }, - - description: { - alignSelf: 'center', - marginBottom: 10, - fontFamily: 'montserrat-semibold', - color: colors.primary, - fontSize: minimumTextSize, - }, - - icon: { - top: '5.5%', - right: 20, - position: 'absolute', - zIndex: 5, - }, -}); - -export default styles; diff --git a/app/src/components/FAQModals/HowToUseModal/HowToCreateHelpModal/index.js b/app/src/components/FAQModals/HowToUseModal/HowToCreateHelpModal/index.js deleted file mode 100644 index 7c253dfa2..000000000 --- a/app/src/components/FAQModals/HowToUseModal/HowToCreateHelpModal/index.js +++ /dev/null @@ -1,50 +0,0 @@ -import React from 'react'; -import { Modal, ScrollView, TouchableOpacity, View, Text } from 'react-native'; -import { Icon } from 'react-native-elements'; -import Container from '../../../Container'; -import createHelpRecomendations from '../../../../docs/FAQ/HowToCreateHelp'; -import colors from '../../../../../assets/styles/colorVariables'; -import styles from './styles'; - -export default function HowToCreateHelpRequest({ visible, setVisible }) { - const renderHowToCreateHelpRequestStepsList = () => ( - - - {createHelpRecomendations.map((item) => ( - - {item.title} - - {item.description} - - - ))} - - - ); - - return ( - setVisible(false)} - animationType="fade"> - - - { - setVisible(false); - }} - style={styles.icon}> - - - {renderHowToCreateHelpRequestStepsList()} - - - - ); -} diff --git a/app/src/components/FAQModals/HowToUseModal/HowToCreateHelpModal/styles.js b/app/src/components/FAQModals/HowToUseModal/HowToCreateHelpModal/styles.js deleted file mode 100644 index 637cf3133..000000000 --- a/app/src/components/FAQModals/HowToUseModal/HowToCreateHelpModal/styles.js +++ /dev/null @@ -1,46 +0,0 @@ -import { StyleSheet } from 'react-native'; -import colors from '../../../../../assets/styles/colorVariables'; - -const minimumTextSize = 16; - -const styles = StyleSheet.create({ - modalContainer: { - width: '100%', - height: '100%', - backgroundColor: 'rgba(0,0,0,0.3)', - }, - - modalContent: { - paddingTop: 50, - backgroundColor: colors.light, - padding: 20, - marginBottom: 50, - borderRadius: 20, - top: '2.5%', - }, - - title: { - alignSelf: 'center', - marginBottom: 10, - fontFamily: 'montserrat-semibold', - color: colors.primary, - fontSize: minimumTextSize * 1.5, - }, - - description: { - alignSelf: 'center', - marginBottom: 10, - fontFamily: 'montserrat-semibold', - color: colors.primary, - fontSize: minimumTextSize, - }, - - icon: { - top: '5.5%', - right: 20, - position: 'absolute', - zIndex: 5, - }, -}); - -export default styles; diff --git a/app/src/components/FAQModals/HowToUseModal/HowToOfferHelpModal/index.js b/app/src/components/FAQModals/HowToUseModal/HowToOfferHelpModal/index.js deleted file mode 100644 index 58f10b273..000000000 --- a/app/src/components/FAQModals/HowToUseModal/HowToOfferHelpModal/index.js +++ /dev/null @@ -1,50 +0,0 @@ -import React from 'react'; -import { Modal, ScrollView, TouchableOpacity, View, Text } from 'react-native'; -import { Icon } from 'react-native-elements'; -import Container from '../../../Container'; -import offerHelpRecomendations from '../../../../docs/FAQ/HowToOfferHelp'; -import colors from '../../../../../assets/styles/colorVariables'; -import styles from './styles'; - -export default function HowToOfferHelp({ visible, setVisible }) { - const renderHowToOfferHelpStepsList = () => ( - - - {offerHelpRecomendations.map((item) => ( - - {item.title} - - {item.description} - - - ))} - - - ); - - return ( - setVisible(false)} - animationType="fade"> - - - { - setVisible(false); - }} - style={styles.icon}> - - - {renderHowToOfferHelpStepsList()} - - - - ); -} diff --git a/app/src/components/FAQModals/HowToUseModal/HowToVolunteerModal/index.js b/app/src/components/FAQModals/HowToUseModal/HowToVolunteerModal/index.js deleted file mode 100644 index 617338e9e..000000000 --- a/app/src/components/FAQModals/HowToUseModal/HowToVolunteerModal/index.js +++ /dev/null @@ -1,50 +0,0 @@ -import React from 'react'; -import { Modal, ScrollView, TouchableOpacity, View, Text } from 'react-native'; -import { Icon } from 'react-native-elements'; -import Container from '../../../Container'; -import howToVolunteerRecomendations from '../../../../docs/FAQ/HowToBeVolunteer'; -import colors from '../../../../../assets/styles/colorVariables'; -import styles from './styles'; - -export default function HowToVolunteer({ visible, setVisible }) { - const renderHowToVolunteerStepsList = () => ( - - - {howToVolunteerRecomendations.map((item) => ( - - {item.title} - - {item.description} - - - ))} - - - ); - - return ( - setVisible(false)} - animationType="fade"> - - - { - setVisible(false); - }} - style={styles.icon}> - - - {renderHowToVolunteerStepsList()} - - - - ); -} diff --git a/app/src/components/FAQModals/HowToUseModal/HowToVolunteerModal/styles.js b/app/src/components/FAQModals/HowToUseModal/HowToVolunteerModal/styles.js deleted file mode 100644 index 637cf3133..000000000 --- a/app/src/components/FAQModals/HowToUseModal/HowToVolunteerModal/styles.js +++ /dev/null @@ -1,46 +0,0 @@ -import { StyleSheet } from 'react-native'; -import colors from '../../../../../assets/styles/colorVariables'; - -const minimumTextSize = 16; - -const styles = StyleSheet.create({ - modalContainer: { - width: '100%', - height: '100%', - backgroundColor: 'rgba(0,0,0,0.3)', - }, - - modalContent: { - paddingTop: 50, - backgroundColor: colors.light, - padding: 20, - marginBottom: 50, - borderRadius: 20, - top: '2.5%', - }, - - title: { - alignSelf: 'center', - marginBottom: 10, - fontFamily: 'montserrat-semibold', - color: colors.primary, - fontSize: minimumTextSize * 1.5, - }, - - description: { - alignSelf: 'center', - marginBottom: 10, - fontFamily: 'montserrat-semibold', - color: colors.primary, - fontSize: minimumTextSize, - }, - - icon: { - top: '5.5%', - right: 20, - position: 'absolute', - zIndex: 5, - }, -}); - -export default styles; diff --git a/app/src/components/FAQModals/HowToUseModal/index.js b/app/src/components/FAQModals/HowToUseModal/index.js index eda60045e..64f6ca6e4 100644 --- a/app/src/components/FAQModals/HowToUseModal/index.js +++ b/app/src/components/FAQModals/HowToUseModal/index.js @@ -3,35 +3,31 @@ import { View, Modal, Text, TouchableOpacity } from 'react-native'; import styles from './styles'; import colors from '../../../../assets/styles/colorVariables'; import { Icon } from 'react-native-elements'; -import HowToChoseHelpOfferModal from '../HowToUseModal/HowToChoseHelpOfferModal'; -import HowToCreateHelpModal from '../HowToUseModal/HowToCreateHelpModal'; -import HowToOfferHelpModal from '../HowToUseModal/HowToOfferHelpModal'; -import HowToVolunteerModal from '../HowToUseModal/HowToVolunteerModal'; +import createHelpRecommendations from '../../../docs/FAQ/HowToCreateHelp'; +import offerHelpRecommendations from '../../../docs/FAQ/HowToOfferHelp'; +import howToChoseHelpOfferRecommendations from '../../../docs/FAQ/HowToChooseHelpOffered'; +import howToVolunteerRecommendations from '../../../docs/FAQ/HowToBeVolunteer'; +import { ModalComponent } from '../modal'; export default function HowToUseModal({ visible, setVisible }) { - const [ - howToCreateHelpModalVisible, - setHowToCreateHelpModalVisible, - ] = useState(false); - const [ - howToOfferHelpModalVisible, - setHowToOfferHelpModalVisible, - ] = useState(false); + const [howToCreateHelpModalVisible, setHowToCreateHelpModalVisible] = + useState(false); + const [howToOfferHelpModalVisible, setHowToOfferHelpModalVisible] = + useState(false); const [ howToChoseHelpOfferModalVisible, setHowToChoseHelpOfferModalVisible, ] = useState(false); - const [ - howToVolunteerModalVisible, - setHowToVolunteerModalVisible, - ] = useState(false); + const [howToVolunteerModalVisible, setHowToVolunteerModalVisible] = + useState(false); const renderHowToCreateHelpModal = () => ( { setHowToCreateHelpModalVisible(!howToCreateHelpModalVisible); }} - style={styles.textButtons}> + style={styles.textButtons} + > Como criar um pedido de ajuda? @@ -43,7 +39,8 @@ export default function HowToUseModal({ visible, setVisible }) { onPress={() => { setHowToOfferHelpModalVisible(!howToOfferHelpModalVisible); }} - style={styles.textButtons}> + style={styles.textButtons} + > Como criar uma oferta de ajuda? @@ -57,7 +54,8 @@ export default function HowToUseModal({ visible, setVisible }) { !howToChoseHelpOfferModalVisible, ); }} - style={styles.textButtons}> + style={styles.textButtons} + > Como escolher uma oferta de ajuda? @@ -69,7 +67,8 @@ export default function HowToUseModal({ visible, setVisible }) { onPress={() => { setHowToVolunteerModalVisible(!howToVolunteerModalVisible); }} - style={styles.textButtons}> + style={styles.textButtons} + > Como ser um voluntário? ); @@ -79,20 +78,23 @@ export default function HowToUseModal({ visible, setVisible }) { visible={visible} animationType="fade" transparent - onRequestClose={() => setVisible(false)}> + onRequestClose={() => setVisible(false)} + > { setVisible(false); - }}> + }} + > { setVisible(false); }} - style={styles.closeIcon}> + style={styles.closeIcon} + > - - - - ); diff --git a/app/src/components/FAQModals/RecomendationsModal/HelpOfferedModal/index.js b/app/src/components/FAQModals/RecomendationsModal/HelpOfferedModal/index.js index 9fb737e91..3c9396513 100644 --- a/app/src/components/FAQModals/RecomendationsModal/HelpOfferedModal/index.js +++ b/app/src/components/FAQModals/RecomendationsModal/HelpOfferedModal/index.js @@ -1,50 +1,13 @@ import React from 'react'; -import { Modal, ScrollView, TouchableOpacity, View, Text } from 'react-native'; -import { Icon } from 'react-native-elements'; -import Container from '../../../Container'; -import helpOfferedRecomendations from '../../../../docs/FAQ/HelpOfferedRecomendations'; -import colors from '../../../../../assets/styles/colorVariables'; -import styles from './styles'; +import helpOfferedRecommendations from '../../../../docs/FAQ/HelpOfferedRecommendations'; +import { ModalComponent } from '../../modal'; export default function HelpOfferedModal({ visible, setVisible }) { - const renderRecomendationsList = () => ( - - - {helpOfferedRecomendations.map((item) => ( - - {item.title} - - {item.description} - - - ))} - - - ); - return ( - setVisible(false)} - animationType="fade"> - - - { - setVisible(false); - }} - style={styles.icon}> - - - {renderRecomendationsList()} - - - + setVisible={setVisible} + list={helpOfferedRecommendations} + /> ); } diff --git a/app/src/components/FAQModals/RecomendationsModal/HelpOfferedModal/styles.js b/app/src/components/FAQModals/RecomendationsModal/HelpOfferedModal/styles.js deleted file mode 100644 index 9ec138303..000000000 --- a/app/src/components/FAQModals/RecomendationsModal/HelpOfferedModal/styles.js +++ /dev/null @@ -1,45 +0,0 @@ -import { StyleSheet } from 'react-native'; -import colors from '../../../../../assets/styles/colorVariables'; - -const minimumTextSize = 16; - -const styles = StyleSheet.create({ - modalContainer: { - width: '100%', - height: '100%', - backgroundColor: 'rgba(0,0,0,0.3)', - }, - - modalContent: { - paddingTop: 50, - backgroundColor: colors.light, - padding: 20, - marginBottom: 50, - borderRadius: 20, - top: '2.5%', - }, - - title: { - alignSelf: 'center', - marginBottom: 10, - fontFamily: 'montserrat-semibold', - color: colors.primary, - fontSize: minimumTextSize * 1.5, - }, - - description: { - marginBottom: 10, - fontFamily: 'montserrat-semibold', - color: colors.primary, - fontSize: minimumTextSize, - }, - - icon: { - top: '5.5%', - right: 20, - position: 'absolute', - zIndex: 5, - }, -}); - -export default styles; diff --git a/app/src/components/FAQModals/RecomendationsModal/HelpRequestModal/index.js b/app/src/components/FAQModals/RecomendationsModal/HelpRequestModal/index.js index e8f6f816c..2aec27c2d 100644 --- a/app/src/components/FAQModals/RecomendationsModal/HelpRequestModal/index.js +++ b/app/src/components/FAQModals/RecomendationsModal/HelpRequestModal/index.js @@ -1,50 +1,13 @@ import React from 'react'; -import { Modal, ScrollView, TouchableOpacity, View, Text } from 'react-native'; -import { Icon } from 'react-native-elements'; -import Container from '../../../Container'; -import helpOfferedRecomendations from '../../../../docs/FAQ/HelpRequestRecomendations'; -import colors from '../../../../../assets/styles/colorVariables'; -import styles from './styles'; +import helpRequestRecommendations from '../../../../docs/FAQ/HelpRequestRecommendations'; +import { ModalComponent } from '../../modal'; export default function HelpRequestModal({ visible, setVisible }) { - const renderImportantRecomendations = () => ( - - - {helpOfferedRecomendations.map((item) => ( - - {item.title} - - {item.description} - - - ))} - - - ); - return ( - setVisible(false)} - animationType="fade"> - - - { - setVisible(false); - }} - style={styles.icon}> - - - {renderImportantRecomendations()} - - - + setVisible={setVisible} + list={helpRequestRecommendations} + /> ); } diff --git a/app/src/components/FAQModals/RecomendationsModal/HelpRequestModal/styles.js b/app/src/components/FAQModals/RecomendationsModal/HelpRequestModal/styles.js deleted file mode 100644 index a44a14ed9..000000000 --- a/app/src/components/FAQModals/RecomendationsModal/HelpRequestModal/styles.js +++ /dev/null @@ -1,46 +0,0 @@ -import { StyleSheet } from 'react-native'; -import colors from '../../../../../assets/styles/colorVariables'; - -const minimumTextSize = 16; - -const styles = StyleSheet.create({ - modalContainer: { - width: '100%', - height: '100%', - backgroundColor: 'rgba(0,0,0,0.3)', - }, - image: { - flex: 1, - alignItems: 'center', - opacity: 0.6, - }, - modalContent: { - paddingTop: 50, - backgroundColor: colors.light, - padding: 20, - marginBottom: 50, - borderRadius: 20, - top: '2.5%', - }, - - title: { - alignSelf: 'center', - marginBottom: 10, - fontFamily: 'montserrat-semibold', - color: colors.primary, - fontSize: minimumTextSize * 1.5, - }, - description: { - marginBottom: 10, - fontFamily: 'montserrat-semibold', - color: colors.primary, - fontSize: minimumTextSize, - }, - icon: { - top: '5.5%', - right: 20, - position: 'absolute', - zIndex: 5, - }, -}); -export default styles; diff --git a/app/src/components/FAQModals/modal.js b/app/src/components/FAQModals/modal.js new file mode 100644 index 000000000..dcfce12f2 --- /dev/null +++ b/app/src/components/FAQModals/modal.js @@ -0,0 +1,54 @@ +import React from 'react'; +import { Modal, ScrollView, Text, TouchableOpacity, View } from 'react-native'; +import { Icon } from 'react-native-elements'; +import colors from '../../../assets/styles/colorVariables'; +import Container from '../Container'; +import styles from './styles'; + +export const ModalComponent = (props) => { + const renderModalList = (list) => ( + + + {list.map((numbers) => { + return ( + + {numbers.number} + + {' '} + {numbers.description}{' '} + + + ); + })} + + + ); + + return ( + props.setVisible(false)} + animationType="fade" + > + + + { + props.setVisible(false); + }} + style={styles.icon} + > + + + {props.list ? renderModalList(props.list) : props.children} + + + + ); +}; diff --git a/app/src/components/FAQModals/HowToUseModal/HowToOfferHelpModal/styles.js b/app/src/components/FAQModals/styles.js similarity index 93% rename from app/src/components/FAQModals/HowToUseModal/HowToOfferHelpModal/styles.js rename to app/src/components/FAQModals/styles.js index 637cf3133..6a28aa6f9 100644 --- a/app/src/components/FAQModals/HowToUseModal/HowToOfferHelpModal/styles.js +++ b/app/src/components/FAQModals/styles.js @@ -1,5 +1,5 @@ import { StyleSheet } from 'react-native'; -import colors from '../../../../../assets/styles/colorVariables'; +import colors from '../../../assets/styles/colorVariables'; const minimumTextSize = 16; diff --git a/app/src/components/FaqCard/index.js b/app/src/components/FaqCard/index.js index 1aacdea3c..29d70958f 100644 --- a/app/src/components/FaqCard/index.js +++ b/app/src/components/FaqCard/index.js @@ -63,7 +63,8 @@ export default function FaqCard({ faq }) { { setModalVisible(!modalVisible); - }}> + }} + > {renderSVGIcon(faq.id)} diff --git a/app/src/components/HistoricCard/index.js b/app/src/components/HistoricCard/index.js index 25c14e718..ceba3f812 100644 --- a/app/src/components/HistoricCard/index.js +++ b/app/src/components/HistoricCard/index.js @@ -8,7 +8,8 @@ export default function HistoricCard({ object, isRiskGroup, children }) { isRiskGroup ? styles.cardContainerRiskGroup : styles.cardContainer - }> + } + > {object.title} @@ -21,13 +22,15 @@ export default function HistoricCard({ object, isRiskGroup, children }) { + style={styles.imageBackground} + > {object.categories.map((category) => ( + style={styles.categoryWarning} + > {category.name} diff --git a/app/src/components/MyRequestCard/index.js b/app/src/components/MyRequestCard/index.js index 047ab81f3..83ea6c927 100644 --- a/app/src/components/MyRequestCard/index.js +++ b/app/src/components/MyRequestCard/index.js @@ -1,8 +1,7 @@ import React from 'react'; import { View, Text } from 'react-native'; -import { Icon } from 'react-native-elements'; +import { Icon, Badge } from 'react-native-elements'; import colors from '../../../assets/styles/colorVariables'; -import { Badge } from 'react-native-elements'; import HistoricCard from '../HistoricCard'; import styles from './styles'; diff --git a/app/src/components/NoHelps/index.js b/app/src/components/NoHelps/index.js index 42abed1e4..5f54011bf 100644 --- a/app/src/components/NoHelps/index.js +++ b/app/src/components/NoHelps/index.js @@ -14,7 +14,8 @@ export default function NoHelps({ title, color }) { color == 'light' ? styles.emptyListTextLight : styles.emptyListTextPrimary - }> + } + > {title} diff --git a/app/src/components/SelectCategoryForm/index.js b/app/src/components/SelectCategoryForm/index.js index 1e8306b43..ca73da27c 100644 --- a/app/src/components/SelectCategoryForm/index.js +++ b/app/src/components/SelectCategoryForm/index.js @@ -17,7 +17,8 @@ export default function SelectCategoryForm({ const renderPickerCategoryForm = () => ( + onPress={openCategoryModal} + > Categorias + ); @@ -30,7 +31,8 @@ export default function SelectCategoryForm({ return ( + style={styles.categoryName} + > {category.name} ); diff --git a/app/src/components/UI/button/FilterButtons/index.js b/app/src/components/UI/button/FilterButtons/index.js index cfd1e2c3f..c5f5a6504 100644 --- a/app/src/components/UI/button/FilterButtons/index.js +++ b/app/src/components/UI/button/FilterButtons/index.js @@ -44,13 +44,15 @@ export default function FilterButtons({ style={styles.helpFilterButton} onPress={() => { selectionFilter(filterButton.id); - }}> + }} + > + } + > + } + > {filterButton.name} diff --git a/app/src/components/UI/button/index.js b/app/src/components/UI/button/index.js index e66e49116..9b7f147f3 100644 --- a/app/src/components/UI/button/index.js +++ b/app/src/components/UI/button/index.js @@ -69,7 +69,6 @@ export default function Button({ ); break; default: - case 'default': btn = ( ( + showsVerticalScrollIndicator={false} + > {categories.map((category) => { return ( { selectCategory(category._id); - }}> + }} + > {category.name} @@ -143,7 +144,8 @@ export default function CategoryList({ style={[ styles.onGoingFinishedButtons, { marginRight: 10 }, - ]}> + ]} + > EM ANDAMENTO @@ -163,13 +165,15 @@ export default function CategoryList({ visible={visible} animationType="fade" transparent - onRequestClose={() => setVisible(false)}> + onRequestClose={() => setVisible(false)} + > { setVisible(false); - }}> + }} + > FILTRO @@ -177,7 +181,8 @@ export default function CategoryList({ onPress={() => { setVisible(false); }} - style={styles.closeIcon}> + style={styles.closeIcon} + > + }} + > { let categoriesToList; - if ( - helpCreationType == 'offer' && - user.ismentalHealthProfessional == false - ) { + if (helpCreationType == 'offer' && !user.ismentalHealthProfessional) { categoriesToList = removePsychologicalSupportFromCategories(); } else { categoriesToList = categories; @@ -114,7 +111,8 @@ export default function CategorySelector({ key={category._id} onPress={() => { selectCategory(category._id); - }}> + }} + > {category.name} @@ -129,11 +127,13 @@ export default function CategorySelector({ visible={modalVisible} transparent onRequestClose={hideModal} - animationType="fade"> + animationType="fade" + > + onPress={hideModal} + > {renderCloseButton()} diff --git a/app/src/components/modals/category/categoryDescription/index.js b/app/src/components/modals/category/categoryDescription/index.js index 03a26b816..0ac7dfcdd 100644 --- a/app/src/components/modals/category/categoryDescription/index.js +++ b/app/src/components/modals/category/categoryDescription/index.js @@ -14,14 +14,16 @@ export default function CategoryDescriptionModal({ visible, setVisible }) { visible={visible} transparent animationType="fade" - onRequestClose={() => setVisible(false)}> + onRequestClose={() => setVisible(false)} + > { setVisible(false); }} - style={styles.icon}> + style={styles.icon} + > setVisible(false)} - animationType="slide"> + animationType="slide" + > setVisible(false)}> + onPress={() => setVisible(false)} + > + showsVerticalScrollIndicator={false} + > {terms} diff --git a/app/src/components/modals/confirmationModal/index.js b/app/src/components/modals/confirmationModal/index.js index dfe34d24a..e16ee99e5 100644 --- a/app/src/components/modals/confirmationModal/index.js +++ b/app/src/components/modals/confirmationModal/index.js @@ -27,7 +27,7 @@ export default function ConfirmationModal({ const attentionWarning = Atenção!; return ( <> - {attention == true ? attentionWarning : null} + {attention ? attentionWarning : null} {message}