All files / src/screens/settingsSection/settingsScreen/Views HelpModal.tsx

100% Statements 2/2
100% Branches 0/0
100% Functions 1/1
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104                                                        2x                                                             1x                                                                                        
/**
 * @fileoverview HelpModal component that renders the HelpModal.
 * @module HelpModal
 * @description Component that renders the HelpModal.
 * @requires react
 */
 
import React from 'react'
import { Text, Modal, View, StyleSheet } from 'react-native'
import Button from '@components/Button'
import colors from '@global/colors'
 
type Props = {
  isVisible: boolean
  hideModal: () => void
  onValidate: () => void
}
 
/**
 * @function HelpModal
 * @description Component that renders the HelpModal.
 * @param props HelpModal props
 * @param props.isVisible HelpModal visibility
 * @param props.hideModal HelpModal hide function
 * @param props.onValidate HelpModal validate function
 * @returns {React.JSX.Element} HelpModal component template
 */
export default function HelpModal({ isVisible, hideModal, onValidate }: Props): React.JSX.Element {
  return (
    <Modal
      animationType='fade'
      transparent
      visible={isVisible}
    >
      <View style={styles.backgroundOpacity}>
        <View style={styles.container}>
          <Text style={styles.title}>Vous avez besoin d&apos;aide ?</Text>
          <Text style={styles.text}>Contactez-nous par mail en cliquant sur le bouton ci-dessous.</Text>
          <Text style={styles.text}>
            Expliquez-nous votre besoin et nous vous répondrons dans les plus brefs délais.
          </Text>
          <View style={styles.buttonContainer}>
            <Button
              text='Envoyer'
              onPress={onValidate}
              style={styles.validateButton}
            />
            <Button
              text='Annuler'
              onPress={hideModal}
              style={styles.cancelButton}
            />
          </View>
        </View>
      </View>
    </Modal>
  )
}
 
const styles = StyleSheet.create({
  backgroundOpacity: {
    justifyContent: 'center',
    alignItems: 'center',
    flex: 1,
    backgroundColor: '#000000AA',
    opacity: 1,
  },
  container: {
    backgroundColor: 'white',
    borderRadius: 10,
    width: '90%',
    padding: 24,
    alignItems: 'center',
    opacity: 1,
    justifyContent: 'center',
  },
  buttonContainer: {
    width: '100%',
  },
  validateButton: {
    marginBottom: 16,
  },
  cancelButton: {
    backgroundColor: colors.white,
    borderColor: colors.accent,
    borderWidth: 1,
  },
  title: {
    color: colors.accent,
    fontSize: 24,
    fontWeight: '700',
    marginBottom: 16,
    fontFamily: 'Poppins',
    textAlign: 'center',
  },
  text: {
    color: colors.black,
    fontSize: 18,
    marginBottom: 16,
    fontFamily: 'Poppins',
    textAlign: 'center',
  },
})