Skip to content

Commit

Permalink
fix: prettier (format files) (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
benguedj authored Jul 1, 2024
1 parent b2d12d5 commit e97904e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 16 deletions.
38 changes: 26 additions & 12 deletions src/components/contact/ContactForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ export const ContactForm = ({
const [inputPhoneConfirmValue, setInputPhoneConfirmValue] = useState()
const [isPhoneConfirmValid, setPhoneConfirmValid] = useState()
const [isPhoneConfirmMatch, setPhoneConfirmMatch] = useState()
const [showWhatsappRedirectMessage, setShowWhatsappRedirectMessage] = useState(false)

const [showWhatsappRedirectMessage, setShowWhatsappRedirectMessage] =
useState(false)

const source = StorageUtils.getInLocalStorage(STORAGE_SOURCE)
const requiredField = <p className="required-field">{Form.required}</p>
const dptCode = StorageUtils.getInLocalStorage(
Expand All @@ -46,7 +47,9 @@ export const ContactForm = ({
const dptLibelle = StorageUtils.getInLocalStorage(
STORAGE_TEST_DEMOGRAPHIC_DPT_LIBELLE
)
const activationContact = JSON.parse(StorageUtils.getInLocalStorage(STORAGE_ACTIVATION_CONTACT))
const activationContact = JSON.parse(
StorageUtils.getInLocalStorage(STORAGE_ACTIVATION_CONTACT)
)

const cancel = () => {
router.back()
Expand All @@ -65,7 +68,10 @@ export const ContactForm = ({
client: client,
onCompleted: () => {
ContactUtils.saveContactRequest(contactType, sendContactQuery)
if(contactType === RequestContact.type.whatsapp && activationContact?.whatsapp_redirect_message?.length > 0) {
if (
contactType === RequestContact.type.whatsapp &&
activationContact?.whatsapp_redirect_message?.length > 0
) {
setShowWhatsappRedirectMessage(true)
} else {
goToConfirmation()
Expand Down Expand Up @@ -217,7 +223,12 @@ export const ContactForm = ({

return (
<>
<Modal show={showWhatsappRedirectMessage} centered size="md" className="modal-info">
<Modal
show={showWhatsappRedirectMessage}
centered
size="md"
className="modal-info"
>
<Modal.Header className="fr-modal__header header-choose-modal">
<b>Information</b>
</Modal.Header>
Expand All @@ -229,13 +240,16 @@ export const ContactForm = ({
<Modal.Footer
style={{ alignSelf: "center", borderTop: "none", margin: 20 }}
>
<button className="fr-btn" onClick={() => {
setShowWhatsappRedirectMessage(false)
goToConfirmation()
setTimeout(() => {
window.open(URL_CHAT_WHATSAPP, "_blank")
}, 500)
}}>
<button
className="fr-btn"
onClick={() => {
setShowWhatsappRedirectMessage(false)
goToConfirmation()
setTimeout(() => {
window.open(URL_CHAT_WHATSAPP, "_blank")
}, 500)
}}
>
Ok
</button>
</Modal.Footer>
Expand Down
9 changes: 5 additions & 4 deletions src/components/results/ContactTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import {
import { client, GET_ACTIVATION_TILE_STATUS } from "../../../apollo-client"
import { Icon } from "@dataesr/react-dsfr"
import { useQuery } from "@apollo/client"
import {
STORAGE_ACTIVATION_CONTACT,
} from "../../constants/constants"
import { STORAGE_ACTIVATION_CONTACT } from "../../constants/constants"

export const Tile = ({
title,
Expand Down Expand Up @@ -60,7 +58,10 @@ export function ContactTile({ isArticle }) {
if (loading) return <></>
if (error) return <p>Error</p>
const isTileContactActive = data.activationTile.activation_tile
localStorage.setItem(STORAGE_ACTIVATION_CONTACT, JSON.stringify(data.activationTile))
localStorage.setItem(
STORAGE_ACTIVATION_CONTACT,
JSON.stringify(data.activationTile)
)

return (
<>
Expand Down

0 comments on commit e97904e

Please sign in to comment.