Skip to content

Commit

Permalink
first commit homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
MelanieSarrouy committed Nov 16, 2021
1 parent ff2a31d commit fb43b29
Show file tree
Hide file tree
Showing 22 changed files with 983 additions and 109 deletions.
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"tabWidth": 2
}
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@testing-library/user-event": "^12.1.10",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^6.0.2",
"react-scripts": "4.0.3",
"web-vitals": "^1.0.1"
},
Expand All @@ -34,5 +35,9 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"prettier": "^2.4.1",
"styled-components": "^5.3.3"
}
}
Binary file modified public/favicon.ico
Binary file not shown.
48 changes: 20 additions & 28 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,35 @@
<!DOCTYPE html>
<html lang="en">

<head>

<!-- Informations pour le navigateur -->
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="./favicon.ico" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
<link rel="manifest" href="./manifest.json" />

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<!-- Informations pour le SEO -->
<title>HRnet</title>
<meta name="description" content="employee file management" />

<!-- Feuiles de styles -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Berkshire+Swash&family=Roboto:ital,wght@0,100;0,500;0,700;1,100;1,400&display=swap" rel="stylesheet">

</head>

<body>

<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
<div id="root"></div>

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

</html>
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

25 changes: 0 additions & 25 deletions src/App.js

This file was deleted.

26 changes: 26 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import Header from './components/Header';
import { GlobalStyle } from './styles/bases/globalStyle';
import Homepage from './pages/Homepage'

function App() {
return (
<>
<BrowserRouter>
<GlobalStyle />
<Header />
<main>
<section>
<Routes>
<Route path="/" element={<Homepage />} />
{/* <Route exact path="/employee-list" component={SignIn} />
<Route component={NotFound} /> */}
</Routes>
</section>
</main>
</BrowserRouter>
</>
);
}

export default App;
26 changes: 26 additions & 0 deletions src/components/Header.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react'
import { Link } from 'react-router-dom'
import { NavStyled, StyledLink, Title1 } from '../styles/components/header'


const Header = () => {
return (
<div>
<div>
<Link to="/">
<Title1>HRnet</Title1>
</Link>
</div>
<NavStyled>
<StyledLink to="/">
Create Employee
</StyledLink>
<StyledLink to="/employee-list">
Current Employees
</StyledLink>
</NavStyled>
</div>
)
}

export default Header
50 changes: 50 additions & 0 deletions src/components/Input.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { InputLabel, InputStyle, InputWrapper } from "../styles/components/input"

/**
* Function capitalizeFirstLetter to capitalize label's first letter
* @function
* @name capitalizeFirstLetter
* @param {string} string
* @returns {string}
*/
function capitalizeFirstLetter(string) {
const regex = /-/gi
const newString = string.replace(regex, ' ')
return newString
.toLowerCase()
.split(' ')
.map(word => {
return word[0].toUpperCase() + word.substr(1)
})
.join(' ')
}

/**
* Input component to display input buttons
* @name Input
* @param {string} forAndId
* @param {string} inputType
* @param {string} direction
* @param {string} value
* @param {string} onChange
* @returns {?JSX}
*/

const Input = ({ forAndId, inputType, direction, value, onChange }) => {

return (
<InputWrapper direction={direction}>
<InputLabel htmlFor={forAndId}>
{capitalizeFirstLetter(forAndId)}
</InputLabel>
<InputStyle
type={inputType}
id={forAndId}
value={value}
onChange={onChange}
/>
</InputWrapper>
)
}

export default Input
9 changes: 9 additions & 0 deletions src/datas/department.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const departments = [
'Sales',
'Marketing',
'Engineering',
'Human Resources',
'Legal'
]

export default departments
Loading

0 comments on commit fb43b29

Please sign in to comment.