diff --git a/src/App.tsx b/src/App.tsx
index a5a08be..abbaa1f 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,10 +1,12 @@
import GlobalStyle from '@styles/global';
+import BaseLayout from '@pages/BaseLayout';
+
export default function App() {
return (
- it works!
+ it works!
);
}
diff --git a/src/components/Footer/Footer.cy.tsx b/src/components/Footer/Footer.cy.tsx
index 9700767..583815c 100644
--- a/src/components/Footer/Footer.cy.tsx
+++ b/src/components/Footer/Footer.cy.tsx
@@ -72,8 +72,4 @@ describe('', () => {
'1px solid rgb(251, 176, 77)',
);
});
-
- it('should line has margin: 0 8.4375rem', () => {
- cy.getByCy('line').should('have.css', 'margin', '0px 135px');
- });
});
diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx
index 1c50bfd..e4d41cd 100644
--- a/src/components/Footer/Footer.tsx
+++ b/src/components/Footer/Footer.tsx
@@ -23,59 +23,57 @@ const Footer = () => {
};
return (
- <>
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
);
};
diff --git a/src/components/Footer/styles.ts b/src/components/Footer/styles.ts
index 42ee99c..98a00b1 100644
--- a/src/components/Footer/styles.ts
+++ b/src/components/Footer/styles.ts
@@ -1,12 +1,13 @@
import styled from 'styled-components';
export const Footer = styled.footer`
+ position: relative;
background-color: var(--purple-dark);
padding: 4.375rem 8.4375rem 6.875rem 8.4375rem;
display: flex;
justify-content: space-between;
align-items: flex-start;
- width: 100vw;
+ width: 100%;
.text {
justify-content: flex-start;
@@ -45,6 +46,11 @@ export const Circle = styled.div`
`;
export const Line = styled.hr`
+ position: absolute;
border: 1px solid var(--yellow);
- margin: 0 8.4375rem;
+ top: 0;
+ left: 8.4375rem;
+ right: 8.4375rem;
+ width: calc(100% - 16.875rem);
+ z-index: 1;
`;
diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx
index 57d330f..a1f4083 100644
--- a/src/components/Header/Header.tsx
+++ b/src/components/Header/Header.tsx
@@ -8,32 +8,35 @@ const Header = () => {
console.log('first');
};
return (
-
-
-
-
-
-
-
-
-
-
+ <>
+
+
+
+
+
+
+
+
+
+
+
+ >
);
};
diff --git a/src/components/Header/styles.ts b/src/components/Header/styles.ts
index 79bc228..6d2da09 100644
--- a/src/components/Header/styles.ts
+++ b/src/components/Header/styles.ts
@@ -7,7 +7,10 @@ export const Header = styled.header`
display: flex;
justify-content: space-between;
align-items: center;
- width: 100vw;
+ width: 100%;
+ top: 0;
+ left: 0;
+ z-index: 2;
.text-container {
display: flex;
@@ -19,3 +22,13 @@ export const Header = styled.header`
gap: 1.5rem;
}
`;
+
+export const Line = styled.hr`
+ position: fixed;
+ border: 1px solid black;
+ top: calc(6.4375rem - 2px);
+ left: 8.4375rem;
+ right: 8.4375rem;
+ width: calc(100% - 16.875rem);
+ z-index: 3;
+`;
diff --git a/src/pages/BaseLayout/BaseLayout.cy.tsx b/src/pages/BaseLayout/BaseLayout.cy.tsx
new file mode 100644
index 0000000..2787d5f
--- /dev/null
+++ b/src/pages/BaseLayout/BaseLayout.cy.tsx
@@ -0,0 +1,21 @@
+import BaseLayout from './BaseLayout';
+import GlobalStyle from '@styles/global';
+
+const Sut = () => (
+ <>
+
+
+ children
+
+ >
+);
+
+describe('', () => {
+ beforeEach(() => {
+ cy.mount();
+ });
+
+ it('should main content has padding-top: 6.4375rem', () => {
+ cy.getByCy('main-content').should('have.css', 'padding-top', '103px');
+ });
+});
diff --git a/src/pages/BaseLayout/BaseLayout.test.tsx b/src/pages/BaseLayout/BaseLayout.test.tsx
new file mode 100644
index 0000000..e03d424
--- /dev/null
+++ b/src/pages/BaseLayout/BaseLayout.test.tsx
@@ -0,0 +1,31 @@
+import { render, screen } from '@testing-library/react';
+
+import BaseLayout from './BaseLayout';
+
+describe('', () => {
+ beforeEach(() => {
+ render(
+
+
+ ,
+ );
+ });
+
+ it('should render the header', () => {
+ screen.getByTestId('header');
+ });
+
+ it('should render the footer', () => {
+ screen.getByTestId('footer');
+ });
+
+ it('should render the main content', () => {
+ screen.getByTestId('main-content');
+ });
+
+ it('should render the children', () => {
+ screen.getByTestId('children');
+ });
+});
diff --git a/src/pages/BaseLayout/BaseLayout.tsx b/src/pages/BaseLayout/BaseLayout.tsx
new file mode 100644
index 0000000..c9ec7c2
--- /dev/null
+++ b/src/pages/BaseLayout/BaseLayout.tsx
@@ -0,0 +1,22 @@
+import React from 'react';
+
+import Header from '@components/Header';
+import Footer from '@components/Footer';
+
+import * as S from './styles';
+
+type BaseLayoutProps = {
+ children: React.ReactNode;
+};
+
+const BaseLayout = ({ children }: BaseLayoutProps) => {
+ return (
+ <>
+
+ {children}
+
+ >
+ );
+};
+
+export default BaseLayout;
diff --git a/src/pages/BaseLayout/index.ts b/src/pages/BaseLayout/index.ts
new file mode 100644
index 0000000..989df20
--- /dev/null
+++ b/src/pages/BaseLayout/index.ts
@@ -0,0 +1 @@
+export { default } from './BaseLayout';
diff --git a/src/pages/BaseLayout/styles.ts b/src/pages/BaseLayout/styles.ts
new file mode 100644
index 0000000..a2074e6
--- /dev/null
+++ b/src/pages/BaseLayout/styles.ts
@@ -0,0 +1,5 @@
+import styled from 'styled-components';
+
+export const Main = styled.main`
+ padding-top: 6.4375rem;
+`;