Skip to content
Closed
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
Binary file not shown.
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 not shown.
58 changes: 33 additions & 25 deletions src/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const Navbar: FC<NavbarProps> = ({ handleToggleSidebar, handleClick }) => {
logo: isDarkTheme ? <ToolsIcon /> : <ToolsDarkIcon />,
target: '',
id: 'tools',
activeMatch: '/tools/longevity-protocol',
},
{
name: articles,
Expand All @@ -81,31 +82,38 @@ const Navbar: FC<NavbarProps> = ({ handleToggleSidebar, handleClick }) => {
[styles.authorized]: !!accountData,
})}
>
{routes.map(({ name, path, target, logo, id }, index) => (
<a
key={index}
href={path}
target={target}
onClick={e => {
if (target === '_blank') return;
e.preventDefault();
if (isSmallScreen) handleToggleSidebar();
handleClick(e, path);
}}
className={cn(styles.url, {
[styles.active]:
path === '/'
? router.asPath === '/'
: router.asPath.startsWith(path),
[styles.uxcoreIcon]: id === 'uxcore',
[styles.companyManagementIcon]: id === 'companyManagement',
[styles.articlesIcon]: id === 'articles',
[styles.ruUrl]: locale === 'ru',
})}
>
{logo} {name}
</a>
))}
{routes.map(({ name, path, target, logo, id, activeMatch }, index) => {
const match = activeMatch ?? path;

const isActive =
match === '/'
? router.asPath === '/'
: router.asPath.startsWith(match);

return (
<a
key={index}
href={path}
target={target}
onClick={e => {
if (target === '_blank') return;
e.preventDefault();
if (isSmallScreen) handleToggleSidebar();
handleClick(e, path);
}}
className={cn(styles.url, {
[styles.active]: isActive,
[styles.uxcoreIcon]: id === 'uxcore',
[styles.companyManagementIcon]: id === 'companyManagement',
[styles.articlesIcon]: id === 'articles',
[styles.ruUrl]: locale === 'ru',
})}
>
{logo} {name}
</a>
);
})}

<a
href={'/contributors'}
onClick={e => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const LongevitySubSection: FC<LongevitySubSectionProps> = ({
id={title}
place={'bottom'}
className={cn(styles.tooltip, {})}
clickable
>
<WhyDoThisTooltip
whatDamagesText={whatDamages}
Expand Down
5 changes: 3 additions & 2 deletions src/components/longevity/Navigation/Navigation.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
.subItem {
background-image: url('/keepsimple_/assets/longevity/nav-bg.svg');
background-repeat: no-repeat;
background-size: contain;
background-size: cover;
width: 222px;
height: 49px;
text-align: center;
Expand Down Expand Up @@ -50,7 +50,7 @@
text-decoration: none;
cursor: pointer;
background-image: url('/keepsimple_/assets/longevity/nav-hover-bg.png');

background-size: cover;
.subLink,
.link {
color: #fff;
Expand All @@ -64,6 +64,7 @@

&:hover {
cursor: pointer;

background-image: url('/keepsimple_/assets/longevity/nav-hover-bg.png');
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/longevity/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const Navigation: FC = () => {
width={1140}
height={83}
className={cn(styles.curtains, {
[styles.curtainsOpen]: router.pathname.includes('habits'),
[styles.curtainsOpen]: !router.asPath.includes('about-project'),
})}
/>
<ul className={styles.subUl}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const StrengthAndTimeCompression: FC = () => {
/>
<hr className={styles.divider} />
<Heading
text={'Strength and Time Compression'}
text={'Your strength level'}
Tag="h4"
isBold
showLeftIcon={false}
Expand Down
44 changes: 29 additions & 15 deletions src/components/longevity/StudySection/StudySection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ const StudySection: FC<StudySectionProps> = ({
? '/keepsimple_/assets/longevity/study/hacks.png'
: '/keepsimple_/assets/longevity/study-headline-bg.png';

const mobalBackgroundImage = isHacks
? '/keepsimple_/assets/longevity/study/hacks-bg.png'
: '/keepsimple_/assets/longevity/study/flipped-card-bg.png';
return (
<>
<section className={styles.studySection}>
Expand Down Expand Up @@ -119,28 +122,39 @@ const StudySection: FC<StudySectionProps> = ({
</div>
{flippedCardChart && (
<div className={styles.pageSwitcherWrapper}>
<Image
src={'/keepsimple_/assets/longevity/study/page-switcher.svg'}
alt={'Page switcher'}
width={60}
height={60}
className={styles.pageSwitcher}
onClick={() => {
setSwitchPage(!switchPage);
}}
/>
{!switchPage ? (
<Image
src={'/keepsimple_/assets/longevity/study/page-switcher.svg'}
alt={'Page switcher'}
width={60}
height={60}
className={styles.pageSwitcher}
onClick={() => {
setSwitchPage(!switchPage);
}}
/>
) : (
<Image
src={
'/keepsimple_/assets/longevity/study/page-switcher-back.svg'
}
alt={'Page switcher'}
width={60}
height={60}
className={styles.pageSwitcher}
onClick={() => {
setSwitchPage(!switchPage);
}}
/>
)}
</div>
)}
</section>
{isMobile && openModal && (
<Modal
size={'full'}
onClick={() => setOpenModal(false)}
backgroundImageUrl={
backsBackgroundImageUrl
? backsBackgroundImageUrl
: '/keepsimple_/assets/longevity/study/flipped-card-bg.png'
}
backgroundImageUrl={mobalBackgroundImage}
bodyClassName={isHacks ? styles.hacksModalBody : styles.modalBody}
className={styles.modal}
>
Expand Down
23 changes: 13 additions & 10 deletions src/components/longevity/WhatToEatOrAvoid/WhatToEatOrAvoid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,25 @@ const WhatToEatOrAvoid: FC<WhatToEatOrAvoidProps> = ({

{tooltipContent && (
<div className={styles.heartWrapper}>
{!isMobile && <ShinyStars />}
<Image
src={imageUrl}
alt={title}
data-tooltip-id={title}
width={59}
height={59}
className={styles.heart}
onClick={() => isMobile && setOpenMobileModal(true)}
/>
<div data-tooltip-id={title}>
{!isMobile && <ShinyStars />}
<Image
src={imageUrl}
alt={title}
width={59}
height={59}
className={styles.heart}
onClick={() => isMobile && setOpenMobileModal(true)}
/>
</div>

{!isMobile && (
<ReactTooltip
id={title}
place={'top'}
className={styles.tooltip}
opacity={1}
clickable
>
<AboutTheProduct content={tooltipContent} title={title} />
</ReactTooltip>
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/StudyLayout/StudyLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const StudyLayout: FC<StudyLayoutProps> = ({ data, locale }) => {
flippedCardChart={`${process.env.NEXT_PUBLIC_STRAPI}${data?.['research tasks flipped card image']?.data?.attributes?.url}`}
chartWidth={590}
flippedCardChartMobile={
'/keepsimple_/assets/longevity/study/mobile-charts/research-task.webp'
'/keepsimple_/assets/longevity/study/mobile-charts/research-task-mobile.webp'
}
/>
<StudySection
Expand All @@ -81,7 +81,7 @@ const StudyLayout: FC<StudyLayoutProps> = ({ data, locale }) => {
flippedCardChart={`${process.env.NEXT_PUBLIC_STRAPI}${data?.['data flipped card image']?.data?.attributes?.url}`}
chartWidth={390}
flippedCardChartMobile={
'/keepsimple_/assets/longevity/study/mobile-charts/data-chart.webp'
'/keepsimple_/assets/longevity/study/mobile-charts/data-mobile.webp'
}
/>
<StudySection
Expand Down
Loading