Skip to content

Commit

Permalink
Merge pull request #139 from Vizzuality/SKY30-202-kh-2-dynamic-title
Browse files Browse the repository at this point in the history
[SKY30-202] makes knowledge hub title dynamic according to selection
  • Loading branch information
SARodrigues authored Jan 18, 2024
2 parents 910d461 + 89815e1 commit 0f14de9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frontend/src/pages/knowledge-hub/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
import { useRef } from 'react';

import { useAtomValue } from 'jotai';

import Cta from '@/components/static-pages/cta';
import Intro from '@/components/static-pages/intro';
import Section from '@/components/static-pages/section';
import { PAGES } from '@/constants/pages';
import CardFilters from '@/containers/knowledge-hub/card-filters';
import CardList from '@/containers/knowledge-hub/card-list';
import { cardFiltersAtom } from '@/containers/knowledge-hub/store';
import Layout, { Content } from '@/layouts/static-page';

const KnowledgeHubPage = () => {
const sectionRef = useRef<HTMLDivElement>(null);
const filters = useAtomValue(cardFiltersAtom);

const handleIntroScrollClick = () => {
sectionRef?.current?.scrollIntoView({ behavior: 'smooth' });
};

const title = filters.resourceType
? `${filters.resourceType.toLocaleLowerCase()} resources`
: 'all 30x30 resources';

return (
<Layout
title="Knowledge Hub"
Expand Down Expand Up @@ -45,7 +53,7 @@ const KnowledgeHubPage = () => {
<div className="space-y-7">
<h2 className="text-[52px] font-black leading-none">
I am looking for...
<br /> Data Tools.
<br /> {title}.
</h2>
<div>
<CardFilters />
Expand Down

0 comments on commit 0f14de9

Please sign in to comment.