Skip to content

Commit

Permalink
feat(landing): SKFP-1386 add view all studies
Browse files Browse the repository at this point in the history
  • Loading branch information
AltefrohneGaelle authored Dec 6, 2024
1 parent b007651 commit dc46951
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.schema
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ REACT_APP_FT_DASHBOARD_BANNER_MSG="A wonderful notification"

# Landing Page
REACT_APP_FT_LANDING_PAGE=true
REACT_APP_FT_PUBLIC_STUDIES=true

# MOCK
REACT_MOCK_AUTORIZE_STUDIES=true
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,7 @@ const en = {
signup: 'SIGN UP',
close: 'Close',
},
viewAllBtn: 'View all studies',
},
},
facets: {
Expand Down
5 changes: 5 additions & 0 deletions src/views/LandingPage/StudiesSection/Studies/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
align-content: center;
}

.viewAllBtn {
padding: 8px 16px;
height: auto;
}

@media (max-width: 1200px) {
.studiesContainer {
border-radius: 20px 20px 0 0;
Expand Down
13 changes: 13 additions & 0 deletions src/views/LandingPage/StudiesSection/Studies/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import intl from 'react-intl-universal';
import { useNavigate } from 'react-router';
import { Typography } from 'antd';
import { getFTEnvVarByKey } from 'helpers/EnvVariables';
import LandingPageButton from 'views/LandingPage/Components/LandingPageButton';
import LandingPageTitle from 'views/LandingPage/Components/LandingPageTitle';

import studiesSvg from 'components/assets/kf-portal-icons_studies_2.svg';
import { useGlobals } from 'store/global';
import { STATIC_ROUTES } from 'utils/routes';

import styles from './index.module.css';

const { Paragraph } = Typography;

const StudiesSection = () => {
const { stats } = useGlobals();
const navigate = useNavigate();
const publicStudiesBtn = getFTEnvVarByKey('PUBLIC_STUDIES');
const studiesBtnOnClick =
publicStudiesBtn === 'true' ? () => navigate(STATIC_ROUTES.PUBLIC_STUDIES) : undefined;

return (
<div className={styles.studiesContainer}>
Expand All @@ -23,6 +31,11 @@ const StudiesSection = () => {
<Paragraph className={styles.subtitle}>
{intl.get('screen.loginPage.studies.explore')}
</Paragraph>
{studiesBtnOnClick && (
<LandingPageButton className={styles.viewAllBtn} onClick={studiesBtnOnClick}>
{intl.get('screen.publicStudies.viewAllBtn')}
</LandingPageButton>
)}
</div>
);
};
Expand Down

0 comments on commit dc46951

Please sign in to comment.