From ac7d51ad32afff5bd21fce4a454f6803808e1f96 Mon Sep 17 00:00:00 2001 From: Petr Hovorka Date: Sat, 3 Jul 2021 18:02:42 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20Add=20district=20names=20to=20s?= =?UTF-8?q?earch=20options?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/appbar/SearchField/SearchField.js | 13 ++++++++++--- .../layout/appbar/SearchField/SearchField.style.js | 12 ++++++++++-- src/utils/queries.js | 1 + 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/components/layout/appbar/SearchField/SearchField.js b/src/components/layout/appbar/SearchField/SearchField.js index b027210..524cc30 100644 --- a/src/components/layout/appbar/SearchField/SearchField.js +++ b/src/components/layout/appbar/SearchField/SearchField.js @@ -12,7 +12,7 @@ import { SET_SNACKBAR_MESSAGE, } from "../../../../utils/municipalitiesReducer"; import { MUNICIPALITY_NAMES_SEARCH_QUERY } from "../../../../utils/queries"; -import { useStyles } from "./SearchField.style"; +import { useSearchFieldStyles, useOptionsStyles } from "./SearchField.style"; export default function SearchField({ inputRef }) { const dispatch = useMunicipalitiesDispatch(); @@ -36,7 +36,8 @@ export default function SearchField({ inputRef }) { } }, [obce.data, obce.loading, obce.error, inputValue, dispatch]); - const classes = useStyles(); + const searchFieldStyles = useSearchFieldStyles(); + const optionsStyles = useOptionsStyles(); const filterOptions = createFilterOptions({ trim: true, @@ -45,7 +46,7 @@ export default function SearchField({ inputRef }) { return ( ( + <> + {option.obec_nazev} + (okres {option.okres_nazev}) + + )} renderInput={(params) => ( ({ +export const useSearchFieldStyles = makeStyles(() => ({ inputRoot: { color: "#fff", }, @@ -9,5 +9,13 @@ export const useStyles = makeStyles(() => ({ }, clearIndicator: { color: "#fff", - }, + } +})); + +export const useOptionsStyles = makeStyles(() => ({ + districtText: { + color: "#666", + marginLeft: ".3rem", + fontSize: ".8rem" + } })); diff --git a/src/utils/queries.js b/src/utils/queries.js index 34a9af0..30c5c4b 100644 --- a/src/utils/queries.js +++ b/src/utils/queries.js @@ -24,6 +24,7 @@ export const MUNICIPALITY_NAMES_SEARCH_QUERY = gql` obce(obec_nazev: $obec_nazev, datum: "2020-11-05") { obec_nazev obec_kod + okres_nazev } } `; From d230b261ac3ab6692c997d97524b4f1d80fba71d Mon Sep 17 00:00:00 2001 From: Petr Hovorka Date: Sat, 3 Jul 2021 19:03:15 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=96=20Bump=20version=20to=203.4.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 347e78b..e4280c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "covid-obce", - "version": "3.3.1", + "version": "3.4.0", "private": true, "homepage": "https://covidvobcich.cz", "dependencies": {