Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.3 Migrando para o Styled Components #2

Merged
merged 2 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"styled-components": "^5.3.5",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function App() {
<div>
<Header/>
<Main/>
<Footer/>
{/* <Footer/> */}
</div>
);
}
Expand Down
7 changes: 4 additions & 3 deletions src/components/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import React from 'react'
import styles from './Header.module.css'
import Marca from './Logo/Marca';
import Menu from './menu/Menu';
import { HeaderContainer } from './StylesHeader';

const Header = () => {
return (
<section>
<header>
<section className={styles.Container}>
<HeaderContainer>
<Marca/>
<Menu/>
</header>
</HeaderContainer>
</section>
)
}
Expand Down
35 changes: 10 additions & 25 deletions src/components/Header/Header.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,19 @@
margin: 0;
padding: 0;
box-sizing: border-box;
color: white;
}

section > header{
display: flex;
justify-content: space-around;
align-items: center;
padding: 0 2%;
border: 1px solid rgba(255, 192, 203, 0.422);
margin-bottom: 8px;
body{
background-color: #000049;
}

section > header > h1{
color: pink;
}

section > header > img{
width: 150px;
height: 80px;
}

section >header > nav{
display: flex;
flex-direction: row;
gap: 8px;
justify-content: space-around;
}

section >header > nav > a{
font-size: 18px;
.Container{
/* padding: 0 2%; */
margin: 8px 0;
}

.col{

background-color: #3811e7;
}
2 changes: 1 addition & 1 deletion src/components/Header/Logo/Marca.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import LogoSite from '../../../images/LogoSite.png'
import LogoSite from '../../../images/LogoSite.svg'

const Marca = () => {
return (
Expand Down
37 changes: 37 additions & 0 deletions src/components/Header/StylesHeader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import styled from "styled-components";

export const HeaderContainer = styled.header`
display: flex;
justify-content: space-around;
align-items: center;
background-color: #00006D;
border: 1px solid rgba(255, 192, 203, 0.422);
border-radius: 18px;
box-shadow: -2px 2px 5px rgba(255, 192, 203, 0.622);
margin-bottom: 8px;

& img{
width: 150px;
height: 80px;
}

& nav{
display: flex;
flex-direction: row;
gap: 8px;
justify-content: space-around;
background-color: none;

& a{
font-size: 18px;
cursor: pointer;
color: white;
background-color: none;

:hover{
border-bottom: 1px solid white;
}
}

}
`;
24 changes: 8 additions & 16 deletions src/components/Header/menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,14 @@ import React from 'react'

const Menu = () => {
return (
<nav>
<a>Home |</a>
<a>
<label>Telescopios Espaciais |</label>
{/* <select>
<option value="hubble">Hubble</option>
<option value="james webb">James Webb</option>
<option value="chandra">Chandra</option>
<option value="Kepler">Kepler</option>
<option value="Spitzer">Spitzer</option>
<option value="Fermi">Fermi</option>
</select> */}
</a>

<a>R.E News |</a>
<a>Sobre |</a>
<nav>
<a>Home</a>
<span>|</span>
{/* <a>Telescopios Espaciais |</a>
<a>R.E News |</a> */}
<a>Contatos</a>
<span>|</span>
<a>Sobre</a>
</nav>
)
}
Expand Down
33 changes: 18 additions & 15 deletions src/components/Main/Main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import styles from './Main.module.css';
import { Article, MainA } from './StyleMain';

const Main = () => {
const [dados, setDados] = React.useState(null)
Expand All @@ -19,24 +20,26 @@ const Main = () => {
},[])

return (
<main>
<MainA>
{ dados && dados.map( ({id, imageUrl, newsSite, publisheAt, summary, title, updateAt, url }) => (
<section key={id} className={id % 2 != 0 ? styles.container0 : styles.container1}>
<div className={styles.cont}>
<h1>{title}</h1>
<p>Reportagem do <span><b>{newsSite}</b></span></p>
<p>{updateAt}</p>
<div>
<p>{'-'} {summary}</p>
<img src={imageUrl} />
// <section className={(id) % 2 != 0 ? styles.container0 : styles.container1}>
<Article key={id}>
<div className={`cont`} >
<h1>{title}</h1>
<p className='Report'>Reportagem do <span><b>{newsSite}</b></span></p>
<div>
<p>{'-'} {summary}</p>
<img src={imageUrl} />
</div>
<p className="LinkP">
Link da fonte: <a href={url}>{url}</a>
</p>
</div>
</div>
<p>
Link da fonte: <a href={url}>{url}</a>
</p>
</section>

</Article>
// </section>
) ) }
</main>
</MainA>
)
}

Expand Down
Loading