Skip to content

Commit

Permalink
completed login
Browse files Browse the repository at this point in the history
  • Loading branch information
klay964 committed Mar 26, 2021
1 parent c637062 commit 9421565
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 7 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"i18next-browser-languagedetector": "^6.0.1",
"i18next-http-backend": "^1.1.1",
"prettier": "^2.2.1",
"prop-types": "^15.7.2",
"react": "^17.0.1",
"react-bootstrap": "^1.5.2",
"react-dom": "^17.0.1",
Expand Down
21 changes: 21 additions & 0 deletions src/components/Modals/Login/Login.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.bg-modal-login {
background-image: url('../../../images/login/bg-modal.svg');
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}

@media (max-width: 522px) {
.bg-modal-login {
background-image: url('../../../images/login/bg-modal.svg');
background-repeat: no-repeat;
background-position: right;
background-size: cover;
}
.bg-modal-login-2 {
background-image: url('../../../images/login/bg-modal.svg');
background-repeat: no-repeat;
background-position: 15% 15%;
background-size: cover;
}
}
63 changes: 63 additions & 0 deletions src/components/Modals/Login/Login.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import React from 'react'
import PropTypes from 'prop-types'
import { Modal, Button } from 'react-bootstrap'
import './Login.css'
import Close from '../../../images/login/close.svg'

function Login({ onHide }) {
return (
<div>
<Modal show centered className="rounded">
<div className="bg-modal-login bg-modal-login-2">
<div className="d-flex justify-content-end">
<button
type="button"
className="bg-transparent border-0 m-1"
onClick={onHide}
>
<img
src={Close}
className="w-75 h-75"
alt="close modal"
/>
</button>
</div>
<div className="d-flex justify-content-center text-white mt-2">
<h3>Log In</h3>
</div>
<div className="d-flex justify-content-center mt-5 mb-5">
<Button className="bg-white w-50">
<div className="col s12 m6 offset-m3 center-align">
<div
className="oauth-container btn darken-4 white black-text d-flex"
style={{ textTransform: 'none' }}
>
<div className="left">
<img
width="20px"
style={{
marginRight: '8px',
}}
alt="Google sign-in"
src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Google_%22G%22_Logo.svg/512px-Google_%22G%22_Logo.svg.png"
/>
</div>
Login with Google
</div>
</div>
</Button>
</div>
<div className="d-flex justify-content-center mb-5 pb-5">
<Button className="bg-white w-50">Light</Button>
</div>
</div>
</Modal>
</div>
)
}

Login.propTypes = {
onHide: PropTypes.func.isRequired,
}

export default Login
22 changes: 15 additions & 7 deletions src/components/NavBar/NavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@ import {
ABOUT_ROUTE,
RESOURCE_CAT_ROUTE,
RESOURCE_DOG_ROUTE,
LOGIN_ROUTE,
CONTACT_US_ROUTE,
} from '../../routes'
import 'bootstrap/dist/css/bootstrap.min.css'
import logo from '../../images/logo.ico'
import Login from '../Modals/Login/Login'

export default function NavBar() {
const { t } = useTranslation()
const [dirProperties, setDir] = useState({
dir: 'ltr',
className: 'ml-auto',
})
const [showLoginModal, setShowLoginModal] = useState(false)

const selectedLanguage = (lang) => {
i18next.changeLanguage(lang)
Expand Down Expand Up @@ -117,10 +118,10 @@ export default function NavBar() {
{t('navbar.contact')}
</Nav.Link>
<Nav.Link
as={NavLink}
activeClassName="selected"
exact
to={LOGIN_ROUTE}
onClick={() => {
setShowLoginModal(!showLoginModal)
}}
>
{t('navbar.logIn')}
</Nav.Link>
Expand All @@ -136,15 +137,22 @@ export default function NavBar() {
<option selected className="firstOption fa">
&#xf1ab;
</option>
<option value='en'>English</option>
<option value='ar'>عربي</option>
<option value='krd'>كردى</option>
<option value="en">English</option>
<option value="ar">عربي</option>
<option value="krd">كردى</option>
</Form.Control>
</Nav.Link>
</Nav>
</Navbar.Collapse>
</Navbar>
</Router>
{showLoginModal ? (
<Login
onHide={() => {
setShowLoginModal(!showLoginModal)
}}
/>
) : null}
</div>
)
}
Loading

0 comments on commit 9421565

Please sign in to comment.