feat(header): Adiciona header descktop

This commit is contained in:
amanda almeida 2022-12-29 22:30:22 -03:00
parent 0c351a3524
commit 9dda895215
21 changed files with 29037 additions and 0 deletions

23
.gitignore vendored Normal file
View File

@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

28747
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

44
package.json Normal file
View File

@ -0,0 +1,44 @@
{
"name": "react-institucional",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.11",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"sass": "^1.57.1",
"typescript": "^4.9.4",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

BIN
public/IconBusca.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

19
public/index.html Normal file
View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>

BIN
src/assets/img/Cart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

BIN
src/assets/img/arrow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

BIN
src/assets/img/iconHome.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

BIN
src/assets/img/logoM3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

28
src/components/Header.tsx Normal file
View File

@ -0,0 +1,28 @@
import SearchBar from "./SearchBar";
import Logo from "../assets/img/logoM3.png";
import Cart from "../assets/img/Cart.png";
import Link from "./Link";
const Header = () => {
return (
<div className="page-header">
<div className="page-header__container-top">
<img src={Logo} alt="" />
<SearchBar />
<div className="page-header__container-login">
<Link link="/" text="ENTRAR" className="page-header__link" />
<a href="/" aria-label="Carrinho">
<img src={Cart} alt="" className="page-header__cart" />
</a>
</div>
</div>
<div className="page-header__container-bottom">
<Link link="/" text="CURSOS" className="page-header__link" />
<Link link="/" text="SAIBA MAIS" className="page-header__link" />
<Link link="/" text="INSTITUCIONAIS" className="page-header__link" />
</div>
</div>
);
};
export default Header;

15
src/components/Link.tsx Normal file
View File

@ -0,0 +1,15 @@
export interface LinkProps {
link: string;
text: string;
className: string;
}
const Link = (props: LinkProps) => {
return (
<a href={props.link} className={props.className}>
{props.text}
</a>
);
};
export default Link;

View File

@ -0,0 +1,16 @@
import iconBusca from "../assets/img/IconBusca.png";
const SearchBar = () => {
return (
<div className="page-header__busca">
<input
className="page-header__busca-input"
type="text"
placeholder="Buscar..."
/>
<img src={iconBusca} alt="logo M3" className="page-header__busca-icon" />
</div>
);
};
export default SearchBar;

3
src/global.scss Normal file
View File

@ -0,0 +1,3 @@
@import './styles/variables.scss';
@import './styles/reset.scss';
@import './styles/header.scss';

13
src/index.tsx Normal file
View File

@ -0,0 +1,13 @@
import ReactDOM from "react-dom";
import "./global.scss";
import Home from "./pages/Home";
const App = () => {
return (
<div>
<Home />
</div>
);
};
ReactDOM.render(<App />, document.getElementById("root"));

11
src/pages/Home.tsx Normal file
View File

@ -0,0 +1,11 @@
import Header from "../components/Header";
const Home = () => {
return (
<>
<Header />
</>
);
};
export default Home;

1
src/react-app-env.d.ts vendored Normal file
View File

@ -0,0 +1 @@
/// <reference types="react-scripts" />

71
src/styles/header.scss Normal file
View File

@ -0,0 +1,71 @@
.page-header {
display: flex;
flex-direction: column;
background: $black;
&__container-top {
height: 76px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid $gray-600;
padding: 0 100px;
}
&__busca {
position: relative;
width: 264px;
}
&__busca-input {
width: 248px;
height: 32px;
background: $white;
border: 2px solid $gray-700;
border-radius: 5px;
font-weight: 400;
font-size: 14px;
line-height: 16px;
color: $gray-500;
padding: 0;
outline: 0;
padding-left: 16px;
&::placeholder {
color: $gray-500;
}
}
&__busca-icon {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 7px;
width: 18px;
}
&__container-login {
display: flex;
align-items: center;
gap: 55px;
}
&__link {
font-weight: 400;
font-size: 14px;
line-height: 16px;
text-decoration: none;
color: $white;
}
&__container-bottom {
height: 44px;
padding: 0 100px;
display: flex;
align-items: center;
gap: 55px;
}
}

5
src/styles/reset.scss Normal file
View File

@ -0,0 +1,5 @@
* {
padding: 0;
margin: 0;
font-family: $font-family;
}

15
src/styles/variables.scss Normal file
View File

@ -0,0 +1,15 @@
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
$font-family: 'Roboto', sans-serif;
$black: #000;
$white: #fff;
$gray-200: #303030;
$gray-300: #5E5E5E;
$gray-400: #919191;
$gray-500: #C6C6C6;
$gray-600: #C4C4C4;
$gray-700: #F2F2F2;
$gray-800: #F9F9F9;
$red: #FF0000;

26
tsconfig.json Normal file
View File

@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
}