Browse Source

Ajout de modules node et de quelques composants

Lou 3 years ago
parent
commit
da01a3209a

+ 32
- 0
src/App.jsx View File

@@ -0,0 +1,32 @@
1
+import React from "react";
2
+import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
3
+
4
+import Navbar from "./components/Navbar/";
5
+import Home from "./pages/Home/";
6
+import SignupPage from "./pages/Signup";
7
+import LoginPage from "./pages/Login/";
8
+
9
+const App = () => {
10
+	return (
11
+		<div className="App">
12
+			<Router>
13
+				<Navbar />
14
+				<section className="pages">
15
+					<Switch>
16
+						<Route exact path="/">
17
+							<Home />
18
+						</Route>
19
+						<Route exact path="/login">
20
+							<LoginPage />
21
+						</Route>
22
+						<Route exact path="/Signup">
23
+							<SignupPage />
24
+						</Route>
25
+					</Switch>
26
+				</section>
27
+			</Router>
28
+		</div>
29
+	);
30
+};
31
+
32
+export default App;

+ 0
- 29
src/assets/img/star-svgrepo-com.svg View File

@@ -26,33 +26,4 @@
26 26
 	</g>
27 27
 </g>
28 28
 <g>
29
-</g>
30
-<g>
31
-</g>
32
-<g>
33
-</g>
34
-<g>
35
-</g>
36
-<g>
37
-</g>
38
-<g>
39
-</g>
40
-<g>
41
-</g>
42
-<g>
43
-</g>
44
-<g>
45
-</g>
46
-<g>
47
-</g>
48
-<g>
49
-</g>
50
-<g>
51
-</g>
52
-<g>
53
-</g>
54
-<g>
55
-</g>
56
-<g>
57
-</g>
58 29
 </svg>

+ 13
- 2
src/components/Navbar/index.jsx View File

@@ -1,4 +1,5 @@
1 1
 import React from "react";
2
+import { Link } from "react-router-dom";
2 3
 import "./index.scss";
3 4
 import Star from "../../assets/img/star-svgrepo-com.svg";
4 5
 
@@ -6,7 +7,7 @@ const Navbar = () => {
6 7
 	return (
7 8
 		<div className="navbar">
8 9
 			<div className="navbar__LeftSide">
9
-				<a href="">
10
+				<Link to="/">
10 11
 					<img
11 12
 						src={Star}
12 13
 						class="navbar__Icon"
@@ -15,7 +16,17 @@ const Navbar = () => {
15 16
 						height="25"
16 17
 					/>
17 18
 					<p class="navbar__BrandName">Registra</p>
18
-				</a>
19
+				</Link>
20
+			</div>
21
+			<div className="navbar__RightSide">
22
+				<Link to="/signup">
23
+					<button>S'inscrire</button>
24
+				</Link>
25
+				<Link to="/login">
26
+					<button>Se connecter</button>
27
+				</Link>
28
+				<button>Profil</button>
29
+				<button>Déconnexion</button>
19 30
 			</div>
20 31
 		</div>
21 32
 	);

+ 21
- 9
src/components/Navbar/index.scss View File

@@ -1,31 +1,43 @@
1 1
 .navbar{
2
-  position: sticky;
2
+  display: flex;
3
+  align-items:center;
4
+  justify-content: space-between;
3 5
   background-color: #262626;
4 6
   height: 50px;
5 7
   width: 100%;
6 8
   margin-top: 5px;
7 9
 
10
+
8 11
   &:before{
9 12
     content: '';
10 13
     background: linear-gradient(to right, #B4D4F2, #F2B4D4, #D4F2B4);
11 14
     display: block;
12
-    position: relative;
13
-    top: -5px;
15
+    position: absolute;
16
+    top: 0px;
14 17
     width: 100%;
15 18
     height: 5px;
16 19
   }
17 20
   
18 21
   .navbar__LeftSide{
19
-    display: flex;
20
-    flex-direction: row;
21
-    justify-content: start;
22 22
     margin-left: 15px;
23
-    width: 33%;
24
-
25
-    .navbar__Icon{}
23
+    a{
24
+      display: flex;
25
+      align-items: center;
26
+      justify-content: space-between;
27
+      width: 100px;
28
+    }
26 29
 
27 30
     .navbar__BrandName{
28 31
       font-family: monospace;
32
+      font-weight: 600;
33
+      color: #F2B4D4;
29 34
     }
30 35
   }
36
+
37
+  .navbar__RightSide{
38
+    display: flex;
39
+    justify-content: space-between;
40
+    width: 350px;
41
+    margin-right: 15px;
42
+  }
31 43
 } 

+ 17
- 0
src/components/forms/LoginForm/index.jsx View File

@@ -0,0 +1,17 @@
1
+import React from "react";
2
+import "./index.scss";
3
+
4
+const LoginForm = () => {
5
+	return (
6
+		<div className="LoginForm">
7
+			<form>
8
+				<label for="email">Adresse email</label>
9
+				<input type="email" id="email" name="email" />
10
+				<label for="password">Mot de passe</label>
11
+				<input type="password" id="password" name="password" />
12
+			</form>
13
+		</div>
14
+	);
15
+};
16
+
17
+export default LoginForm;

+ 0
- 0
src/components/forms/LoginForm/index.scss View File


+ 21
- 0
src/components/forms/SignupForm/index.jsx View File

@@ -0,0 +1,21 @@
1
+import React from "react";
2
+import "./index.scss";
3
+
4
+const SignupForm = () => {
5
+	return (
6
+		<div className="signupForm">
7
+			<form>
8
+				<label for="username">Nom d'utilisateur</label>
9
+				<input type="text" id="username" name="username" />
10
+				<label for="email">Adresse email</label>
11
+				<input type="email" id="email" name="email" />
12
+				<label for="password">Mot de passe</label>
13
+				<input type="password" id="password" name="password" />
14
+				<label for="confirm_password">Confirmation du mot de passe</label>
15
+				<input type="password" id="confirm_password" name="confirm_password" />
16
+			</form>
17
+		</div>
18
+	);
19
+};
20
+
21
+export default SignupForm;

+ 15
- 0
src/components/forms/SignupForm/index.scss View File

@@ -0,0 +1,15 @@
1
+.signupForm{
2
+  display: flex; 
3
+  align-items: center;
4
+  justify-content: center;
5
+  width: 300px;
6
+
7
+  form{
8
+    display: flex;
9
+    flex-direction: column;
10
+
11
+    input{
12
+      margin-bottom: 10px;
13
+    }
14
+  }
15
+}

+ 2
- 4
src/main.jsx View File

@@ -1,12 +1,10 @@
1 1
 import React from "react";
2 2
 import ReactDOM from "react-dom";
3
-import "./main.css";
4
-import App from "./pages/App/App.jsx";
5
-import Navbar from "./components/Navbar/index";
3
+import "./main.scss";
4
+import App from "./App.jsx";
6 5
 
7 6
 ReactDOM.render(
8 7
 	<React.StrictMode>
9
-		<Navbar />
10 8
 		<App />
11 9
 	</React.StrictMode>,
12 10
 	document.getElementById("root"),

src/main.css → src/main.scss View File


+ 0
- 42
src/pages/App/App.css View File

@@ -1,42 +0,0 @@
1
-.App {
2
-  text-align: center;
3
-}
4
-
5
-.App-logo {
6
-  height: 40vmin;
7
-  pointer-events: none;
8
-}
9
-
10
-@media (prefers-reduced-motion: no-preference) {
11
-  .App-logo {
12
-    animation: App-logo-spin infinite 20s linear;
13
-  }
14
-}
15
-
16
-.App-header {
17
-  background-color: #282c34;
18
-  min-height: 100vh;
19
-  display: flex;
20
-  flex-direction: column;
21
-  align-items: center;
22
-  justify-content: center;
23
-  font-size: calc(10px + 2vmin);
24
-  color: white;
25
-}
26
-
27
-.App-link {
28
-  color: #61dafb;
29
-}
30
-
31
-@keyframes App-logo-spin {
32
-  from {
33
-    transform: rotate(0deg);
34
-  }
35
-  to {
36
-    transform: rotate(360deg);
37
-  }
38
-}
39
-
40
-button {
41
-  font-size: calc(10px + 2vmin);
42
-}

+ 0
- 10
src/pages/App/App.jsx View File

@@ -1,10 +0,0 @@
1
-import React, { useState } from "react";
2
-import "./App.css";
3
-
4
-const App = () => {
5
-	const [count, setCount] = useState(0);
6
-
7
-	return <div className="App"></div>;
8
-};
9
-
10
-export default App;

+ 11
- 0
src/pages/Home/index.jsx View File

@@ -0,0 +1,11 @@
1
+import React from "react";
2
+
3
+const Home = () => {
4
+	return (
5
+		<div className="test">
6
+			<h2>Home</h2>
7
+		</div>
8
+	);
9
+};
10
+
11
+export default Home;

+ 13
- 0
src/pages/Login/index.jsx View File

@@ -0,0 +1,13 @@
1
+import React from "react";
2
+import LoginForm from "../../components/forms/LoginForm/";
3
+
4
+const LoginPage = () => {
5
+	return (
6
+		<div class="LoginPage">
7
+			<h2>Page de connexion</h2>
8
+			<LoginForm />
9
+		</div>
10
+	);
11
+};
12
+
13
+export default LoginPage;

+ 14
- 0
src/pages/Signup/index.jsx View File

@@ -0,0 +1,14 @@
1
+import React from "react";
2
+import "./index.scss";
3
+import SignupForm from "../../components/forms/SignupForm";
4
+
5
+const SignupPage = () => {
6
+	return (
7
+		<div class="SignupPage">
8
+			<h2>Page d'inscription</h2>
9
+			<SignupForm />
10
+		</div>
11
+	);
12
+};
13
+
14
+export default SignupPage;

+ 5
- 0
src/pages/Signup/index.scss View File

@@ -0,0 +1,5 @@
1
+.SignupPage{
2
+  display: flex;
3
+  flex-direction: column;
4
+  align-items: center;
5
+}

Loading…
Cancel
Save