Skip to content

Commit

Permalink
feat: add digest page (#302)
Browse files Browse the repository at this point in the history
**Describe what changes this pull request brings**

Add Digest page

**Steps to check:**

1. Open
[preview](https://deploy-preview-302--novu-website.netlify.app/digest/)
2. Make sure that everything looks and works as expected

**BEFORE MERGE:**

- [ ] Add appropriate links to all sections
  • Loading branch information
annaindistress authored Jan 13, 2025
1 parent 8470376 commit 301ff3d
Show file tree
Hide file tree
Showing 15 changed files with 312 additions and 10 deletions.
6 changes: 6 additions & 0 deletions src/components/shared/link/link.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ const Link = ({
>
{children}
{isUnderline && underline}
{withArrow && (
<span className="relative mt-0.5 w-1.5 overflow-hidden transition-[width] duration-200 group-hover:w-3">
<ArrowIcon className="ml-auto w-1.5" />
<span className="absolute right-px top-1/2 h-px w-full -translate-y-1/2 bg-primary-2 opacity-0 transition-opacity duration-200 group-hover:opacity-100" />
</span>
)}
</GatsbyLink>
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import clsx from 'clsx';
import PropTypes from 'prop-types';
import React from 'react';

import Heading from 'components/shared/heading';
import Link from 'components/shared/link';

const SectionWithBigIcons = ({ title, items }) => (
<section className="section-with-big-icons safe-paddings mt-40 lg:mt-[120px] md:mt-[100px] sm:mt-20">
const SectionWithBigIcons = ({ className, title, items, isCentered }) => (
<section
className={clsx(
'section-with-big-icons safe-paddings mt-40 lg:mt-[120px] md:mt-[100px] sm:mt-20',
className
)}
>
<div className="container-md px-8 sm:w-full sm:px-5">
<Heading
className="text-center font-medium leading-denser tracking-snug lg:text-5xl md:text-[32px] sm:text-3xl"
Expand All @@ -15,9 +21,9 @@ const SectionWithBigIcons = ({ title, items }) => (
>
{title}
</Heading>
<ul className="mt-14 grid grid-cols-3 grid-rows-2 gap-x-16 gap-y-12 lg:mt-12 lg:max-w-none lg:gap-x-[52px] lg:px-9 md:mt-10 md:gap-x-7 md:gap-y-8 md:px-0 sm:mt-8 sm:grid-cols-2 sm:gap-7 sm-xs:grid-cols-1">
{items.map(({ icon, title, description, linkUrl }, index) => (
<li key={index} className="flex flex-col">
<ul className="grid-rows-auto mt-14 grid grid-cols-3 gap-x-16 gap-y-12 lg:mt-12 lg:max-w-none lg:gap-x-9 lg:px-9 md:mt-10 md:gap-x-7 md:gap-y-8 md:px-0 sm:mt-8 sm:grid-cols-2 sm:gap-7 sm-xs:grid-cols-1">
{items.map(({ icon, title, description, linkUrl, linkText }, index) => (
<li key={index} className={clsx('flex flex-col', isCentered && 'items-center')}>
<img
className="h-10 w-fit sm:h-8"
src={icon}
Expand All @@ -40,7 +46,11 @@ const SectionWithBigIcons = ({ title, items }) => (
rel="noopener noreferrer"
withArrow
>
<span className="sr-only">{title} - </span>Learn more
{linkText || (
<>
<span className="sr-only">{title} - </span>Learn more
</>
)}
</Link>
</li>
))}
Expand All @@ -50,15 +60,23 @@ const SectionWithBigIcons = ({ title, items }) => (
);

SectionWithBigIcons.propTypes = {
className: PropTypes.string,
title: PropTypes.string.isRequired,
items: PropTypes.arrayOf(
PropTypes.shape({
icon: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
linkUrl: PropTypes.string.isRequired,
linkText: PropTypes.string,
})
).isRequired,
isCentered: PropTypes.bool,
};

SectionWithBigIcons.defaultProps = {
className: '',
isCentered: false,
};

export default SectionWithBigIcons;
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,21 @@ import React from 'react';
import Button from 'components/shared/button';
import Heading from 'components/shared/heading';

const TextWithPicture = ({ title, description, image, button, theme }) => (
<section className="text-with-picture safe-paddings mt-40 lg:mt-36 md:mt-[104px] sm:mt-14">
const TextWithPicture = ({
className,
title,
description,
image,
imageClassName,
button,
theme,
}) => (
<section
className={clsx(
'text-with-picture safe-paddings mt-40 lg:mt-36 md:mt-[104px] sm:mt-14',
className
)}
>
<div className="container-lg px-8 md:px-7 sm:px-4">
<div
className={clsx(
Expand All @@ -15,7 +28,7 @@ const TextWithPicture = ({ title, description, image, button, theme }) => (
)}
>
<div
className={clsx('sm:order-first sm:mb-6 sm:pl-0 sm:text-center', {
className={clsx('relative z-10 sm:order-first sm:mb-6 sm:pl-0 sm:pr-0 sm:text-center', {
'mb-12 max-w-[704px] text-center lg:mb-10 md:mb-8 md:max-w-lg sm:mb-6':
theme === 'imageFullWidth',
'order-last pl-24 lg:pl-16 md:pl-8': theme === 'imageLeft',
Expand Down Expand Up @@ -50,7 +63,7 @@ const TextWithPicture = ({ title, description, image, button, theme }) => (
</Button>
)}
</div>
<div className="overflow-hidden rounded-lg">{image}</div>
<div className={clsx('overflow-hidden rounded-lg', imageClassName)}>{image}</div>
{button && theme === 'imageFullWidth' && (
<Button
className="mt-9 md:mt-8 sm:mt-6"
Expand All @@ -61,6 +74,7 @@ const TextWithPicture = ({ title, description, image, button, theme }) => (
target={button.target}
>
{button.label}
{button.hiddenLabel && <span className="sr-only"> {button.hiddenLabel}</span>}
</Button>
)}
</div>
Expand All @@ -69,21 +83,26 @@ const TextWithPicture = ({ title, description, image, button, theme }) => (
);

TextWithPicture.propTypes = {
className: PropTypes.string,
title: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
image: PropTypes.node.isRequired,
imageClassName: PropTypes.string,
button: PropTypes.shape({
label: PropTypes.string.isRequired,
link: PropTypes.string.isRequired,
rel: PropTypes.string,
target: PropTypes.string,
hiddenLabel: PropTypes.string,
}),
theme: PropTypes.oneOf(['imageLeft', 'imageRight', 'imageFullWidth']),
};

TextWithPicture.defaultProps = {
className: '',
button: null,
theme: 'imageLeft',
imageClassName: '',
};

export default TextWithPicture;
9 changes: 9 additions & 0 deletions src/images/icons/calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/images/icons/consolidation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/images/icons/context.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/images/icons/customization.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/images/icons/digest.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/images/icons/flexibility.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/images/icons/interval.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/images/icons/selection.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pages/digest/fatigue.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/pages/digest/strategies.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 301ff3d

Please sign in to comment.