Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: change in routing format #23

Closed
wants to merge 11 commits into from
1 change: 1 addition & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"react-dom": "18.2.0",
"react-icons": "4.4.0",
"react-redux": "8.0.4",
"react-router": "^6.4.2",
"react-router-dom": "6.4.2",
"react-scripts": "5.0.1",
"typescript": "4.8.4",
Expand Down
13 changes: 4 additions & 9 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import { FC } from "react";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import Login from "./pages/login/Login";
import { useRoutes } from "react-router";
import { routes } from "./routes/routes";

const App: FC = () => {
return (
<BrowserRouter>
<Routes>
<Route path="/login" element={<Login />} />
</Routes>
</BrowserRouter>
);
const routing = useRoutes(routes);
return <>{routing}</>;
};

export default App;
5 changes: 4 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import App from "./App";
import reportWebVitals from "./reportWebVitals";

import "./index.css";
import { BrowserRouter } from "react-router-dom";

const root = ReactDOM.createRoot(document.getElementById("root")!);
root.render(
<React.StrictMode>
<App />
<BrowserRouter>
<App />
</BrowserRouter>
</React.StrictMode>
);

Expand Down
12 changes: 6 additions & 6 deletions src/pages/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,26 +100,26 @@ const Login: FC = () => {
</div>
{/*form*/}
<div className="flex w-[90%] flex-col gap-2 text-[#3F72AF]">
<label htmlFor="email" className="text-[14px]">
<label htmlFor="email" className="text-[14px] font-normal">
Email
</label>
<input
type="email"
id="email"
{...formik.getFieldProps("email")}
className="rounded-md px-2 py-1 text-[12px] placeholder-[#3f72af]"
className="rounded-md px-2 py-1 text-[12px] font-light placeholder-[#3f72af]"
placeholder="example@multiemail.us"
/>
</div>
<div className="relative flex w-[90%] flex-col gap-2 text-[#3F72AF]">
<label htmlFor="password" className="text-[14px]">
<label htmlFor="password" className="text-[14px] font-normal">
Password
</label>
<input
type={isPasswordVisible ? "text" : "password"}
id="password"
{...formik.getFieldProps("password")}
className="rounded-md px-2 py-1 text-[12px] placeholder-[#3f72af]"
className="rounded-md px-2 py-1 text-[12px] font-light placeholder-[#3f72af]"
placeholder="password"
/>
{isPasswordVisible ? (
Expand All @@ -136,11 +136,11 @@ const Login: FC = () => {
</div>
<button
type="submit"
className="rounded-md bg-[#5271ff] px-2 py-1 text-[14px] text-white"
className="rounded-md bg-[#5271ff] px-2 py-1 text-[14px] text-white font-normal font-light"
>
Log In
</button>
<p className="text-[12px]">
<p className="text-[12px] font-normal">
Don't have an account yet?
<Link to="/signup" className="text-[#5271ff] underline">
{` Sign Up `}
Expand Down
7 changes: 7 additions & 0 deletions src/routes/routes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Login from "../pages/login/Login";

export const routes = [
{ path: "/", element: <div>Welcome to MultiEmail Admin</div> },
{ path: "/login", element: <Login /> },
{ path: "*", element: <div>404. page not found</div> },
];
16,558 changes: 8,169 additions & 8,389 deletions yarn.lock

Large diffs are not rendered by default.