Skip to content

Commit

Permalink
fix: remove doctolib bespoke screen (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarry-ippon authored Jul 11, 2023
1 parent 31cf118 commit e15834b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 44 deletions.
6 changes: 1 addition & 5 deletions pages/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { WidgetHeader } from "../src/components/WidgetHeader"
import { ContentLayout } from "../src/components/Layout"
import {
STORAGE_SCORE,
STORAGE_SOURCE,
moderateTestimonyList,
highTestimonyList,
veryHighTestimonyList,
Expand All @@ -16,7 +15,6 @@ import { BeBetter } from "../src/components/results/BeBetter"

export default function Results() {
const scoreValue = StorageUtils.getInLocalStorage(STORAGE_SCORE)
const source = StorageUtils.getInLocalStorage(STORAGE_SOURCE)
const localeSelected = StorageUtils.getLocaleInLocalStorage()
const score = parseInt(scoreValue)

Expand All @@ -28,7 +26,6 @@ export default function Results() {
<ResultMood
scoreText="moyennement élevé"
testimonyList={moderateTestimonyList}
source={source}
/>
)}
{score > 11 && score <= 15 && (
Expand All @@ -38,10 +35,9 @@ export default function Results() {
<ResultMood
scoreText="très élevé"
testimonyList={veryHighTestimonyList}
source={source}
/>
)}
{source !== "doctolib" && <BeBetter score={score} linkActive={true} />}
<BeBetter score={score} linkActive={true} />
</ContentLayout>
)
}
Expand Down
25 changes: 3 additions & 22 deletions src/components/Layout.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState, useEffect } from "react"
import React from "react"
import { Container, Row } from "react-bootstrap"
import { STORAGE_SOURCE } from "../constants/constants"
import * as StorageUtils from "../utils/storage.utils"

export function Layout({ children }) {
return (
<React.Fragment>
Expand All @@ -11,27 +10,9 @@ export function Layout({ children }) {
}

export function ContentLayout({ children }) {
const source = StorageUtils.getInLocalStorage(STORAGE_SOURCE)
const [height, setHeight] = useState("0px")

useEffect(() => {
if (source === "doctolib") {
setHeight("0px")
} else {
setHeight("80vh")
}
}, [height])

return (
<Layout>
<Row
style={{
alignContent: "start",
minHeight: height,
}}
>
{children}
</Row>
<Row style={{ alignContent: "start", minHeight: "80vh" }}>{children}</Row>
</Layout>
)
}
32 changes: 15 additions & 17 deletions src/components/results/ResultMood.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react"

export function ResultMood({ scoreText, testimonyList, source }) {
export function ResultMood({ scoreText, testimonyList }) {
return (
<div>
<>
<div
className="fr-tile fr-tile--horizontal remove-box-shadow"
style={{
Expand All @@ -21,20 +21,18 @@ export function ResultMood({ scoreText, testimonyList, source }) {
/>
</div>
</div>
{source !== "doctolib" && (
<div className="margin-bottom-8">
<h5>Ce que disent les parents ayant obtenu le même score que moi</h5>
<figure className="fr-quote height-tile horizontal-line-testimony">
<blockquote>
{testimonyList.map((testimony, index) => (
<p key={index} className="size-font">
{testimony}
</p>
))}
</blockquote>
</figure>
</div>
)}
</div>
<div className="margin-bottom-8">
<h5>Ce que disent les parents ayant obtenu le même score que moi</h5>
<figure className="fr-quote height-tile horizontal-line-testimony">
<blockquote>
{testimonyList.map((testimony, index) => (
<p key={index} className="size-font">
{testimony}
</p>
))}
</blockquote>
</figure>
</div>
</>
)
}

0 comments on commit e15834b

Please sign in to comment.