diff --git a/.eslintrc.js b/.eslintrc.js index ed92899..9f9e50b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -112,6 +112,7 @@ module.exports = { 'react/jsx-indent-props': ['off'], 'react/jsx-one-expression-per-line': ['off'], 'react/jsx-no-target-blank': ['off'], + 'react/jsx-curly-newline': ['off'], 'react/no-array-index-key': ['off'], 'react/react-in-jsx-scope': ['off'], 'semi': ['off'], diff --git a/components/ArrowLeftIcon.tsx b/components/ArrowLeftIcon.tsx new file mode 100644 index 0000000..da3e398 --- /dev/null +++ b/components/ArrowLeftIcon.tsx @@ -0,0 +1,13 @@ +import React from 'react' + +const ArrowLeftIcon = () => { + return ( +
+ + + +
+ ) +} + +export default ArrowLeftIcon \ No newline at end of file diff --git a/components/GoBack.tsx b/components/GoBack.tsx new file mode 100644 index 0000000..4073dff --- /dev/null +++ b/components/GoBack.tsx @@ -0,0 +1,31 @@ +import React from 'react'; +import { useRouter } from 'next/router'; + +import ArrowLeftIcon from './ArrowLeftIcon'; +import Headline from './Headline'; + +import { + GO_BACK, +} from '../constants/strings'; + +const GoBack = ({}) => { + + const router = useRouter() + + return ( +
router.back()}> +
+
+ +
+
+ + {` ${GO_BACK} `} + +
+
+
+ ) +} + +export default GoBack \ No newline at end of file diff --git a/components/layout.tsx b/components/layout.tsx index 1d6240d..70f5709 100644 --- a/components/layout.tsx +++ b/components/layout.tsx @@ -1,12 +1,27 @@ -import { useState } from 'react' +import React, { useState } from 'react' +import { useRouter } from 'next/router' import Navbar from './Navbar' import Footer from './Footer' +import Section from './Section' +import GoBack from './GoBack' export default function Layout({ children }: any) { - + + const router = useRouter() + const [openMobileNavbar, setOpenMobileNavbar] = useState(false) + const renderGoBack = () => { + if (!(router.pathname == '/' || router.pathname == '/projects')) { + return ( +
+ +
+ ) + } + } + return (
+
+ { renderGoBack() } +
{ children }