diff --git a/messages_example.json b/messages_example.json index 7dc2629..0b85e63 100644 --- a/messages_example.json +++ b/messages_example.json @@ -84,5 +84,6 @@ "description": "Contributions and source code of the AOE Tech Radar are on github:" } }, - "legalInformationLink": "https://www.aoe.com/en/imprint.html" + "legalInformationLink": "https://www.aoe.com/en/imprint.html", + "search": "What are you looking for?" } diff --git a/public/messages.json b/public/messages.json index 7dc2629..0b85e63 100644 --- a/public/messages.json +++ b/public/messages.json @@ -84,5 +84,6 @@ "description": "Contributions and source code of the AOE Tech Radar are on github:" } }, - "legalInformationLink": "https://www.aoe.com/en/imprint.html" + "legalInformationLink": "https://www.aoe.com/en/imprint.html", + "search": "What are you looking for?" } diff --git a/src/components/Search/Search.tsx b/src/components/Search/Search.tsx index b2115b9..5865793 100644 --- a/src/components/Search/Search.tsx +++ b/src/components/Search/Search.tsx @@ -1,4 +1,5 @@ import React, { FormEvent } from "react"; +import { useMessages } from "../../context/MessagesContext"; import classNames from "classnames"; import "./search.scss"; @@ -18,6 +19,7 @@ function Search( { value, onChange, onClose, open = false, onSubmit = () => {} }: SearchProps, ref: any ) { + const { searchPlaceholder } = useMessages(); const closable = onClose !== undefined; const handleSubmit = (e: FormEvent) => { @@ -44,7 +46,7 @@ function Search( onChange(e.target.value); }} className="search__field" - placeholder="What are you looking for?" + placeholder={searchPlaceholder} ref={ref} /> diff --git a/src/context/MessagesContext/index.tsx b/src/context/MessagesContext/index.tsx index a769afd..a635c1c 100644 --- a/src/context/MessagesContext/index.tsx +++ b/src/context/MessagesContext/index.tsx @@ -32,6 +32,7 @@ export interface Messages { socialLinks?: SocialLink[]; legalInformationLink?: string; pageHelp?: PageHelp; + searchPlaceholder?: string; } const MessagesContext = createContext(undefined);