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

View File

@ -1,6 +1,10 @@
@import '~/css/helpers';
.card {
@include respond-to('mobile') {
max-height: unset;
}
cursor: pointer;
display: flex;
flex-direction: column;
@ -8,6 +12,8 @@
white-space: normal;
width: 100%;
max-height: tovw(1000px, 'default', 600px);
text-decoration: none;
color: unset;
&-blog {
border-bottom: none;

View File

@ -1,7 +1,6 @@
import clsx from 'clsx'
import NextLink from 'next/link'
import { useRouter } from 'next/router'
import { useCallback, useEffect, useState } from 'react'
import { useEffect, useState } from 'react'
import { Calendar } from '~/components/icons/events'
import Heading from '~/components/primitives/heading'
@ -62,7 +61,7 @@ const Card = ({
}, [data?.title])
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={s['card__header']}>
{!isNews && (
@ -116,12 +115,6 @@ export const BlogCard = ({
data,
horizontal = false
}: BlogCardProps) => {
const router = useRouter()
const onClick = useCallback(() => {
router.push(`/blog/${data?.slug}`)
}, [data?.slug, router])
const [title, setTitle] = useState<string | null | undefined>()
useEffect(() => {
@ -134,35 +127,17 @@ export const BlogCard = ({
}, [data?.title])
return (
<div
className={clsx(
s['card'],
s['card-blog'],
className,
horizontal && s.horizontal
)}
onClick={onClick}
>
{horizontal && data?.image && (
<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']}>
<NextLink href={`/blog/${data?.slug}`}>
<div
className={clsx(
s['card'],
s['card-blog'],
className,
horizontal && s.horizontal
)}
>
{horizontal && data?.image && (
<div className={clsx(s['image__container'], 'hide-on-mobile')}>
<img
alt={data?.image?.alt ?? ''}
loading="lazy"
@ -170,14 +145,33 @@ export const BlogCard = ({
/>
</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 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
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>
</NextLink>
)
}

View File

@ -1,6 +1,10 @@
@import '~/css/helpers';
.pre__footer {
@include respond-to('mobile') {
padding-bottom: tovw(50px, 'tablet', 30px);
}
max-width: tovw(753px, 'default', 375px);
text-align: center;

View File

@ -25,7 +25,6 @@
}
position: relative;
padding-top: tovw(170px, 'default', 122px);
padding-bottom: tovw(200px, 'default', 200px);
.grid {

View File

@ -22,7 +22,7 @@
}
h1 {
@media screen and (max-width: 375px) {
@media screen and (max-width: 422px) {
font-size: tovw(42px, 'mobile');
}
}

View File

@ -127,13 +127,16 @@
display: flex;
flex-wrap: wrap;
list-style: none;
gap: tovw(30px, 'default', 25px);
padding-left: 0;
margin: 0;
margin-top: tovw(70px, 'default', 30px);
padding-right: tovw(15px, 'default', 15px);
li {
@include respond-to('mobile') {
padding-bottom: unset;
}
a {
@include respond-to('mobile') {
font-size: tovw(18px, 'default', 18px);
@ -142,6 +145,9 @@
font-size: tovw(18px, 'default', 12px);
}
margin-right: tovw(55px, 'default', 25px);
padding-bottom: tovw(15px, 'default', 15px);
&:not(:first-child) {
@include respond-to('mobile') {
margin: 0;