mirror of
https://github.com/lemeow125/Borrowing-TrackerFrontend.git
synced 2024-11-17 06:19:27 +08:00
si register modal sab, scrollable and noyys kaayo iyang scroll bar.
This commit is contained in:
parent
d08b43b3ad
commit
8a53d12c8a
3 changed files with 273 additions and 207 deletions
|
@ -7,7 +7,6 @@ import IconButton from "@mui/material/IconButton";
|
||||||
import Visibility from "@mui/icons-material/Visibility";
|
import Visibility from "@mui/icons-material/Visibility";
|
||||||
import VisibilityOff from "@mui/icons-material/VisibilityOff";
|
import VisibilityOff from "@mui/icons-material/VisibilityOff";
|
||||||
import Checkbox from "@mui/material/Checkbox";
|
import Checkbox from "@mui/material/Checkbox";
|
||||||
import Button from "../Button/Button";
|
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { LoginAPI } from "../API/API";
|
import { LoginAPI } from "../API/API";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import styles from "../../styles";
|
import styles, { colors } from "../../styles";
|
||||||
import { colors } from "../../styles";
|
|
||||||
import TextField from "@mui/material/TextField";
|
import TextField from "@mui/material/TextField";
|
||||||
import InputAdornment from "@mui/material/InputAdornment";
|
import InputAdornment from "@mui/material/InputAdornment";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import Visibility from "@mui/icons-material/Visibility";
|
import Visibility from "@mui/icons-material/Visibility";
|
||||||
import VisibilityOff from "@mui/icons-material/VisibilityOff";
|
import VisibilityOff from "@mui/icons-material/VisibilityOff";
|
||||||
import { AppRegistration } from "@mui/icons-material";
|
import Logo_dako from "../../assets/Logo_dako.png";
|
||||||
import Button from "../Button/Button";
|
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { RegisterAPI } from "../API/API";
|
import { RegisterAPI } from "../API/API";
|
||||||
import { toast } from "react-toastify";
|
import { toast } from "react-toastify";
|
||||||
|
@ -34,27 +32,61 @@ export default function RegisterModal() {
|
||||||
const [error, setError] = useState("");
|
const [error, setError] = useState("");
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<div className="custom-scrollbar">
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
...styles.flex_row,
|
...styles.flex_column,
|
||||||
...{
|
...{
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
overflowY: "scroll",
|
overflow: "auto",
|
||||||
|
scrollbarWidth: "thin",
|
||||||
|
WebkitOverflowScrolling: "touch",
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<AppRegistration
|
<img
|
||||||
style={{
|
style={{ width: "10rem", height: "auto", alignSelf: "center" }}
|
||||||
height: 64,
|
src={Logo_dako}
|
||||||
width: 64,
|
|
||||||
fill: colors.font_dark,
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
<p style={{ ...styles.text_dark, ...styles.text_L }}>Get Started</p>
|
|
||||||
|
<p
|
||||||
|
style={{
|
||||||
|
...styles.text_normal,
|
||||||
|
fontSize: 24,
|
||||||
|
margin: "0",
|
||||||
|
marginTop: 15,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Create an Account
|
||||||
|
</p>
|
||||||
|
<p style={{ ...styles.text_normal, fontSize: 16, margin: "10" }}>
|
||||||
|
Enter required fields
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={styles.flex_column}>
|
<div style={{ flex: 1, backgroundColor: "pink", margin: "10px" }}>
|
||||||
|
<p
|
||||||
|
style={{
|
||||||
|
...styles.text_dark_red,
|
||||||
|
...styles.text_S,
|
||||||
|
flex: 1,
|
||||||
|
textAlign: "left",
|
||||||
|
marginLeft: 15,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{error}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
...styles.flex_column,
|
||||||
|
marginTop: 30,
|
||||||
|
marginBottom: 55,
|
||||||
|
marginInline: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
<TextField
|
<TextField
|
||||||
id="outlined-helperText"
|
id="outlined-helperText"
|
||||||
label="First Name"
|
label="First Name"
|
||||||
|
@ -86,6 +118,7 @@ export default function RegisterModal() {
|
||||||
value={user.email}
|
value={user.email}
|
||||||
placeholder={"Enter your email"}
|
placeholder={"Enter your email"}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<FormControl style={{ marginTop: "8px" }}>
|
<FormControl style={{ marginTop: "8px" }}>
|
||||||
<FormLabel style={styles.text_dark} id="status-selection">
|
<FormLabel style={styles.text_dark} id="status-selection">
|
||||||
Course
|
Course
|
||||||
|
@ -194,19 +227,18 @@ export default function RegisterModal() {
|
||||||
value={user.confirm_password}
|
value={user.confirm_password}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<p style={{ ...styles.text_dark, ...styles.text_M }}>{error}</p>
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: colors.button_border,
|
backgroundColor: colors.button_border,
|
||||||
marginTop: "16px",
|
|
||||||
width: "100%",
|
|
||||||
height: "2px",
|
height: "2px",
|
||||||
marginBottom: 8,
|
margin: "20px",
|
||||||
|
marginBottom: "40px",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Button
|
|
||||||
type={"dark"}
|
<div style={{ margin: "10px" }}>
|
||||||
label={"Register"}
|
<button
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
if (user.password !== user.confirm_password) {
|
if (user.password !== user.confirm_password) {
|
||||||
setError("Passwords do not match");
|
setError("Passwords do not match");
|
||||||
|
@ -243,7 +275,20 @@ export default function RegisterModal() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
padding: "25px 38px",
|
||||||
|
justifyContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
background: "#FBB217",
|
||||||
|
height: "40px",
|
||||||
|
width: "100%",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Register
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,3 +82,25 @@ button:focus-visible {
|
||||||
background-color: #f9f9f9;
|
background-color: #f9f9f9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.custom-scrollbar {
|
||||||
|
overflow-y: scroll;
|
||||||
|
max-height: 800px;
|
||||||
|
scrollbar-width: thin; /* For Firefox */
|
||||||
|
-webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
|
||||||
|
-ms-overflow-style: none; /* For IE */
|
||||||
|
scrollbar-color: transparent transparent; /* For WebKit */
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-scrollbar::-webkit-scrollbar {
|
||||||
|
width: 6px; /* Adjust the width as needed */
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-scrollbar::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #c4c4c4; /* Color of the thumb */
|
||||||
|
border-radius: 3px; /* Rounded corners of the thumb */
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-scrollbar::-webkit-scrollbar-track {
|
||||||
|
background-color: #f0f0f0; /* Color of the track */
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue