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
26 changes: 13 additions & 13 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, Fragment, useCallback, useContext, useState } from 'react';
import React, { FC, Fragment, useCallback, useContext } from 'react';
import cn from 'classnames';
import { useRouter } from 'next/router';
import Image from 'next/image';
Expand All @@ -7,8 +7,8 @@ import { flushSync } from 'react-dom';
import Navbar from '@components/Navbar';
import Link from '@components/NextLink';
import { GlobalContext } from '@components/Context/GlobalContext';
import UserProfile from '@components/UserProfile';
import LogIn from '@components/LogIn';
// import UserProfile from '@components/UserProfile';
// import LogIn from '@components/LogIn';

import type { TRouter } from '@local-types/global';

Expand All @@ -22,8 +22,8 @@ const Header: FC = () => {
const { locale, locales } = router as TRouter;
const { setShowLoader, videoRef } = useContext(GlobalContext);
const isSmallScreen = useIsWidthLessThan(1141);
const [openLogin, setOpenLogin] = useState(false);
const { accountData, setAccountData } = useContext(GlobalContext);
// const [openLogin, setOpenLogin] = useState(false);
// const { accountData, setAccountData } = useContext(GlobalContext);
const [
{ toggleIsDarkTheme, toggleSidebar },
{ isDarkTheme, isOpenedSidebar },
Expand Down Expand Up @@ -157,18 +157,18 @@ const Header: FC = () => {
</Link>
)}
</div>
<UserProfile
showDropdown
setAccountData={setAccountData}
isLoggedIn={!!accountData}
username={accountData?.username}
setOpenLoginModal={setOpenLogin}
/>
{/*<UserProfile*/}
{/* showDropdown*/}
{/* setAccountData={setAccountData}*/}
{/* isLoggedIn={!!accountData}*/}
{/* username={accountData?.username}*/}
{/* setOpenLoginModal={setOpenLogin}*/}
{/*/>*/}
</div>
</div>
<div className={styles.closeButton} onClick={handleToggleSidebar} />
</header>
{openLogin && <LogIn setShowLogIn={setOpenLogin} />}
{/*{openLogin && <LogIn setShowLogIn={setOpenLogin} />}*/}
</Fragment>
);
};
Expand Down
14 changes: 12 additions & 2 deletions src/components/Modal/Modal.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
position: relative;
z-index: 80;
border-radius: 4px;
background-image: url('/assets/landingPage/landing-bg.png');
background-image: url('/keepsimple_/assets/landingPage/landing-bg.png');

.header {
.hadBorder {
Expand Down Expand Up @@ -165,10 +165,20 @@
@media (max-width: 965px) {
.overlay {
.full {
max-width: -webkit-fill-available !important;
margin: 16px;
height: -webkit-fill-available !important;

.body {
height: 100%;
text-align: center;
}
}
}

.withBackgroundImage {
background-color: unset;
background-size: cover;
}
}

@media (max-width: 800px) {
Expand Down
14 changes: 11 additions & 3 deletions src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type ModalProps = {
isLongevityProtocolModal?: boolean;
grayTitle?: boolean;
dataCy?: string;
backgroundImageUrl?: string;
};

const Modal: FC<ModalProps> = ({
Expand All @@ -47,6 +48,7 @@ const Modal: FC<ModalProps> = ({
grayTitle,
dataCy,
isLongevityProtocolModal,
backgroundImageUrl,
}) => {
const handleClose = () => {
onClick();
Expand Down Expand Up @@ -92,7 +94,7 @@ const Modal: FC<ModalProps> = ({
data-cy={dataCy}
>
<div
className={styles.background}
className={cn(styles.background, {})}
onClick={!disableBackgroundClick ? handleClose : () => {}}
data-cy={'modal-background-click'}
/>
Expand All @@ -104,7 +106,13 @@ const Modal: FC<ModalProps> = ({
[wrapperClassName]: wrapperClassName,
[styles.fullSizeMobile]: fullSizeMobile,
[styles.isLongevityProtocolModal]: isLongevityProtocolModal,
[styles.withBackgroundImage]: backgroundImageUrl,
})}
style={{
backgroundImage: backgroundImageUrl
? `url(${backgroundImageUrl})`
: 'none',
}}
>
{!removeHeader && (
<div
Expand All @@ -125,7 +133,7 @@ const Modal: FC<ModalProps> = ({
<div className={styles.closeIconWrapper} onClick={onClick}>
<div className={`${styles.lineWrapper} ${styles.rightWrapper}`}>
<Image
src="/assets/close-right-line.svg"
src="/keepsimple_/assets/close-right-line.svg"
alt="close right line"
width={24}
height={24}
Expand All @@ -146,7 +154,7 @@ const Modal: FC<ModalProps> = ({
)}
{withoutHeader && (
<img
src="/assets/biases/close-icon-white.svg"
src="/keepsimple_/assets/biases/close-icon-white.svg"
alt="modal close button"
className={styles.closeBtnWithoutHeader}
onClick={handleClose}
Expand Down
15 changes: 12 additions & 3 deletions src/components/longevity/FlipCard/FlipCard.module.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.flipCard {
background-image: url('/keepsimple_/assets/longevity/study/flipped-card-bg.png');
background-size: contain;
background-size: cover;
background-repeat: no-repeat;
max-width: 948px;
padding: 28px 103px;
height: 780px;
height: 550px;
text-align: center;
display: flex;
justify-content: center;
Expand Down Expand Up @@ -41,10 +41,15 @@
font-size: 20px;
font-weight: 600;
}

.chart {
max-width: 100%;
height: auto;
}
}

.diamond {
width: 14px;
width: 13px;
height: 10px;
background-color: #df382e;
transform: rotate(45deg);
Expand Down Expand Up @@ -112,6 +117,10 @@
height: auto;
padding: 0;

.diamond {
width: 19px;
}

.headline {
justify-content: center;

Expand Down
1 change: 1 addition & 0 deletions src/components/longevity/FlipCard/FlipCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const FlipCard: FC<FlipCardProps> = ({
width={512}
height={455}
className={styles.chart}
unoptimized
/>
) : null}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,16 @@ const MobileNavigation: FC = () => {
icon: <SupplementsIcon />,
},
];
const getActiveNavItemName = (nav1, nav2) => {
const getActiveNavItemName = (nav1, nav2 = []) => {
const pathname = router.pathname;

const active =
nav1.find(i => i.path === router.pathname) ??
nav2.find(i => i.path === router.pathname);
nav1.find(i => !i.hasNoUrl && i.path === pathname) ??
nav2.find(i => i.path === pathname);

return active?.name ?? '';
};

// TODO - Get back to this
// const getNextNavItemName = (nav1, nav2) => {
// const allNavItems = [...nav1, ...nav2];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
.studySection {
margin-right: 16px;
margin-bottom: 20px;

.headline {
max-width: unset;
padding: 16px 12px;
Expand Down Expand Up @@ -128,7 +129,6 @@
align-items: center;
gap: 12px;
background-color: transparent;
//background-image: url("/keepsimple_/assets/longevity/btn-border.svg");
}
}
}
Expand All @@ -137,4 +137,7 @@
display: none;
}
}
.hacksModalBody {
display: flex !important;
}
}
14 changes: 13 additions & 1 deletion src/components/longevity/StudySection/StudySection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const StudySection: FC<StudySectionProps> = ({
flippedCardChart,
flippedCardPainText,
hacksQuote,
backsBackgroundImageUrl,
quoteAuthor,
}) => {
const [switchPage, setSwitchPage] = useState<boolean>(false);
Expand All @@ -40,6 +41,7 @@ const StudySection: FC<StudySectionProps> = ({
alt={title}
width={948}
height={67}
unoptimized
className={styles.backgroundImg}
/>
<Heading
Expand Down Expand Up @@ -69,6 +71,7 @@ const StudySection: FC<StudySectionProps> = ({
alt={'Learn more icon'}
width={16}
height={16}
unoptimized
/>
Learn More
</button>
Expand Down Expand Up @@ -97,7 +100,16 @@ const StudySection: FC<StudySectionProps> = ({
)}
</section>
{isMobile && openModal && (
<Modal size={'full'} onClick={() => setOpenModal(false)}>
<Modal
size={'full'}
onClick={() => setOpenModal(false)}
backgroundImageUrl={
backsBackgroundImageUrl
? backsBackgroundImageUrl
: '/keepsimple_/assets/longevity/study/flipped-card-bg.png'
}
bodyClassName={isHacks ? styles.hacksModalBody : styles.modalBody}
>
<FlipCard
headline={flippedCardHeadline}
subText={flippedCardSubText}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export type StudySectionProps = {
flippedCardChart?: string;
hacksQuote?: string;
quoteAuthor?: string;
backsBackgroundImageUrl?: string;
};
46 changes: 37 additions & 9 deletions src/components/longevity/WeeklyWorkout/WeeklyWorkout.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
.wrapper {
display: flex;
gap: 20px;
margin-top: 32px;
}

.imageWrapper {
Expand All @@ -60,6 +61,8 @@
opacity: 100%;
transform: translateX(0);
z-index: 99;
position: relative;
top: -14px;

img {
width: 180px;
Expand Down Expand Up @@ -92,12 +95,28 @@
}

.wrapper {
margin-top: 20px;
gap: 0;
--overlap: 42px;
display: flex;
align-items: center;

.imageWrapper {
width: 100%;
height: auto;
position: relative;
margin-left: calc(var(--overlap) * -1);
border: 0;
padding: 0;
background: transparent;
cursor: pointer;
top: 0;
transition:
transform 180ms ease,
box-shadow 180ms ease,
z-index 0ms;
transform: translateY(0) scale(1);
z-index: 1;

img {
width: 100%;
Expand All @@ -106,25 +125,34 @@
}
}

.imageWrapper:first-child {
transform: translateX(40px);
.imageWrapper:nth-child(4) {
z-index: 2;
}

.imageWrapper:nth-child(3) {
z-index: 3;
}

.imageWrapper:nth-child(2) {
transform: translateX(-20px);
z-index: 4;
}

.imageWrapper:nth-child(3) {
transform: translateX(-40px);
.imageWrapper:nth-child(1) {
z-index: 5;
}

.imageWrapper:nth-child(3) {
transform: translateX(-60px);
.imageWrapper:first-child {
margin-left: 0;
}

.activeImageWrapper {
transform: translateX(0);
z-index: 99;
transform: translateY(-10px) scale(1.05);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
z-index: 99 !important;

img {
position: relative;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/data/longevity/en.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const en = {
habitTooltipTitle: 'Why do this?',
whatDamagesTitle: 'What damages',
whatDamagesTitle: 'Damage type',
};

export default en;
2 changes: 1 addition & 1 deletion src/data/longevity/hy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const hy = {
habitTooltipTitle: 'Why do this?',
whatDamagesTitle: 'What damages',
whatDamagesTitle: 'Damage type',
};

export default hy;
Loading