Browse Source

fix: types & build

Signed-off-by: Muthu Kumar <muthukumar@thefeathers.in>
pull/1/head
Muthu Kumar 2 years ago
parent
commit
8d4d94e3ec
Signed by: mkrhere GPG Key ID: 3FD688398897097E
  1. 8
      src/components/Container.tsx
  2. 2
      src/components/Dashed.tsx
  3. 7
      src/index.tsx

8
src/components/Container.tsx

@ -1,6 +1,6 @@
import React, { useState, useEffect, useRef, useLayoutEffect } from "react"; import React, { useState, useEffect, useRef, useLayoutEffect } from "react";
import { css, cx } from "@emotion/css"; import { css, cx } from "@emotion/css";
import { useHistory } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { ReactComponent as Logo } from "../assets/logo.svg"; import { ReactComponent as Logo } from "../assets/logo.svg";
import { ReactComponent as Right } from "../assets/arrow-right.svg"; import { ReactComponent as Right } from "../assets/arrow-right.svg";
@ -24,7 +24,7 @@ const Container: React.FunctionComponent<{
className, className,
...props ...props
}) => { }) => {
const history = useHistory(); const navigate = useNavigate();
const mobile = useMediaQuery("(max-width: 50rem)"); const mobile = useMediaQuery("(max-width: 50rem)");
@ -109,7 +109,7 @@ const Container: React.FunctionComponent<{
document.body.style.maxHeight = "100vh"; document.body.style.maxHeight = "100vh";
document.body.style.overflow = "hidden"; document.body.style.overflow = "hidden";
e.currentTarget.style.width = "0"; e.currentTarget.style.width = "0";
timer(() => next && history.push(next), 300); timer(() => next && navigate(next), 300);
}; };
return ( return (
@ -191,7 +191,7 @@ const Container: React.FunctionComponent<{
)}> )}>
<Logo <Logo
viewBox="0 0 264 264" viewBox="0 0 264 264"
onClick={() => (mobile ? setShowMenu(true) : history.push("/"))} onClick={() => (mobile ? setShowMenu(true) : navigate("/"))}
/> />
</span> </span>
<Menu show={showMenu} setShowMenu={setShowMenu} /> <Menu show={showMenu} setShowMenu={setShowMenu} />

2
src/components/Dashed.tsx

@ -1,7 +1,7 @@
import React from "react"; import React from "react";
import { css } from "@emotion/css"; import { css } from "@emotion/css";
const Dashed: React.FunctionComponent = ({ children }) => ( const Dashed: React.FC<{ children: React.ReactNode }> = ({ children }) => (
<span <span
className={css` className={css`
border-bottom: 1px dashed var(--text-colour); border-bottom: 1px dashed var(--text-colour);

7
src/index.tsx

@ -1,6 +1,6 @@
import React from "react"; import React from "react";
import ReactDOM from "react-dom"; import { createRoot } from "react-dom/client";
import "./index.css"; import "./index.css";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
@ -13,7 +13,7 @@ import Live from "./pages/main/Live";
import NotFound from "./pages/main/404"; import NotFound from "./pages/main/404";
ReactDOM.render( createRoot(document.getElementById("root")!).render(
<React.StrictMode> <React.StrictMode>
<Router> <Router>
<Routes> <Routes>
@ -23,9 +23,8 @@ ReactDOM.render(
<Route path="/contact" element={<Contact />} /> <Route path="/contact" element={<Contact />} />
<Route path="/live" element={<Live />} /> <Route path="/live" element={<Live />} />
<Route path="/*" element={NotFound} /> <Route path="/*" element={<NotFound />} />
</Routes> </Routes>
</Router> </Router>
</React.StrictMode>, </React.StrictMode>,
document.getElementById("root"),
); );

Loading…
Cancel
Save