From 51dbf855c2eea21a42afc3d9565a9c123d314a87 Mon Sep 17 00:00:00 2001 From: developomp Date: Sat, 26 Mar 2022 18:58:11 +0900 Subject: [PATCH] added localization to search button --- src/components/Navbar/SearchButton.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Navbar/SearchButton.tsx b/src/components/Navbar/SearchButton.tsx index 2253ddf..4e254bd 100644 --- a/src/components/Navbar/SearchButton.tsx +++ b/src/components/Navbar/SearchButton.tsx @@ -1,3 +1,4 @@ +import { useContext } from "react" import { Link } from "react-router-dom" import ReactTooltip from "react-tooltip" @@ -6,7 +7,11 @@ import { faSearch } from "@fortawesome/free-solid-svg-icons" import { StyledLink } from "./Navbar" +import { globalContext } from "../../globalContext" + const SearchButton = () => { + const { globalState } = useContext(globalContext) + return ( <>
@@ -21,7 +26,7 @@ const SearchButton = () => {
- Search + {globalState.locale == "en" ? "Search" : "검색"} )