fixed url locale prefix related errors
This commit is contained in:
parent
ac959933bb
commit
f3f88848e0
2 changed files with 11 additions and 8 deletions
|
@ -1,3 +1,4 @@
|
|||
import { useContext } from "react"
|
||||
import styled from "styled-components"
|
||||
import { Link } from "react-router-dom"
|
||||
|
||||
|
@ -10,6 +11,8 @@ import Sidebar from "../Sidebar"
|
|||
|
||||
import theming from "../../styles/theming"
|
||||
|
||||
import { globalContext } from "../../globalContext"
|
||||
|
||||
const StyledNav = styled.nav`
|
||||
/* set z index to arbitrarily high value to prevent other components from drawing over the navbar */
|
||||
z-index: 9999;
|
||||
|
@ -60,12 +63,15 @@ export const StyledLink = styled.div`
|
|||
`
|
||||
|
||||
const Navbar = () => {
|
||||
const { globalState } = useContext(globalContext)
|
||||
const { locale } = globalState
|
||||
|
||||
return (
|
||||
<StyledNav>
|
||||
<StyledContainer>
|
||||
{/* icon */}
|
||||
<Link to="/">
|
||||
<StyledImg src={process.env.PUBLIC_URL + "/icon/icon_circle.svg"} />
|
||||
<Link to={`/${locale}`}>
|
||||
<StyledImg src="/icon/icon_circle.svg" />
|
||||
</Link>
|
||||
|
||||
{/* nav links */}
|
||||
|
|
|
@ -11,22 +11,19 @@ import { globalContext } from "../../globalContext"
|
|||
|
||||
const SearchButton = () => {
|
||||
const { globalState } = useContext(globalContext)
|
||||
const { locale } = globalState
|
||||
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<Link
|
||||
data-tip
|
||||
data-for="search"
|
||||
to={`${process.env.PUBLIC_URL}/search`}
|
||||
>
|
||||
<Link data-tip data-for="search" to={`/${locale}/search`}>
|
||||
<StyledLink>
|
||||
<FontAwesomeIcon icon={faSearch} />
|
||||
</StyledLink>
|
||||
</Link>
|
||||
</div>
|
||||
<ReactTooltip id="search" type="dark" effect="solid">
|
||||
<span>{globalState.locale == "en" ? "Search" : "검색"}</span>
|
||||
<span>{locale == "en" ? "Search" : "검색"}</span>
|
||||
</ReactTooltip>
|
||||
</>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue