Skip to content
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
12 changes: 9 additions & 3 deletions src/components/expandGrid/ExpandGrid.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Link } from "gatsby"
import React, { useEffect, useRef, useState } from "react"
import { Flipper, Flipped } from "react-flip-toolkit"
import MarkdownView from "react-showdown"
Expand Down Expand Up @@ -36,7 +37,7 @@ const ListItem = ({ index, onClick, data }) => {
<Flipped inverseFlipId={createCardFlipId(index)}>
<div className="listItemContent">
<div className="listItem-more">
<p>Ver mas</p>
<h4>{data.title}</h4>
</div>
<Flipped
flipId={`avatar-${index}`}
Expand Down Expand Up @@ -77,9 +78,15 @@ const ExpandedListItem = ({ index, data, isFirst }) => {
>
<img alt="" src={data.image?.url} className="avatar-expanded" />
</Flipped>
<div className={"additional-content " + isFirst ? "animated-in" : ""}>
<div
className={"additional-content " + (isFirst ? "animated-in" : "")}
>
<div>
<h4>{data.title}</h4>
<MarkdownView markdown={data.text} />
{data.landing_page && (
<Link to={"/" + data.landing_page.slug}>Ver más</Link>
)}
</div>
</div>
</div>
Expand Down Expand Up @@ -113,7 +120,6 @@ const AnimatedList = ({ items }) => {
}
}
}

return (
<Flipper
flipKey={itemsArray.focused}
Expand Down
25 changes: 19 additions & 6 deletions src/components/expandGrid/expandGrid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
display: flex;
flex-direction: row;
flex-wrap: wrap;
padding: 0 5em;
padding: 0 2em;
width: 100%;
}

Expand All @@ -40,7 +40,7 @@
&-focus {
flex: 0 1 calc(calc(100% / 3) - 10px);
}
background-color: rgba(180, 180, 180, 0.24);
background-color: rgba(255, 255, 255, 0.158);
cursor: pointer;

@media screen and (max-width: $breakpoint-xxl) {
Expand Down Expand Up @@ -116,16 +116,16 @@

.listItem-more{
position: absolute;
inset: 0 0 0 0;
inset: 0 0 20px 20px;
display: flex;
align-items: center;
justify-content: center;
align-items: flex-end;
justify-content: baseline;
transition: opacity 200ms ease;
opacity: 1;
color: black;
p{
padding: 0;
margin: 0;
@include primaryBtn;
}
&-expanded{
@extend .listItem-more;
Expand All @@ -137,6 +137,19 @@
.additional-content > div {
opacity: 0;
border-radius: 3px;
display: flex;
flex-direction: column;
height: 100%;
p {
max-height: 10vw;
overflow: hidden;
text-overflow: ellipsis;
}
a{
color: $secondary;
text-decoration: underline;
margin: auto 0 10px 10px;
}
h4 {
text-align: left;
}
Expand Down