mirror of https://github.com/mkrhere/pw2
Muthu Kumar
3 years ago
17 changed files with 5437 additions and 7764 deletions
File diff suppressed because it is too large
@ -1,28 +0,0 @@ |
|||
import React from "react"; |
|||
import { BrowserRouter as Router, Switch, Route } from "react-router-dom"; |
|||
|
|||
import Home from "./pages/Home"; |
|||
import Exp from "./pages/Exp"; |
|||
import Projects from "./pages/Projects"; |
|||
import Contact from "./pages/Contact"; |
|||
import Live from "./pages/Live"; |
|||
|
|||
import NotFound from "./pages/404"; |
|||
|
|||
function App() { |
|||
return ( |
|||
<Router> |
|||
<Switch> |
|||
<Route exact path="/" component={Home} /> |
|||
<Route exact path="/experience" component={Exp} /> |
|||
<Route exact path="/projects" component={Projects} /> |
|||
<Route exact path="/contact" component={Contact} /> |
|||
<Route exact path="/live" component={Live} /> |
|||
|
|||
<Route component={NotFound} /> |
|||
</Switch> |
|||
</Router> |
|||
); |
|||
} |
|||
|
|||
export default App; |
@ -1,11 +1,31 @@ |
|||
import React from "react"; |
|||
|
|||
import ReactDOM from "react-dom"; |
|||
import "./index.css"; |
|||
import App from "./App"; |
|||
|
|||
import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; |
|||
|
|||
import Home from "./pages/main/Home"; |
|||
import Exp from "./pages/main/Exp"; |
|||
import Projects from "./pages/main/Projects"; |
|||
import Contact from "./pages/main/Contact"; |
|||
import Live from "./pages/main/Live"; |
|||
|
|||
import NotFound from "./pages/main/404"; |
|||
|
|||
ReactDOM.render( |
|||
<React.StrictMode> |
|||
<App /> |
|||
<Router> |
|||
<Routes> |
|||
<Route path="/" element={<Home />} /> |
|||
<Route path="/experience" element={<Exp />} /> |
|||
<Route path="/projects" element={<Projects />} /> |
|||
<Route path="/contact" element={<Contact />} /> |
|||
<Route path="/live" element={<Live />} /> |
|||
|
|||
<Route path="/*" element={NotFound} /> |
|||
</Routes> |
|||
</Router> |
|||
</React.StrictMode>, |
|||
document.getElementById("root"), |
|||
); |
|||
|
@ -1,23 +0,0 @@ |
|||
import React, { useEffect, useState } from "react"; |
|||
import Container from "../components/Container"; |
|||
import Timeline from "../components/Timeline"; |
|||
|
|||
const Live: React.FunctionComponent = () => { |
|||
const [tl, setTl] = useState([]); |
|||
|
|||
useEffect(() => { |
|||
fetch("/data/timeline.json") |
|||
.then(res => res.json()) |
|||
.then(setTl) |
|||
.catch(() => {}); |
|||
}, []); |
|||
|
|||
return ( |
|||
<Container hideNav> |
|||
<h1>MKRhere</h1> |
|||
<Timeline contents={tl} /> |
|||
</Container> |
|||
); |
|||
}; |
|||
|
|||
export default Live; |
@ -1,6 +1,6 @@ |
|||
import React from "react"; |
|||
import { Link } from "react-router-dom"; |
|||
import Container from "../components/Container"; |
|||
import Container from "../../components/Container"; |
|||
|
|||
function Home() { |
|||
return ( |
@ -1,7 +1,7 @@ |
|||
import React from "react"; |
|||
import { css } from "@emotion/css"; |
|||
import { useEffect, useState } from "react"; |
|||
import Container from "../components/Container"; |
|||
import Container from "../../components/Container"; |
|||
|
|||
const A = css` |
|||
text-decoration: none; |
@ -1,6 +1,6 @@ |
|||
import React from "react"; |
|||
import { css } from "@emotion/css"; |
|||
import Container from "../components/Container"; |
|||
import Container from "../../components/Container"; |
|||
|
|||
const exp = [ |
|||
{ title: "BlueCube", location: "Chennai", position: "Architectural Intern", year: "2015" }, |
@ -1,6 +1,6 @@ |
|||
import React from "react"; |
|||
import Container from "../components/Container"; |
|||
import Dashed from "../components/Dashed"; |
|||
import Container from "../../components/Container"; |
|||
import Dashed from "../../components/Dashed"; |
|||
|
|||
const Home: React.FunctionComponent = () => { |
|||
return ( |
@ -0,0 +1,38 @@ |
|||
import React, { useEffect, useState } from "react"; |
|||
import Container from "../../components/Container"; |
|||
import Timeline, { TimelineUnits } from "../../components/Timeline"; |
|||
|
|||
type LiveInfo = |
|||
| { |
|||
live: false; |
|||
} |
|||
| { |
|||
live: true; |
|||
videoID: string; |
|||
}; |
|||
|
|||
const Live: React.FunctionComponent = () => { |
|||
const [tl, setTl] = useState<TimelineUnits>([]); |
|||
const [liveInfo, setLiveInfo] = useState<LiveInfo>({ live: false }); |
|||
|
|||
useEffect(() => { |
|||
fetch("/data/timeline.json") |
|||
.then(res => res.json()) |
|||
.then(setTl) |
|||
.catch(() => {}); |
|||
|
|||
fetch("https://api.mkr.pw/live") |
|||
.then(res => res.json()) |
|||
.then(setLiveInfo) |
|||
.catch(() => {}); |
|||
}, []); |
|||
|
|||
return ( |
|||
<Container hideNav> |
|||
<h1>MKRhere</h1> |
|||
<Timeline contents={tl} /> |
|||
</Container> |
|||
); |
|||
}; |
|||
|
|||
export default Live; |
@ -1,6 +1,6 @@ |
|||
import React from "react"; |
|||
import { css } from "@emotion/css"; |
|||
import Container from "../components/Container"; |
|||
import Container from "../../components/Container"; |
|||
|
|||
const exp = [ |
|||
{ |
Loading…
Reference in new issue