Skip to content

Commit 6133de1

Browse files
committed
fix: arreglo de estilos en la seccion eventos
1 parent 1e1de18 commit 6133de1

6 files changed

Lines changed: 140 additions & 80 deletions

File tree

src/components/UI/card/card.js

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,50 @@
1-
import React from 'react';
2-
import PropTypes from 'prop-types'
3-
import './card.css';
1+
import React from "react";
2+
import PropTypes from "prop-types";
3+
import styles from "./card.module.css";
44
import { Link } from "gatsby";
55

6-
7-
const Card = ({ imgURL, topic, date, descriptionTitle, description, link, readMoreColor, topicFontSize }) => (
8-
<div className="card">
9-
<div className="card-header">
10-
<div className="img-viewport">
6+
const Card = ({
7+
imgURL,
8+
topic,
9+
dateTime,
10+
descriptionTitle,
11+
description,
12+
link,
13+
readMoreColor,
14+
topicFontSize,
15+
viewportHeight,
16+
textSpacing,
17+
lineHeight,
18+
}) => (
19+
<div className={styles.card}>
20+
<div className={styles.card__header}>
21+
<div className={styles.card__imgViewport} style={{ height: viewportHeight }}>
1122
<img src={imgURL} />
1223
</div>
1324
</div>
14-
<div className="card-body">
15-
<h5 className="topic" style={{fontSize: topicFontSize}}>{topic}</h5>
16-
<p className="date">{date}</p>
17-
<div className="description">
18-
<p className="description-text">
19-
<strong className="description-title">{descriptionTitle}:</strong>
20-
{description} <Link to={link} className="read-more" style={{color: readMoreColor}}>Leer más</Link>
25+
<div className={styles.card__body}>
26+
<h5
27+
className={styles.card__topic}
28+
style={{
29+
fontSize: topicFontSize,
30+
marginBottom: textSpacing,
31+
lineHeight,
32+
}}>
33+
{topic}
34+
</h5>
35+
<p className={styles.card__date} style={{ lineHeight }}>
36+
{dateTime}
37+
</p>
38+
<div className={styles.card__description} style={{ marginTop: textSpacing }}>
39+
<p className={styles.card__descriptionText}>
40+
<strong className={styles.card__descriptionTitle}>{descriptionTitle}:</strong>
41+
{description}{" "}
42+
<Link
43+
to={link}
44+
className={styles.card_readmore}
45+
style={{ color: readMoreColor }}>
46+
Leer más
47+
</Link>
2148
</p>
2249
</div>
2350
</div>
@@ -27,18 +54,24 @@ const Card = ({ imgURL, topic, date, descriptionTitle, description, link, readMo
2754
Card.propTypes = {
2855
imgURL: PropTypes.string,
2956
topic: PropTypes.string,
30-
date: PropTypes.string,
57+
dateTime: PropTypes.string,
3158
descriptionTitle: PropTypes.string,
3259
description: PropTypes.string,
3360
link: PropTypes.string,
3461
readMoreColor: PropTypes.string,
35-
}
62+
viewportHeight: PropTypes.string,
63+
textSpacing: PropTypes.string,
64+
lineHeight: PropTypes.string,
65+
};
3666

3767
Card.defaultProps = {
3868
date: null,
39-
descriptionTitle: 'Descripción',
69+
descriptionTitle: "Descripción",
4070
readMoreColor: "#27ae60",
41-
topicFontSize: "2rem"
42-
}
71+
topicFontSize: "2rem",
72+
viewportHeight: "136.13px",
73+
textSpacing: "0.5em",
74+
lineHeight: "auto",
75+
};
4376

4477
export default Card;
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,57 @@
88
user-select: none;
99
}
1010

11-
.card-header {
11+
.card__header {
1212
width: 100%;
1313
padding: 24px 24px 15px;
1414
}
1515

16-
.card .img-viewport {
16+
.card__img--viewport {
1717
width: 100%;
1818
height: 136.13px;
1919
overflow: hidden;
2020
border-radius: 15px;
2121
}
2222

23-
.card img {
23+
.card__img {
2424
width: 100%;
2525
display: block;
2626
}
2727

28-
.card-body {
28+
.card__body {
2929
padding: 0 24px 24px 24px;
3030
}
3131

32-
.card-body .topic {
32+
.card__topic {
3333
font-weight: bold;
34-
margin-bottom: .5em;
3534
font-family: "Roboto", sans-serif;
3635
}
3736

38-
.card-body .date {
37+
.card__date {
3938
color: #666363;
39+
font-weight: bold;
4040
}
4141

42-
.description-title {
42+
.card__description--title {
4343
margin-right: .5em;
4444
}
4545

46-
.description {
46+
.card__description {
4747
overflow: hidden;
4848
max-height: 140px;
49-
margin-top: .5em;
5049
}
5150

52-
.description-text {
51+
.card__description--text {
5352
overflow: hidden;
5453
text-overflow: ellipsis;
5554
line-height: 1.1;
5655
font-family: "Roboto", sans-serif;
5756
}
5857

59-
.read-more {
60-
font-weight: bold;
58+
.card__readmore {
6159
margin-left: .3em;
6260
}
61+
62+
.card__description--text a {
63+
font-weight: bold;
64+
}
Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,39 @@
11
import React from "react";
2-
import './events.css';
2+
import styles from './events.module.css';
33
import Carousel from '../UI/carousel/carousel';
44
import Card from '../UI/card/card';
55
import eventos from "../../constants/eventos";
6-
import triagle from "../../images/widgets/triangle.svg"
7-
import bracketsWidget from '../../images/widgets/brackets.svg'
6+
import triangle from "../../images/widgets/triangle.svg"
7+
import bracketsWidget from '../../images/widgets/brackets2.svg'
88

99
const Events = () => {
1010
return (
11-
<section className="events-section ec-container">
12-
<h2 className= "section-title" >Eventos</h2>
11+
<section className={`${styles.events} ec-container`}>
12+
<h2 className={styles.events__title}>Eventos</h2>
1313
<Carousel>
14-
{eventos.map(({ id, imagen, titulo, fechaHora, disertantes, resumen, url }) => (
15-
<Card
16-
imgURL={imagen}
17-
topic={titulo}
18-
date={fechaHora}
19-
description={resumen}
20-
link={url}
21-
topicFontSize="1rem"
22-
readMoreColor="#046294"
23-
key={id}
24-
/>
25-
))}
14+
{eventos.map(
15+
({ id, imagen, titulo, fechaHora, disertantes, resumen, url }) => (
16+
<Card
17+
imgURL={imagen}
18+
topic={titulo}
19+
dateTime={fechaHora}
20+
description={resumen}
21+
descriptionTitle="Disertantes"
22+
link={url}
23+
topicFontSize="1rem"
24+
readMoreColor="#046294"
25+
viewportHeight="246px"
26+
textSpacing="0"
27+
lineHeight="1.1"
28+
key={id}
29+
/>
30+
)
31+
)}
2632
</Carousel>
27-
<img className="small-widget triangle" src={triagle} />
28-
<img className="small-widget event-bracket" src={bracketsWidget} />
29-
</section >
30-
)
33+
<img className={`small-widget ${styles.events__triangle}`} src={triangle} />
34+
<img className={`small-widget ${styles.events__bracket}`} src={bracketsWidget} />
35+
</section>
36+
);
3137
}
3238

3339
export default Events

src/components/events-section/events.css

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.events {
2+
background: #F2F2F2;
3+
height: 840px;
4+
padding-top: 10em;
5+
position: relative;
6+
}
7+
8+
.events__title{
9+
margin-bottom: 1em;
10+
padding-right: 1em;
11+
text-align: right;
12+
font-size: 50px;
13+
font-weight: bold;
14+
font-family: "Roboto", sans-serif;
15+
}
16+
17+
/* Widgets */
18+
19+
.events__triangle {
20+
top: 2em;
21+
left: 12em;
22+
display: none;
23+
}
24+
25+
@media only screen and (min-width: 567px) {
26+
.events__triangle {
27+
display: block;
28+
}
29+
}
30+
31+
.events__bracket {
32+
bottom: -.6em;
33+
right: 15em;
34+
display: none;
35+
}
36+
37+
@media only screen and (min-width: 567px) {
38+
.events__bracket {
39+
display: block;
40+
}
41+
}

src/images/widgets/brackets2.svg

Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)