Skip to content

Commit

Permalink
Merge pull request #1 from CodeForPhilly/paul/login-page
Browse files Browse the repository at this point in the history
Paul/login page
  • Loading branch information
wavinginspace authored Jun 27, 2023
2 parents b85d5b1 + 9d45c47 commit e9e8bde
Show file tree
Hide file tree
Showing 27 changed files with 531 additions and 200 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
<script type="module" src="/src/Main.tsx"></script>
</body>
</html>
113 changes: 113 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
},
"dependencies": {
"@reduxjs/toolkit": "^1.9.5",
"formik": "^2.4.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.7",
"react-router": "^6.14.0",
"react-router-dom": "^6.14.0",
"redux-toolkit": "^1.1.2",
"uuid": "^9.0.0"
},
Expand All @@ -29,6 +32,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
"postcss": "^8.4.24",
"prettier": "^2.8.8",
"tailwindcss": "^3.3.2",
"typescript": "^5.1.3",
"vite": "^4.3.9"
Expand Down
2 changes: 1 addition & 1 deletion src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

/* Tailwind Styles */

.app {
.container {
@apply relative z-10 flex justify-center items-center flex-col max-w-7xl mx-auto sm:px-16 px-6;
}

Expand Down
18 changes: 5 additions & 13 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import "./App.css";
import Header from "./components/Header";
import Summary from "./components/Summary";
import Summary from "./pages/PatientManager/PatientManager";
import Layout from "./pages/Layout/Layout";

const App = () => {
return (
<>
<main>
<div className="main">
<div className="gradient" />
</div>
<div className="app">
<Header />
<Summary />
</div>
</main>
</>
<Layout>
<Summary />
</Layout>
);
};

Expand Down
9 changes: 6 additions & 3 deletions src/index.tsx → src/Main.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import { Provider } from "react-redux";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import routes from "./routes/routes";

import { store } from "./services/store.tsx";
import { store } from "./services/store";

const router = createBrowserRouter(routes);

ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<Provider store={store}>
<App />
<RouterProvider router={router} />
</Provider>
</React.StrictMode>
);
20 changes: 8 additions & 12 deletions src/assets/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import linkIcon from './link.svg'
import loader from './loader.svg'
import copy from './copy.svg'
import logo from './logo.svg'
import tick from './tick.svg'
// TODO: swap in react-icons instead of svg?

export {
linkIcon,
loader,
copy,
logo,
tick
}
import linkIcon from "./link.svg";
import loader from "./loader.svg";
import copy from "./copy.svg";
import logo from "./logo.svg";
import tick from "./tick.svg";

export { linkIcon, loader, copy, logo, tick };
30 changes: 0 additions & 30 deletions src/components/Header.tsx

This file was deleted.

45 changes: 45 additions & 0 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import logo from "../../assets/balancer.png";
import { Link } from "react-router-dom";
import { useLocation } from "react-router-dom";

const Header = () => {
const { pathname } = useLocation();

return (
<header className="w-full flex justify-center items-center flex-col">
<nav className="flex justify-between items-center w-full pt-3">
<Link to="/">
<img src={logo} alt="logo" className="w-28 object-contain" />
</Link>
{pathname === "/" && (
<>
<Link to="/login" className="hover:text-blue-600 font-bold">
Login
</Link>
<Link to="/register" className="hover:text-blue-600 font-bold">
Register
</Link>
</>
)}
<a
href="https://codeforphilly.org/"
target="_blank"
className="black_btn">
Code for Philly
</a>
</nav>

<h1 className="head_text">
{/* AI-powered Bipolar Medication: <br className="max-md:hidden" /> */}
<span className="orange_gradient">Balancer</span>
</h1>
<h2 className="desc">
Balancer is an innovative AI-powered web application designed to assist
psychiatrists in selecting the most appropriate bipolar medication for
first-time patients. It is open-source and free to use
</h2>
</header>
);
};

export default Header;
Loading

0 comments on commit e9e8bde

Please sign in to comment.