diff --git a/src/components/ErrorNotice.js b/src/components/ErrorNotice.js
index 7cbaa06..93fedb5 100644
--- a/src/components/ErrorNotice.js
+++ b/src/components/ErrorNotice.js
@@ -1,35 +1,53 @@
import React from "react";
import styled from 'styled-components';
-import Footer from "./Footer";
export default function ErrorNotice(props) {
const ErrorNotice = styled.div`
margin: 1rem 0;
- padding: 0.5rem;
border: 1px solid #e07c7c;
border-radius: 8px;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #f8d6d6;
+ padding: 10px;
`;
const ErrorMessage = styled.div`
color: #000000;
`;
- const ErrorButton = styled.button
+ const ErrorButton = styled.a
`
- width: 17px;
- height: 28px;
- display:flex;
- background-color: #df4343;
- color: #ffffff;
+ color: red;
+ position: relative;
+ width: 20px;
+ height: 20px;
+ opacity: 0.3;
+
+&:hover {
+ opacity: 1;
+}
+&:before, &:after {
+ position: absolute;
+ left: 15px;
+ content: ' ';
+ height: 19px;
+ width: 2px;
+ background-color: red;
+}
+&:before {
+ transform: rotate(45deg);
+}
+&:after {
+ transform: rotate(-45deg);
+}
+
`;
return (
{props.message}
- x
+
);
}
\ No newline at end of file
diff --git a/src/components/LogInContainer.js b/src/components/LogInContainer.js
index 8edd08e..c4198f7 100644
--- a/src/components/LogInContainer.js
+++ b/src/components/LogInContainer.js
@@ -5,7 +5,6 @@ import Login from './Login';
import Footer from './Footer';
import styled, {css} from 'styled-components';
-import '../login_reg.css';
const BaseApp = styled.div`
display: flex;
color: white;
diff --git a/src/components/NavBar.js b/src/components/NavBar.js
index cbe454d..bfe381d 100644
--- a/src/components/NavBar.js
+++ b/src/components/NavBar.js
@@ -1,4 +1,4 @@
-import React, {useContext,useEffect } from 'react';
+import React, { useState,useContext,useEffect } from 'react';
import { Link } from "react-router-dom";
import UserContext from "../context/UserContext";
import styled,{ css } from 'styled-components';
@@ -92,7 +92,7 @@ const Linker = styled(Link)`
export default function NavBar() {
const { userData, setUserData } = useContext(UserContext);
-
+ const [scrolled, setScrolled] = useState();
const logout = () => {
setUserData({
token: undefined,
@@ -102,7 +102,6 @@ export default function NavBar() {
};
- const [scrolled,setScrolled]=React.useState(false);
const handleScroll=() => {
const offset=window.scrollY;
if(offset > 200 ){
diff --git a/src/components/Register.js b/src/components/Register.js
index 52e0702..df8d428 100644
--- a/src/components/Register.js
+++ b/src/components/Register.js
@@ -35,6 +35,7 @@ const TermsLink = styled.a`
const [phonenumber, setPhonenumber] = useState();
const [username, setUsername] = useState();
const [error, setError] = useState();
+ const [contains8C, setContains8C] = useState(false);
const { setUserData } = useContext(UserContext);
const history = useHistory();
@@ -44,6 +45,12 @@ const TermsLink = styled.a`
try {
const newUser = { username,email,phonenumber,password};
+ const isEmpty = !Object.values(newUser).some(x => (x !== null && x !== ''));
+ console.log("isempty: " + isEmpty )
+ if(isEmpty){
+ setError("Not all Fields are entered")
+ return;
+ }
await Axios.post("https://server-locaft.herokuapp.com/users/register", newUser);
const loginRes = await Axios.post("https://server-locaft.herokuapp.com/users/login", {
email,
@@ -59,6 +66,14 @@ const TermsLink = styled.a`
return err.response.data.msg && setError(err.response.data.msg);
}
};
+ const validatePassword = () => {
+
+ if(password.length >= 8) {
+ setContains8C(true)
+ setError(null)
+ }
+ else { setContains8C(false); setError("The Password needs to be atleast 8 characters") };
+ }
return (
@@ -69,21 +84,22 @@ const TermsLink = styled.a`