diff --git a/src/components/Layout/HomeHeader.tsx b/src/components/Layout/HomeHeader.tsx
index 8340973..81f0ff0 100644
--- a/src/components/Layout/HomeHeader.tsx
+++ b/src/components/Layout/HomeHeader.tsx
@@ -1,15 +1,15 @@
-import { Fragment } from 'react'
-import { Popover, Transition } from '@headlessui/react'
-import { MenuIcon, XIcon } from '@heroicons/react/outline'
-import { SearchIcon } from '@heroicons/react/solid'
-import { navigationEntries } from './Navbar'
-import { Link } from '../Links'
-import { PrimaryButton } from '../Buttons'
-import { useSearchFichesForm } from '../../utils/hooks'
-import { LogoFull, LogoIcon } from '../Logos'
+import { Fragment } from 'react';
+import { Popover, Transition } from '@headlessui/react';
+import { MenuIcon, XIcon } from '@heroicons/react/outline';
+import { SearchIcon } from '@heroicons/react/solid';
+import { navigationEntries } from './Navbar';
+import { Link } from '../Links';
+import { PrimaryButton } from '../Buttons';
+import { useSearchFichesForm } from '../../utils/hooks';
+import { LogoFull, LogoIcon } from '../Logos';
const SearchForm = () => {
- const { handleSubmit, onChange, value } = useSearchFichesForm()
+ const { handleSubmit, onChange, value } = useSearchFichesForm();
return (
- )
-}
+ );
+};
export const HomeHeader = () => (
-
+
(
-
+
Menu principal
@@ -74,10 +72,18 @@ export const HomeHeader = () => (
-
@@ -95,17 +101,13 @@ export const HomeHeader = () => (
focus
className="absolute top-0 inset-x-0 p-2 transition origin-top-right md:hidden z-10"
>
-
+
-
+
Close main menu
@@ -131,14 +133,18 @@ export const HomeHeader = () => (
- Ressources Santé et Précarité {' '}
- Auvergne Rhône Alpes
+
+ Ressources
+ Santé et Précarité
+ {' '}
+
+ Auvergne Rhône Alpes
+
-
- Ce site se veut être un outil pratique à destination des professionnels de santé.
- Par un système de mots clés, vous serez orientés vers des fiches thématiques.
+
+ Ce site se veut être un outil pratique à destination des
+ professionnels de santé. Par un système de mots clés, vous serez
+ orientés vers des fiches thématiques.
@@ -147,8 +153,16 @@ export const HomeHeader = () => (
@@ -159,4 +173,4 @@ export const HomeHeader = () => (
-)
+);
diff --git a/src/components/Search/SearchFacet.tsx b/src/components/Search/SearchFacet.tsx
index 9af70ca..1385efb 100644
--- a/src/components/Search/SearchFacet.tsx
+++ b/src/components/Search/SearchFacet.tsx
@@ -1,31 +1,28 @@
-import { useRefinementList } from 'react-instantsearch-hooks'
-import { Fragment } from 'react'
-import { Listbox, Transition } from '@headlessui/react'
-import { CheckIcon, SelectorIcon } from '@heroicons/react/solid'
-import classNames from 'classnames'
-import type { RefinementListItem } from 'instantsearch.js/es/connectors/refinement-list/connectRefinementList'
-import { ClassNameProp } from '../../types/react'
+import { Listbox, Transition } from '@headlessui/react';
+import { CheckIcon, SelectorIcon } from '@heroicons/react/solid';
+import classNames from 'classnames';
+import type { RefinementListItem } from 'instantsearch.js/es/connectors/refinement-list/connectRefinementList';
+import { Fragment } from 'react';
+import { useRefinementList } from 'react-instantsearch-hooks';
+import { ClassNameProp } from '../../types/react';
type SearchFacetProps = {
- attribute: string,
- label: string,
- getItemLabel?: (item: RefinementListItem) => string,
- getItemClassName?: (item: RefinementListItem) => string,
+ attribute: string;
+ label: string;
+ getItemLabel?: (item: RefinementListItem) => string;
+ getItemClassName?: (item: RefinementListItem) => string;
} & ClassNameProp;
export const SearchFacet = ({
attribute,
className,
label,
- getItemLabel = item => item.label,
+ getItemLabel = (item) => item.label,
getItemClassName = () => 'bg-gray-light text-blue-default',
}: SearchFacetProps) => {
- const {
- items,
- refine,
- } = useRefinementList({ attribute, limit: 1000 })
+ const { items, refine } = useRefinementList({ attribute, limit: 1000 });
- const refinedItems = items.filter(item => item.isRefined)
+ const refinedItems = items.filter((item) => item.isRefined);
return (
{({ open }) => (
@@ -33,22 +30,28 @@ export const SearchFacet = ({
{label}
-
- {refinedItems.length
- ? refinedItems.map(item => (
+
+ {refinedItems.length ? (
+ refinedItems.map((item) => (
{getItemLabel(item)}
- )) : {label} }
+ ))
+ ) : (
+ {label}
+ )}
-
+
@@ -63,23 +66,32 @@ export const SearchFacet = ({
{items.map((item) => (
classNames(
- active
- ? getItemClassName(item)
- : 'text-gray-900',
- 'cursor-default select-none relative py-2 pl-3 pr-9',
- )}
+ className={({ active }) =>
+ classNames(
+ active ? getItemClassName(item) : 'text-gray-900',
+ 'cursor-default select-none relative py-2 pl-3 pr-9'
+ )
+ }
value={item.value}
>
- {({
- active,
- }) => (
+ {({ active }) => (
<>
-
+
{getItemLabel(item)}
-
+
({item.count})
@@ -88,7 +100,7 @@ export const SearchFacet = ({
@@ -104,5 +116,5 @@ export const SearchFacet = ({
>
)}
- )
-}
+ );
+};
diff --git a/src/pages/annuaire/index.tsx b/src/pages/annuaire/index.tsx
index bd2cf73..b28c6e1 100644
--- a/src/pages/annuaire/index.tsx
+++ b/src/pages/annuaire/index.tsx
@@ -1,28 +1,31 @@
-import { NextSeo } from 'next-seo'
-import { SearchIcon } from '@heroicons/react/solid'
-import { GetStaticProps } from 'next'
-import { Configure } from 'react-instantsearch-hooks'
-import dynamic from 'next/dynamic'
-import { Layout } from '../../components/Layout/Layout'
-import { SearchContext } from '../../components/Search/SearchContext'
-import { IndicesNames } from '../../services/algolia.browser'
-import { SearchInput } from '../../components/Search/SearchInput'
-import { StructuresList } from '../../components/Map/StructuresList'
-import { SearchResults } from '../../components/Search/SearchResults'
-import { Structure } from '../../types/models'
-import { isPreviewForced } from '../../services/contentful'
-import { SearchFacet } from '../../components/Search/SearchFacet'
-import { StructureType, types } from '../../data/structures_types'
-import { FloatingButtons } from '../../components/FloatingButtons'
+import { SearchIcon } from '@heroicons/react/solid';
+import { GetStaticProps } from 'next';
+import { NextSeo } from 'next-seo';
+import dynamic from 'next/dynamic';
+import { Configure } from 'react-instantsearch-hooks';
+import { FloatingButtons } from '../../components/FloatingButtons';
+import { Layout } from '../../components/Layout/Layout';
+import { StructuresList } from '../../components/Map/StructuresList';
+import { SearchContext } from '../../components/Search/SearchContext';
+import { SearchFacet } from '../../components/Search/SearchFacet';
+import { SearchInput } from '../../components/Search/SearchInput';
+import { SearchResults } from '../../components/Search/SearchResults';
+import { StructureType, types } from '../../data/structures_types';
+import { IndicesNames } from '../../services/algolia.browser';
+import { isPreviewForced } from '../../services/contentful';
+import { Structure } from '../../types/models';
const GeoSearch = dynamic>(
- () => import('../../components/Search/GeoSearch').then(module => module.GeoSearch),
+ () =>
+ import('../../components/Search/GeoSearch').then(
+ (module) => module.GeoSearch
+ ),
{
ssr: false,
- },
-)
+ }
+);
-const ALGOLIA_MAX_HITS_PER_PAGE = 1000
+const ALGOLIA_MAX_HITS_PER_PAGE = 1000;
const SearchField = () => (
@@ -30,11 +33,11 @@ const SearchField = () => (
-)
+);
export default function Annuaire() {
return (
@@ -44,27 +47,38 @@ export default function Annuaire() {
-
Annuaire
+
+ Annuaire
+
-
-
+
types[item.value as StructureType].nom}
- getItemClassName={item => types[item.value as StructureType].colorClassname}
- className="relative w-full bg-white border border-gray-default rounded-md shadow-sm pl-3 pr-10 py-2 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-blue-default focus:border-blue-default sm:text-sm"
+ getItemLabel={(item) =>
+ types[item.value as StructureType].nom
+ }
+ getItemClassName={(item) =>
+ types[item.value as StructureType].colorClassname
+ }
+ className="relative w-full bg-white border border-gray-default rounded-md shadow-sm pl-3 py-2 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-blue-default focus:border-blue-default sm:text-sm md:pr-10"
/>
(
- } />
+ }
+ />
)}
/>
@@ -72,13 +86,11 @@ export default function Annuaire() {
- )
+ );
}
-export const getStaticProps: GetStaticProps = async ({
- preview,
-}) => ({
+export const getStaticProps: GetStaticProps = async ({ preview }) => ({
props: {
preview: preview || isPreviewForced,
},
-})
+});