-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/ReCoded-Org/capstone-iraq-rc…
…t-paw-five into dev
- Loading branch information
Showing
38 changed files
with
766 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: Node.js CI | ||
|
||
on: | ||
push: | ||
branches: [ dev ] | ||
pull_request: | ||
branches: [ dev ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [10.x, 12.x, 14.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: yarn install | ||
- run: yarn run fix | ||
# - run: "[[ -z $(git --no-pager diff -- . ':(exclude)yarn.lock' ':(exclude)yarn.lock') ]]" | ||
- run: yarn run test --passWithNoTests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,41 @@ | ||
import React from 'react'; | ||
import { BrowserRouter as Router, Switch, Route } from "react-router-dom"; | ||
import React from 'react' | ||
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom' | ||
import NavBar from './components/NavBar/NavBar' | ||
import { | ||
HOME_ROUTE, | ||
ADOPT_ROUTE, | ||
ABOUT_ROUTE, | ||
RESOURCE_CAT_ROUTE, | ||
RESOURCE_DOG_ROUTE, | ||
LOGIN_ROUTE, | ||
SIGNUP_ROUTE, | ||
CONTACT_US_ROUTE, | ||
} from './routes' | ||
|
||
function App() { | ||
|
||
return ( | ||
<Router> | ||
<Switch> | ||
<Route path="/">{/**<Home/> */}</Route> | ||
<Route path="/AdoptionPage">{/**<AdoptionPage/> */}</Route> | ||
<Route path="/ResourcePage">{/**<ResourcePage/> */}</Route> | ||
<Route path="/Aboutus">{/**<Aboutus/> */}</Route> | ||
<Route path="/DetailsPage">{/**<DetailsPage/> */}</Route> | ||
<Route path="/ContactUs">{/**<ContactUs/> */}</Route> | ||
<Route path="/Login">{/**<Login/> */}</Route> | ||
<Route path="/Signup">{/**<Signup/> */}</Route> | ||
</Switch> | ||
</Router> | ||
); | ||
return ( | ||
<Router> | ||
<NavBar /> | ||
<Switch> | ||
<Route path={ADOPT_ROUTE}>{/** <ADOPT_ROUTE/> */}</Route> | ||
<Route path={ABOUT_ROUTE}>{/** <ABOUT_ROUTE/> */}</Route> | ||
<Route path={LOGIN_ROUTE}>{/** <LOGIN_ROUTE/> */}</Route> | ||
<Route path={SIGNUP_ROUTE}>{/** <SIGNUP_ROUTE/> */}</Route> | ||
<Route path={RESOURCE_CAT_ROUTE}> | ||
{/** <RESOURCE_CAT_ROUTE/> */} | ||
</Route> | ||
<Route path={RESOURCE_DOG_ROUTE}> | ||
{/** <RESOURCE_DOG_ROUTE/> */} | ||
</Route> | ||
<Route path={CONTACT_US_ROUTE}> | ||
{/** <CONTACT_US_ROUTE/> */} | ||
</Route> | ||
<Route path={HOME_ROUTE} exact> | ||
{/** <HOME_ROUTE/> */} | ||
</Route> | ||
</Switch> | ||
</Router> | ||
) | ||
} | ||
|
||
export default App; | ||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
.navBar { | ||
background: linear-gradient(45deg, #fe6b8b, #ff8e53 100%); | ||
padding: 0 !important; | ||
} | ||
|
||
.navBar a { | ||
text-decoration: none; | ||
color: rgb(255, 246, 246) !important; | ||
margin-right: 25px; | ||
margin-left: 25px; | ||
font-weight: 400; | ||
} | ||
|
||
a.dropdown-item { | ||
margin: auto; | ||
} | ||
|
||
.selected { | ||
border-bottom: 2px solid white; | ||
margin-bottom: 3px; | ||
} | ||
|
||
.nav-link { | ||
transition: color 0.5s; | ||
} | ||
.nav-link:hover { | ||
color: #696964 !important; | ||
} | ||
|
||
a.dropdown-item { | ||
color: #ff8e53 !important; | ||
margin: auto; | ||
} | ||
|
||
.dropdown-item:active { | ||
background: white; | ||
} | ||
.logo { | ||
margin-left: 10px; | ||
} | ||
.logo img { | ||
width: 55px; | ||
height: 55px; | ||
} | ||
.navbar-light .navbar-toggler-icon { | ||
background-image: url('../../images/burger.png'); | ||
} | ||
|
||
.navbar-toggler-icon { | ||
display: inline-block; | ||
width: 1.3em; | ||
height: 1em; | ||
} | ||
.navbar-light .navbar-toggler { | ||
border-color: rgba(0, 0, 0, 0); | ||
} | ||
|
||
.selectLang { | ||
background: none; | ||
color: rgb(255, 246, 246) !important; | ||
font-weight: 400; | ||
border: none; | ||
margin-right: 0px; | ||
padding: 10; | ||
outline-style: none; | ||
box-shadow: none; | ||
border-color: transparent; | ||
} | ||
|
||
.selectLang:focus { | ||
outline: none; | ||
box-shadow: none; | ||
} | ||
.selectLang option { | ||
color: #ff8e53 !important; | ||
font-weight: 300; | ||
font-size: 18px !important; | ||
text-align: center; | ||
} | ||
|
||
.firstOption{ | ||
display: none; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
import React, { useState, useEffect } from 'react' | ||
import { Navbar, Nav, NavDropdown, Form } from 'react-bootstrap' | ||
import { useTranslation } from 'react-i18next' | ||
import i18next from 'i18next' | ||
import { BrowserRouter as Router, NavLink } from 'react-router-dom' | ||
import './NavBar.css' | ||
import { | ||
HOME_ROUTE, | ||
ADOPT_ROUTE, | ||
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' | ||
|
||
export default function NavBar() { | ||
const { t } = useTranslation() | ||
const [dirProperties, setDir] = useState({ | ||
dir: 'ltr', | ||
className: 'ml-auto', | ||
}) | ||
|
||
const selectedLanguage = (lang) => { | ||
i18next.changeLanguage(lang) | ||
} | ||
const handelOption = (e) => { | ||
selectedLanguage(e.target.value) | ||
} | ||
|
||
const handelDir = () => { | ||
if (localStorage.getItem('i18nextLng') !== 'en') { | ||
const newDir = 'rtl' | ||
const newClassName = 'mr-auto' | ||
const newdirProperties = { ...dirProperties } | ||
newdirProperties.dir = newDir | ||
newdirProperties.className = newClassName | ||
setDir(newdirProperties) | ||
} else { | ||
const newDir = 'ltr' | ||
const newClassName = 'ml-auto' | ||
const newdirProperties = { ...dirProperties } | ||
newdirProperties.dir = newDir | ||
newdirProperties.className = newClassName | ||
setDir(newdirProperties) | ||
} | ||
} | ||
|
||
useEffect(() => { | ||
handelDir() | ||
}, [localStorage.getItem('i18nextLng')]) | ||
|
||
return ( | ||
<div dir={dirProperties.dir} data-testid="NavBar"> | ||
<Router> | ||
<Navbar className="navBar" expand="lg"> | ||
<Navbar.Brand className="logo" as={NavLink} to={HOME_ROUTE}> | ||
<img src={logo} alt="" /> | ||
</Navbar.Brand> | ||
<Navbar.Toggle /> | ||
<Navbar.Collapse id="basic-navbar-nav"> | ||
<Nav className={dirProperties.className}> | ||
<Nav.Link | ||
as={NavLink} | ||
to={HOME_ROUTE} | ||
activeClassName="selected" | ||
exact | ||
> | ||
{t('navbar.home')} | ||
</Nav.Link> | ||
<Nav.Link | ||
as={NavLink} | ||
to={ABOUT_ROUTE} | ||
activeClassName="selected" | ||
exact | ||
> | ||
{t('navbar.about')} | ||
</Nav.Link> | ||
<Nav.Link | ||
as={NavLink} | ||
to={ADOPT_ROUTE} | ||
RESOURCE_CAT_ROUTE | ||
activeClassName="selected" | ||
exact | ||
> | ||
{t('navbar.adopt')} | ||
</Nav.Link> | ||
<NavDropdown | ||
className="drop" | ||
title={t('navbar.resources.0')} | ||
> | ||
<NavDropdown.Item | ||
as={NavLink} | ||
activeClassName="selected" | ||
exact | ||
to={RESOURCE_CAT_ROUTE} | ||
> | ||
{t('navbar.resources.1')} | ||
</NavDropdown.Item> | ||
<NavDropdown.Item | ||
as={NavLink} | ||
activeClassName="selected" | ||
exact | ||
to={RESOURCE_DOG_ROUTE} | ||
> | ||
{t('navbar.resources.2')} | ||
</NavDropdown.Item> | ||
</NavDropdown> | ||
<Nav.Link | ||
as={NavLink} | ||
activeClassName="selected" | ||
exact | ||
to={CONTACT_US_ROUTE} | ||
> | ||
{t('navbar.contact')} | ||
</Nav.Link> | ||
<Nav.Link | ||
as={NavLink} | ||
activeClassName="selected" | ||
exact | ||
to={LOGIN_ROUTE} | ||
> | ||
{t('navbar.logIn')} | ||
</Nav.Link> | ||
<Nav.Link className="fa"> | ||
<Form.Control | ||
className="selectLang" | ||
onChange={handelOption} | ||
as="select" | ||
size="sm" | ||
custom | ||
value="" | ||
> | ||
<option selected className="firstOption fa"> | ||
 | ||
</option> | ||
<option value='en'>English</option> | ||
<option value='ar'>عربي</option> | ||
<option value='krd'>كردى</option> | ||
</Form.Control> | ||
</Nav.Link> | ||
</Nav> | ||
</Navbar.Collapse> | ||
</Navbar> | ||
</Router> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.