Work on feedbackardo

This commit is contained in:
Fede Álvarez
2022-05-31 13:14:32 +02:00
parent 38e068417a
commit bff0141600
6 changed files with 57 additions and 48 deletions
@@ -1,6 +1,10 @@
@import '~/css/helpers'; @import '~/css/helpers';
.card { .card {
@include respond-to('mobile') {
max-height: unset;
}
cursor: pointer; cursor: pointer;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -8,6 +12,8 @@
white-space: normal; white-space: normal;
width: 100%; width: 100%;
max-height: tovw(1000px, 'default', 600px); max-height: tovw(1000px, 'default', 600px);
text-decoration: none;
color: unset;
&-blog { &-blog {
border-bottom: none; border-bottom: none;
+39 -45
View File
@@ -1,7 +1,6 @@
import clsx from 'clsx' import clsx from 'clsx'
import NextLink from 'next/link' import NextLink from 'next/link'
import { useRouter } from 'next/router' import { useEffect, useState } from 'react'
import { useCallback, useEffect, useState } from 'react'
import { Calendar } from '~/components/icons/events' import { Calendar } from '~/components/icons/events'
import Heading from '~/components/primitives/heading' import Heading from '~/components/primitives/heading'
@@ -62,7 +61,7 @@ const Card = ({
}, [data?.title]) }, [data?.title])
return ( return (
<NextLink href={isNews ? `/blog/${data?.slug}` : data?.link}> <NextLink passHref href={isNews ? `/blog/${data?.slug}` : data?.link}>
<div className={clsx(s['card'], className)}> <div className={clsx(s['card'], className)}>
<div className={s['card__header']}> <div className={s['card__header']}>
{!isNews && ( {!isNews && (
@@ -116,12 +115,6 @@ export const BlogCard = ({
data, data,
horizontal = false horizontal = false
}: BlogCardProps) => { }: BlogCardProps) => {
const router = useRouter()
const onClick = useCallback(() => {
router.push(`/blog/${data?.slug}`)
}, [data?.slug, router])
const [title, setTitle] = useState<string | null | undefined>() const [title, setTitle] = useState<string | null | undefined>()
useEffect(() => { useEffect(() => {
@@ -134,35 +127,17 @@ export const BlogCard = ({
}, [data?.title]) }, [data?.title])
return ( return (
<div <NextLink href={`/blog/${data?.slug}`}>
className={clsx( <div
s['card'], className={clsx(
s['card-blog'], s['card'],
className, s['card-blog'],
horizontal && s.horizontal className,
)} horizontal && s.horizontal
onClick={onClick} )}
> >
{horizontal && data?.image && ( {horizontal && data?.image && (
<div className={clsx(s['image__container'], 'hide-on-mobile')}> <div className={clsx(s['image__container'], 'hide-on-mobile')}>
<img
alt={data?.image?.alt ?? ''}
loading="lazy"
src={data?.image?.url}
/>
</div>
)}
<div>
<div className={s['card__header-blog']}>
{data?.category.map((category: any, index) => (
<span key={index}>
<Category label={category.title} />
</span>
))}
<span className={s.date}>{formatDate(data?.date)}</span>
</div>
{data?.image && (
<div className={s['image__container']}>
<img <img
alt={data?.image?.alt ?? ''} alt={data?.image?.alt ?? ''}
loading="lazy" loading="lazy"
@@ -170,14 +145,33 @@ export const BlogCard = ({
/> />
</div> </div>
)} )}
<div className={s['content']}> <div>
<Heading as="h2" variant="sm" font="tthoves"> <div className={s['card__header-blog']}>
{title} {data?.category.map((category: any, index) => (
</Heading> <span key={index}>
{horizontal && <p>{data && getDescription(data)}</p>} <Category label={category.title} />
<Link href={`/blog/${data?.slug}`}>READ ARTICLE</Link> </span>
))}
<span className={s.date}>{formatDate(data?.date)}</span>
</div>
{data?.image && (
<div className={s['image__container']}>
<img
alt={data?.image?.alt ?? ''}
loading="lazy"
src={data?.image?.url}
/>
</div>
)}
<div className={s['content']}>
<Heading as="h2" variant="sm" font="tthoves">
{title}
</Heading>
{horizontal && <p>{data && getDescription(data)}</p>}
<Link href={`/blog/${data?.slug}`}>READ ARTICLE</Link>
</div>
</div> </div>
</div> </div>
</div> </NextLink>
) )
} }
@@ -1,6 +1,10 @@
@import '~/css/helpers'; @import '~/css/helpers';
.pre__footer { .pre__footer {
@include respond-to('mobile') {
padding-bottom: tovw(50px, 'tablet', 30px);
}
max-width: tovw(753px, 'default', 375px); max-width: tovw(753px, 'default', 375px);
text-align: center; text-align: center;
@@ -25,7 +25,6 @@
} }
position: relative; position: relative;
padding-top: tovw(170px, 'default', 122px);
padding-bottom: tovw(200px, 'default', 200px); padding-bottom: tovw(200px, 'default', 200px);
.grid { .grid {
@@ -22,7 +22,7 @@
} }
h1 { h1 {
@media screen and (max-width: 375px) { @media screen and (max-width: 422px) {
font-size: tovw(42px, 'mobile'); font-size: tovw(42px, 'mobile');
} }
} }
@@ -127,13 +127,16 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
list-style: none; list-style: none;
gap: tovw(30px, 'default', 25px);
padding-left: 0; padding-left: 0;
margin: 0; margin: 0;
margin-top: tovw(70px, 'default', 30px); margin-top: tovw(70px, 'default', 30px);
padding-right: tovw(15px, 'default', 15px); padding-right: tovw(15px, 'default', 15px);
li { li {
@include respond-to('mobile') {
padding-bottom: unset;
}
a { a {
@include respond-to('mobile') { @include respond-to('mobile') {
font-size: tovw(18px, 'default', 18px); font-size: tovw(18px, 'default', 18px);
@@ -142,6 +145,9 @@
font-size: tovw(18px, 'default', 12px); font-size: tovw(18px, 'default', 12px);
} }
margin-right: tovw(55px, 'default', 25px);
padding-bottom: tovw(15px, 'default', 15px);
&:not(:first-child) { &:not(:first-child) {
@include respond-to('mobile') { @include respond-to('mobile') {
margin: 0; margin: 0;