diff --git a/src/pages/Page/Toc.tsx b/src/pages/Page/Toc.tsx index 31cce06..35dfbe4 100644 --- a/src/pages/Page/Toc.tsx +++ b/src/pages/Page/Toc.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from "react" +import { useContext, useEffect, useState } from "react" import { Collapse } from "react-collapse" import storage from "local-storage-fallback" @@ -7,6 +7,7 @@ import { faCaretDown, faCaretUp } from "@fortawesome/free-solid-svg-icons" import styled from "styled-components" import theming from "../../styles/theming" +import { globalContext } from "../../globalContext" const StyledTocToggleButton = styled.button` cursor: pointer; @@ -29,6 +30,7 @@ const StyledCollapseContainer = styled.div` ` const Toc = (props: { data?: string }) => { + const { globalState } = useContext(globalContext) const [isTocOpened, setIsTocOpened] = useState( storage.getItem("isTocOpened") == "true" ) @@ -47,7 +49,7 @@ const Toc = (props: { data?: string }) => { }} > - Table of Contents{" "} + {globalState.locale == "en" ? "Table of Contents " : "목차 "}