-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b33937
commit 25a6103
Showing
34 changed files
with
1,306 additions
and
990 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
import "./src/styles/normalize.css"; | ||
import "./src/styles/global.css"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
plugins: [require("prettier-plugin-tailwindcss")], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,50 @@ | ||
import MagicLink from "components/base/MagicLink"; | ||
import Section from "components/base/Section"; | ||
import Background from "components/misc/Background"; | ||
import Cloud from "components/search/Cloud"; | ||
import SearchBar from "components/search/SearchBar"; | ||
import Title from "components/search/Title"; | ||
import CloudAnimated from "components/search/CloudAnimated"; | ||
import SearchInput from "components/search/SearchInput"; | ||
import TitleAnimated from "components/search/TitleAnimated"; | ||
import { navigate } from "gatsby"; | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import { formatPlaceUrl } from "utils/formatPlaceUrl"; | ||
import Suggestions from "./search/Suggestions"; | ||
import useIframe from "hooks/useIframe"; | ||
import SuggestionsButtons from "./search/SuggestionsButtons"; | ||
|
||
const Wrapper = styled.div` | ||
position: relative; | ||
margin: 0 auto 10rem; | ||
padding: 0 0 6.5rem; | ||
export default function Search({ handlePlaceSelection }) { | ||
const iframe = useIframe(); | ||
|
||
${(props) => props.theme.mq.medium} { | ||
min-height: ${(props) => (props.iframe ? "50rem" : "100vh")}; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 0; | ||
} | ||
${(props) => props.theme.mq.small} { | ||
margin-bottom: 5rem; | ||
} | ||
`; | ||
const StyledSection = styled(Section)` | ||
position: relative; | ||
margin: 0 auto; | ||
${(props) => props.theme.mq.medium} { | ||
padding: 0; | ||
} | ||
`; | ||
const SearchBarSizer = styled.div` | ||
position: relative; | ||
height: 4.5rem; | ||
margin-bottom: 2.5rem; | ||
`; | ||
const WidgetFooter = styled.div` | ||
position: absolute; | ||
bottom: 1rem; | ||
width: 100%; | ||
text-align: center; | ||
`; | ||
const WidgetLink = styled(MagicLink)` | ||
font-size: 0.75rem; | ||
color: ${(props) => props.theme.colors.footer}; | ||
text-decoration: none; | ||
`; | ||
|
||
export default function Search(props) { | ||
return ( | ||
<Wrapper iframe={props.iframe} className={props.className}> | ||
<Background /> | ||
<StyledSection first> | ||
<Cloud /> | ||
<Title /> | ||
<SearchBarSizer> | ||
<SearchBar | ||
handlePlaceSelection={ | ||
props.handlePlaceSelection || | ||
((place) => { | ||
<div | ||
iframe={iframe.toString()} | ||
className={[ | ||
"relative -mx-4 flex flex-col items-center justify-start bg-gradient-to-r from-[#d1edff] via-[#f8fafd] to-[#d6eeff] px-4", | ||
// iframe ? "min-h-[50rem]" : "min-h-screen", | ||
].join(" ")} | ||
> | ||
<section className="relative flex w-full flex-col pb-6"> | ||
<CloudAnimated /> | ||
<TitleAnimated /> | ||
<div className="relative mb-4 px-2"> | ||
<SearchInput | ||
handlePlaceSelection={(place) => { | ||
if (handlePlaceSelection) { | ||
handlePlaceSelection(place); | ||
} else { | ||
navigate(formatPlaceUrl(place) + window.location.search); | ||
}) | ||
} | ||
} | ||
}} | ||
/> | ||
</SearchBarSizer> | ||
<Suggestions /> | ||
</StyledSection> | ||
{props.iframe && ( | ||
<WidgetFooter> | ||
<WidgetLink to="https://recosante.beta.gouv.fr/donnees-personnelles"> | ||
</div> | ||
<SuggestionsButtons /> | ||
</section> | ||
{!!iframe && ( | ||
<div className="mt-auto w-full text-center"> | ||
<MagicLink | ||
className="text-xs text-footer no-underline" | ||
to="https://recosante.beta.gouv.fr/donnees-personnelles" | ||
> | ||
En savoir plus sur la gestion de vos données personnelles | ||
</WidgetLink> | ||
</WidgetFooter> | ||
</MagicLink> | ||
</div> | ||
)} | ||
</Wrapper> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.