Skip to content

Commit

Permalink
major changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Billions94 committed Nov 17, 2021
1 parent 917fd9b commit 442ed66
Show file tree
Hide file tree
Showing 31 changed files with 3,725 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
.env.development.local
.env.test.local
.env.production.local
.env

npm-debug.log*
yarn-debug.log*
Expand Down
667 changes: 667 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@emotion/react": "^11.6.0",
"@emotion/styled": "^11.6.0",
"@mui/icons-material": "^5.0.3",
"@mui/lab": "^5.0.0-alpha.55",
"@mui/material": "^5.1.1",
"@testing-library/jest-dom": "^5.15.0",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"bootstrap": "^4.6.0",
"date-fns": "^2.25.0",
"formik": "^2.2.9",
"moment": "^2.29.1",
"react": "^17.0.2",
"react-bootstrap": "^1.6.4",
"react-dom": "^17.0.2",
"react-router-dom": "^5.3.0",
"react-scripts": "4.0.3",
"web-vitals": "^1.1.2"
"web-vitals": "^1.1.2",
"yup": "^0.32.11"
},
"scripts": {
"start": "react-scripts start",
Expand Down
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href='https://upload.wikimedia.org/wikipedia/commons/thumb/c/ca/LinkedIn_logo_initials.png/600px-LinkedIn_logo_initials.png' />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
Expand All @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>LinkedIn</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
3 changes: 3 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@import url("https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css");

.App {
text-align: center;
background-color: rgb(243, 242, 239);
}

.App-logo {
Expand Down
40 changes: 24 additions & 16 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
import logo from './logo.svg';
import './App.css';
import "bootstrap/dist/css/bootstrap.min.css";
import "./App.css";
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import NavBar from "./components/Navbar/NavBar";
import MyProfile from "./components/Profiles/MyProfile/Profile";
import MyFooter from "./components/Footer/MyFooter";
// import Home from "./Components/MyFeed/Home";
import {useState, useEffect} from "react"

function App() {

const [currentUser, setCurrentUser] = useState({})


useEffect(() => {
console.log(`i am the currentUser`,currentUser)
},[currentUser])

return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<Router>
<NavBar currentUser={currentUser} />
{/* <Route path="/home" exact component={Home} /> */}

<Route path="/profile/:id" exact render={(props) => <MyProfile {...props} setCurrentUser={setCurrentUser} />} />

<MyFooter />
</Router>
</div>
);
}
Expand Down
28 changes: 28 additions & 0 deletions src/Lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const { REACT_APP_TOKEN, REACT_APP_ME } = process.env;

export const token = REACT_APP_TOKEN;
export const me = REACT_APP_ME;

export const postTimer = (x) => {
const postedDateISO = x;
const postedDate = new Date(postedDateISO).getTime();
const dateToday = new Date().getTime();
const milliseconds = Math.abs(dateToday - postedDate).toString();

const minutes = parseInt(milliseconds / 1000 / 60);
const hours = parseInt(minutes / 60);
const days = parseInt(hours / 24);
const weeks = parseInt(days / 7);
let date;

if (weeks > 0) {
date = `${weeks}w`;
} else if (days > 0) {
date = `${days}d`;
} else if (days == 0 && hours >= 1) {
date = `${hours}hr`;
} else if (hours < 1) {
date = `${minutes}min`;
}
return date;
};
Loading

0 comments on commit 442ed66

Please sign in to comment.