Skip to content

Commit bc606b9

Browse files
Merge pull request #14 from LuizGMiranda/7
feature/header-dashboard
2 parents f1fcffa + b359481 commit bc606b9

File tree

7 files changed

+108
-1
lines changed

7 files changed

+108
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
describe("Page Dashboard", function() {
2+
it("Open page on Desktop", function() {
3+
cy.visit("/dashboard");
4+
});
5+
6+
it("Open page on Mobile", function() {
7+
cy.visit("/dashboard");
8+
cy.viewport("iphone-5");
9+
});
10+
11+
it("Open page on TV 4K", function() {
12+
cy.visit("/dashboard");
13+
cy.viewport(3840, 2160);
14+
});
15+
16+
it("Verify if exist header on Web", function() {
17+
cy.visit("/dashboard");
18+
19+
cy.get("header");
20+
cy.get("header > img");
21+
cy.get("header > div");
22+
});
23+
24+
it("Verify if exist header on Mobile", function() {
25+
cy.visit("/dashboard");
26+
cy.viewport("iphone-5");
27+
28+
cy.get("header");
29+
cy.get("header > img");
30+
cy.get("header > div").should("be.not.visible");
31+
});
32+
});
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from "react";
2+
3+
import { Container, PhotoUser } from "./styles";
4+
import ImageUserDefault from "../../img/userdefault.jpg";
5+
6+
const PhotoUserCollab = ({ img }) => (
7+
<Container>
8+
<PhotoUser src={img ? img : ImageUserDefault} />
9+
</Container>
10+
);
11+
12+
export default PhotoUserCollab;
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import styled from "styled-components";
2+
3+
export const Container = styled.div`
4+
height: 40px;
5+
width: 40px;
6+
border-radius: 50%;
7+
vertical-align: top;
8+
justify-content: center;
9+
align-items: center;
10+
overflow: hidden;
11+
text-decoration: none;
12+
border: 0;
13+
margin: 10px;
14+
position: relative;
15+
16+
@media (max-width: 767.98px) {
17+
display: none;
18+
}
19+
`;
20+
21+
export const PhotoUser = styled.img`
22+
margin: 0;
23+
position: absolute;
24+
top: 50%;
25+
left: 50%;
26+
margin-right: -50%;
27+
transform: translate(-50%, -50%)
28+
`;
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from "react";
2+
3+
import LogoCollab from "../../components/LogoCollab";
4+
import PhotoUserCollab from "../../components/PhotoUserCollab";
5+
6+
import { Header } from "./styles";
7+
8+
export default function HeaderDashboard() {
9+
return (
10+
<Header>
11+
<LogoCollab />
12+
<PhotoUserCollab img={'https://cdn.vox-cdn.com/thumbor/Oi6jzvQzWetJGlkpwLqlP1L9p28=/0x0:5568x3712/1200x800/filters:focal(2858x720:3748x1610)/cdn.vox-cdn.com/uploads/chorus_image/image/62207705/922984782.jpg.0.jpg'} />
13+
</Header>
14+
);
15+
}
16+
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import styled from "styled-components";
2+
3+
export const Header = styled.header`
4+
display: flex;
5+
justify-content: space-between;
6+
align-items: center;
7+
8+
padding: 10px 20px;
9+
10+
img {
11+
height: 40px;
12+
}
13+
14+
@media (max-width: 767.98px) {
15+
justify-content: center;
16+
}
17+
`;

src/img/userdefault.jpg

11.8 KB
Loading

src/pages/Dashboard/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import React from "react";
22

3+
import HeaderDashboard from "../../containers/HeaderDashboard";
4+
35
function Dashboard() {
4-
return <h1>Dashboard</h1>;
6+
return <HeaderDashboard />;
57
}
68

79
export default Dashboard;

0 commit comments

Comments
 (0)