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

Refeito a tela de um partido #82

Merged
2 commits merged into from
Oct 20, 2020
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
2 changes: 2 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
rel="stylesheet"
/>
<title>Câmara dos Deputados</title>

<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet'>
</head>
<body>
<noscript>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function Header() {
<div className="headerRight">
<ul>
<li>
<FaSearch className="iconMenu" size={25} color="#000000" />
<FaSearch className="iconMenu" size={25} />
</li>
<li>
<a
Expand All @@ -34,7 +34,7 @@ export default function Header() {
rel="noopener noreferrer"
className="iconMenu"
>
<FaGithub size={25} color="#000000" />
<FaGithub size={25} color="#2f2f2f" />
</a>
</li>
</ul>
Expand Down
1 change: 1 addition & 0 deletions src/components/Header/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ header {
align-items: center;
background-color: #ffffff;
filter: drop-shadow(0px 4px 10px rgba(0, 0, 0, 0.25));
padding-top: 15px;
}

.headerLeft {
Expand Down
12 changes: 11 additions & 1 deletion src/global.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
html {
height: 100%;
}

body {
font-family: 'Roboto Slab', serif;
font-family: 'Montserrat';
font-style: normal;
font-weight: 500;
line-height: 37px;
background-color: #e5e5e5;
color: #2f2f2f;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coloca esse color no svg dos icones no componente também (ou remove a prop color de lá)

min-height: 100%;
min-width: fit-content;
}
100 changes: 49 additions & 51 deletions src/pages/PartidoInfo/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable jsx-a11y/alt-text */
import React, { useState, useEffect } from 'react';
import axios from 'axios';
import PropTypes from 'prop-types';

import noImage from '../../assets/placeholder-user.png';
import './styles.scss';

const PartidoInfo = ({ match }) => {
Expand All @@ -27,65 +27,63 @@ const PartidoInfo = ({ match }) => {
}, [id]);

return (
<div>
<section className="hero is-dark">
<div className="hero-body">
<div className="container">
<h1 className="title is-4">
{partido.nome} - {partido.sigla}
<div className="columns divPartido">
<div className="column is-two-fifths">
<div className="partido">
<div>
<h1>
{partido.sigla} - {partido.nome}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no css desse h1 coloca um text-align: center pra no mobile ele centralizar tbm

</h1>
<h2 className="subtitle">
<img src={partido.urlLogo} />
</h2>
<img
className="deputado-img"
src={partido.urlLogo}
onError={(e) => {
e.currentTarget.src = noImage;
}}
alt="Logo do partido"
/>
</div>
</div>
</section>

<div className="container partido-single">
<div className="columns is-centered columns-fix">
<div className="column">
<div className="card">
<div className="card-content">
<div className="media">
<div className="media-content">
<p className="title is-4">Status</p>
</div>
</div>
<div className="content">
<strong>Situação: </strong> {status.situacao}
<br />
<strong>Total de posse: </strong> {status.totalPosse}
<br />
<strong>Total de membros: </strong> {status.totalMembros}
</div>
</div>
</div>
<div className="status">
<div>
<h1>Informações</h1>
</div>
<div className="informations">
<div>
<label>Situação: </label>
<label className="backgroundYellow">{status.situacao}</label>
</div>
<div>
<label>Total de posse: </label>
<label className="backgroundYellow">{status.totalPosse}</label>
</div>
<div>
<label>Total de membros: </label>
<label className="backgroundYellow">{status.totalMembros}</label>
</div>

<div className="column">
<div className="card">
<div className="card-image">
<figure className="image">
<div
style={{ backgroundImage: `url(${lider.urlFoto})` }}
className="image-lider"
/>
</figure>
</div>
<div className="card-content">
<div className="media">
<div className="media-content">
<p className="title is-6">Nome: {lider.nome}</p>
<p className="subtitle is-8">
Sigla Partido: {lider.siglaPartido}
</p>
</div>
</div>
</div>
<div>
<label>Total de membros: </label>
<label className="backgroundYellow">{status.totalMembros}</label>
</div>
</div>
</div>
</div>

<div className="column">
<div className="infoPresidente">
<h1 className="">Presidente</h1>
<img
className="image-lider"
src={lider.urlFoto}
onError={(e) => {
e.currentTarget.src = noImage;
}}
alt="Foto do líder"
/>
<p>{lider.nome}</p>
</div>
</div>
</div>
);
};
Expand Down
135 changes: 80 additions & 55 deletions src/pages/PartidoInfo/styles.scss
Original file line number Diff line number Diff line change
@@ -1,81 +1,106 @@
.titulo {
display: flex;
justify-content: center;
align-items: center;
.divPartido {
margin-top: 60px;
margin-left: 66px;
margin-right: 66px;

h1 {
font-size: 30px;
}
}

.titulo-img {
.partido {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
background: #ffffff;
border: 1px solid #adadad;
box-sizing: border-box;
padding: 10px;
margin-bottom: 25px;

div {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 61px;
margin-bottom: 58px;
}

img {
height: 60%;
width: 60%;
margin-top: 10px;
}
}

.status {
max-width: 300px;
margin: 20px 0px 0px;
padding: 20px;
display: flex;
flex-direction: column;
background: #ffffff;
border: 1px solid #adadad;
box-sizing: border-box;
padding: 10px;
// height: 100%;

h1 {
color: #da552f;
> div:first-child {
text-align: center;
}

article {
margin-left: 15px;
border: 1px solid #ddd;
border-radius: 10px;
padding: 10px;
div {
margin-bottom: 15px;
}

strong {
font-weight: bold;
font-size: 16px;
color: darkblue;
.informations {
display: flex;
flex-direction: row;
flex-wrap: wrap;

div {
display: flex;
height: fit-content;
}
}
}

.lider {
max-width: 300px;
padding-left: 20px;
label {
margin-top: 10px;
font-size: 12px;
line-height: 14px;
padding: 5px 0px 5px 10px;

h1 {
color: #da552f;
background: #e7e7e7;
border-radius: 6px 0px 0px 6px;
}

article {
margin-left: 15px;
border: 1px solid #ddd;
border-radius: 10px;
padding: 10px;

strong {
font-weight: bold;
font-size: 16px;
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande',
'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
color: darkblue;
}
.backgroundYellow {
padding: 5px 10px 5px 10px;
background: #f3a62d;
border-radius: 0px 6px 6px 0px;
margin-right: 10px;
}
}

.partidos-lista {
.title {
font-size: 14px;
line-height: 20px;
}
.infoPresidente {
display: flex;
flex-direction: column;
align-items: center;
background: #ffffff;
border: 1px solid #adadad;
box-sizing: border-box;
padding: 10px;

.subtitle {
text-align: center;
font-size: 14px;
margin-top: 0px !important;
> div {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 100px;
}
}

.partido-single {
height: 400px;
.image-lider {
background-size: contain;
height: 400px;
background-position: center;
background-repeat: no-repeat;
width: 250px;
}

p {
font-size: 24px;
text-align: center;
}
}