Skip to content

Commit 87f9141

Browse files
committed
chore: longevity minor improvements
1 parent 790d0f1 commit 87f9141

12 files changed

Lines changed: 83 additions & 56 deletions

File tree

Binary file not shown.
7.37 KB
Loading
8.77 KB
Loading
Binary file not shown.

src/components/Navbar/Navbar.tsx

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const Navbar: FC<NavbarProps> = ({ handleToggleSidebar, handleClick }) => {
5959
logo: isDarkTheme ? <ToolsIcon /> : <ToolsDarkIcon />,
6060
target: '',
6161
id: 'tools',
62+
activeMatch: '/tools/longevity-protocol',
6263
},
6364
{
6465
name: articles,
@@ -81,31 +82,38 @@ const Navbar: FC<NavbarProps> = ({ handleToggleSidebar, handleClick }) => {
8182
[styles.authorized]: !!accountData,
8283
})}
8384
>
84-
{routes.map(({ name, path, target, logo, id }, index) => (
85-
<a
86-
key={index}
87-
href={path}
88-
target={target}
89-
onClick={e => {
90-
if (target === '_blank') return;
91-
e.preventDefault();
92-
if (isSmallScreen) handleToggleSidebar();
93-
handleClick(e, path);
94-
}}
95-
className={cn(styles.url, {
96-
[styles.active]:
97-
path === '/'
98-
? router.asPath === '/'
99-
: router.asPath.startsWith(path),
100-
[styles.uxcoreIcon]: id === 'uxcore',
101-
[styles.companyManagementIcon]: id === 'companyManagement',
102-
[styles.articlesIcon]: id === 'articles',
103-
[styles.ruUrl]: locale === 'ru',
104-
})}
105-
>
106-
{logo} {name}
107-
</a>
108-
))}
85+
{routes.map(({ name, path, target, logo, id, activeMatch }, index) => {
86+
const match = activeMatch ?? path;
87+
88+
const isActive =
89+
match === '/'
90+
? router.asPath === '/'
91+
: router.asPath.startsWith(match);
92+
93+
return (
94+
<a
95+
key={index}
96+
href={path}
97+
target={target}
98+
onClick={e => {
99+
if (target === '_blank') return;
100+
e.preventDefault();
101+
if (isSmallScreen) handleToggleSidebar();
102+
handleClick(e, path);
103+
}}
104+
className={cn(styles.url, {
105+
[styles.active]: isActive,
106+
[styles.uxcoreIcon]: id === 'uxcore',
107+
[styles.companyManagementIcon]: id === 'companyManagement',
108+
[styles.articlesIcon]: id === 'articles',
109+
[styles.ruUrl]: locale === 'ru',
110+
})}
111+
>
112+
{logo} {name}
113+
</a>
114+
);
115+
})}
116+
109117
<a
110118
href={'/contributors'}
111119
onClick={e => {

src/components/longevity/LongevitySubSection/LongevitySubSection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ const LongevitySubSection: FC<LongevitySubSectionProps> = ({
7171
id={title}
7272
place={'bottom'}
7373
className={cn(styles.tooltip, {})}
74+
clickable
7475
>
7576
<WhyDoThisTooltip
7677
whatDamagesText={whatDamages}

src/components/longevity/Navigation/Navigation.module.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
.subItem {
1212
background-image: url('/keepsimple_/assets/longevity/nav-bg.svg');
1313
background-repeat: no-repeat;
14-
background-size: contain;
14+
background-size: cover;
1515
width: 222px;
1616
height: 49px;
1717
text-align: center;
@@ -50,7 +50,7 @@
5050
text-decoration: none;
5151
cursor: pointer;
5252
background-image: url('/keepsimple_/assets/longevity/nav-hover-bg.png');
53-
53+
background-size: cover;
5454
.subLink,
5555
.link {
5656
color: #fff;
@@ -64,6 +64,7 @@
6464

6565
&:hover {
6666
cursor: pointer;
67+
6768
background-image: url('/keepsimple_/assets/longevity/nav-hover-bg.png');
6869
}
6970
}

src/components/longevity/Navigation/Navigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const Navigation: FC = () => {
104104
width={1140}
105105
height={83}
106106
className={cn(styles.curtains, {
107-
[styles.curtainsOpen]: router.pathname.includes('habits'),
107+
[styles.curtainsOpen]: !router.asPath.includes('about-project'),
108108
})}
109109
/>
110110
<ul className={styles.subUl}>

src/components/longevity/StrengthAndTimeCompression/StrengthAndTimeCompression.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const StrengthAndTimeCompression: FC = () => {
2929
/>
3030
<hr className={styles.divider} />
3131
<Heading
32-
text={'Strength and Time Compression'}
32+
text={'Your strength level'}
3333
Tag="h4"
3434
isBold
3535
showLeftIcon={false}

src/components/longevity/StudySection/StudySection.tsx

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ const StudySection: FC<StudySectionProps> = ({
4242
? '/keepsimple_/assets/longevity/study/hacks.png'
4343
: '/keepsimple_/assets/longevity/study-headline-bg.png';
4444

45+
const mobalBackgroundImage = isHacks
46+
? '/keepsimple_/assets/longevity/study/hacks-bg.png'
47+
: '/keepsimple_/assets/longevity/study/flipped-card-bg.png';
4548
return (
4649
<>
4750
<section className={styles.studySection}>
@@ -119,28 +122,39 @@ const StudySection: FC<StudySectionProps> = ({
119122
</div>
120123
{flippedCardChart && (
121124
<div className={styles.pageSwitcherWrapper}>
122-
<Image
123-
src={'/keepsimple_/assets/longevity/study/page-switcher.svg'}
124-
alt={'Page switcher'}
125-
width={60}
126-
height={60}
127-
className={styles.pageSwitcher}
128-
onClick={() => {
129-
setSwitchPage(!switchPage);
130-
}}
131-
/>
125+
{!switchPage ? (
126+
<Image
127+
src={'/keepsimple_/assets/longevity/study/page-switcher.svg'}
128+
alt={'Page switcher'}
129+
width={60}
130+
height={60}
131+
className={styles.pageSwitcher}
132+
onClick={() => {
133+
setSwitchPage(!switchPage);
134+
}}
135+
/>
136+
) : (
137+
<Image
138+
src={
139+
'/keepsimple_/assets/longevity/study/page-switcher-back.svg'
140+
}
141+
alt={'Page switcher'}
142+
width={60}
143+
height={60}
144+
className={styles.pageSwitcher}
145+
onClick={() => {
146+
setSwitchPage(!switchPage);
147+
}}
148+
/>
149+
)}
132150
</div>
133151
)}
134152
</section>
135153
{isMobile && openModal && (
136154
<Modal
137155
size={'full'}
138156
onClick={() => setOpenModal(false)}
139-
backgroundImageUrl={
140-
backsBackgroundImageUrl
141-
? backsBackgroundImageUrl
142-
: '/keepsimple_/assets/longevity/study/flipped-card-bg.png'
143-
}
157+
backgroundImageUrl={mobalBackgroundImage}
144158
bodyClassName={isHacks ? styles.hacksModalBody : styles.modalBody}
145159
className={styles.modal}
146160
>

0 commit comments

Comments
 (0)