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
Binary file modified public/keepsimple_/assets/globe-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/keepsimple_/assets/globe-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions public/keepsimple_/assets/globe-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions public/keepsimple_/assets/globe.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 modified public/keepsimple_/assets/tools/bob.skill
Binary file not shown.
2 changes: 1 addition & 1 deletion src/api/strapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const getArticles = async (locale: TLocales) => {
const articleUrl = `${process.env.NEXT_PUBLIC_STRAPI}/api/articles?locale=${currentLocale}
&populate[coverImage]=*
&populate[footerImage]=*
&populate[OGTags][populate]=ogImage`;
&populate[OGTags][populate]=ogImage&pagination[pageSize]=50`;
const articles: TArticle[] = await fetch(articleUrl)
.then(resp => resp.json())
.then(json => json?.data || []);
Expand Down
1 change: 1 addition & 0 deletions src/components/Header/Header.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
align-items: flex-end;
text-transform: uppercase;
gap: 4px;
font-family: 'Sarabun-Regular', serif;
}

&.en a:nth-child(1) {
Expand Down
8 changes: 4 additions & 4 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ const Header: FC = () => {
<Image
src={
isDarkTheme
? '/keepsimple_/assets/globe-light.png'
: '/keepsimple_/assets/globe-dark.png'
? '/keepsimple_/assets/globe-light.svg'
: '/keepsimple_/assets/globe.svg'
}
width={24}
height={24}
Expand All @@ -145,8 +145,8 @@ const Header: FC = () => {
<Image
src={
isDarkTheme
? '/keepsimple_/assets/globe-light.png'
: '/keepsimple_/assets/globe-dark.png'
? '/keepsimple_/assets/globe-light.svg'
: '/keepsimple_/assets/globe.svg'
}
width={24}
height={24}
Expand Down
18 changes: 1 addition & 17 deletions src/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import navbar from '@data/navbar';

import ArticlesDarkIcon from '@icons/ArticlesDarkIcon';
import ArticlesIcon from '@icons/ArticlesIcon';
import CompanyManagementIcon from '@icons/CompanyManagementIcon';
import LongevityIcon from '@icons/navbar/longevity.svg';
import LongevityDarkIcon from '@icons/navbar/longevity-dark.svg';
import ToolsIcon from '@icons/navbar/tools.svg';
Expand All @@ -35,14 +34,7 @@ const Navbar: FC<NavbarProps> = ({ handleToggleSidebar, handleClick }) => {
const { isDarkTheme, isOpenedSidebar } = useGlobals()[1];
const { accountData } = useContext(GlobalContext);

const {
about,
companyManagement,
articles,
contributorsTxt,
tools,
longevity,
} = navbar[locale];
const { about, articles, contributorsTxt, tools, longevity } = navbar[locale];

const normalizePath = (p: string) => {
const noQueryOrHash = p.split('?')[0].split('#')[0];
Expand All @@ -61,14 +53,6 @@ const Navbar: FC<NavbarProps> = ({ handleToggleSidebar, handleClick }) => {
target: '_blank',
id: 'uxcore',
},
{
name: companyManagement,
path: '/company-management',
logo: <CompanyManagementIcon />,
target: '',
id: 'companyManagement',
},

{
name: longevity,
path: '/tools/longevity-protocol/about-project',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@
}
}
}
.foodChoicesContent {
p:first-child {
margin-bottom: 10px;
}
img {
width: 16px;
margin-bottom: -2px;
height: 16px;
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const LongevitySubSection: FC<LongevitySubSectionProps> = ({
date,
isHacks,
damageTypeHeadline,
isFoodChoices,
}) => {
const { habitTooltipTitle } = longevityData[locale];
const isMobile = useIsWidthLessThan(956);
Expand Down Expand Up @@ -96,7 +97,9 @@ const LongevitySubSection: FC<LongevitySubSectionProps> = ({
{description ? (
<div
dangerouslySetInnerHTML={{ __html: description || '' }}
className={styles.content}
className={cn(styles.content, {
[styles.foodChoicesContent]: isFoodChoices,
})}
/>
) : (
<div>{children}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export type LongevitySubSectionProps = {
date?: string;
isHacks?: boolean;
damageTypeHeadline?: string;
isFoodChoices?: boolean;
};
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ const MobileNavigation: FC = () => {
onClick={() => nextPathname && router.push(nextPathname.path)}
>
<span className={styles.nextStaticTxt}>{nextBtn}</span>{' '}
<span className={styles.nextPage}> {nextPathname.name}</span>
<span className={styles.nextPage}> {nextPathname?.name}</span>
</BorderedPill>
</>
);
Expand Down
12 changes: 1 addition & 11 deletions src/hooks/useContentType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,7 @@ const useContentType = (styles: any, usePTag: boolean) => {
li: (props: any) => <li className={styles.li}>{props.children}</li>,
ul: (props: any) => <ul className={styles.ul}>{props.children}</ul>,
img: (props: any) => {
return (
<ArticleImage
styles={styles}
src={
props.src.includes(process.env.NEXT_PUBLIC_STRAPI)
? `${process.env.NEXT_PUBLIC_STRAPI}${props.src}`
: props.src
}
alt={props.alt}
/>
);
return <ArticleImage styles={styles} src={props.src} alt={props.alt} />;
},
download: ({ url, children }: any) => {
const src = useMemo(
Expand Down
1 change: 1 addition & 0 deletions src/layouts/DietLayout/DietLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ const DietLayout: FC<DietLayoutProps> = ({ locale, data }) => {
/>
<LongevitySubSection
locale={locale}
isFoodChoices
title={healthChoicesTitle}
description={data?.['food choices for Armenia']}
headlineBackgroundImageUrl={
Expand Down
14 changes: 11 additions & 3 deletions src/layouts/ToolsLayout/ToolsLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const ToolsLayout: FC<ToolsLayoutProps> = ({
const [transitionKey, setTransitionKey] = useState(0);
const typedBufferRef = useRef('');
const easterThemeIndexRef = useRef(0);
const easterActivatedRef = useRef(false);

useEffect(() => {
easterThemeIndexRef.current = easterThemeIndex;
Expand Down Expand Up @@ -64,19 +65,26 @@ const ToolsLayout: FC<ToolsLayoutProps> = ({
const normalizedBuffer = nextBuffer.replace(/\s+/g, '');
const idx = easterThemeIndexRef.current;

if (idx === 0 && normalizedBuffer.endsWith(FIBONACCI_CODE_NORMALIZED)) {
if (
!easterActivatedRef.current &&
normalizedBuffer.endsWith(FIBONACCI_CODE_NORMALIZED)
) {
typedBufferRef.current = '';
easterActivatedRef.current = true;
easterThemeIndexRef.current = 1;
setEasterThemeIndex(1);
setTransitionKey(prev => prev + 1);
return;
}

if (
idx > 0 &&
easterActivatedRef.current &&
normalizedBuffer.endsWith(EASTER_SUBSEQUENT_CODE_NORMALIZED)
) {
typedBufferRef.current = '';
setEasterThemeIndex(prev => (prev + 1) % 4);
const next = (idx + 1) % 4;
easterThemeIndexRef.current = next;
setEasterThemeIndex(next);
setTransitionKey(prev => prev + 1);
}
};
Expand Down
Loading