Skip to content

Commit

Permalink
feat(publicstudies): SJIP-1105 add link to login page
Browse files Browse the repository at this point in the history
  • Loading branch information
AltefrohneGaelle committed Nov 29, 2024
1 parent 0dae729 commit 14b6854
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/components/PublicLayout/Header/HeaderButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,23 @@ interface OwnProps {
className?: string;
icon?: React.ReactElement;
isActive?: boolean;
onClick?: () => void;
title: string;
}

const HeaderButton = ({ className = '', icon, isActive = false, title, ...props }: OwnProps) => (
const HeaderButton = ({
className = '',
icon,
isActive = false,
onClick,
title,
...props
}: OwnProps) => (
<Button
className={cx(className, style.headerBtn, isActive ? style.active : '')}
onClick={(event) => {
event.currentTarget.blur();
onClick && onClick();
}}
icon={icon}
{...props}
Expand Down
10 changes: 9 additions & 1 deletion src/components/PublicLayout/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import intl from 'react-intl-universal';
import { useNavigate } from 'react-router';
import {
DotChartOutlined,
DownOutlined,
Expand All @@ -16,6 +17,7 @@ import ExternalLinkIcon from 'components/Icons/ExternalLinkIcon';
import IncludeIcon from 'components/Icons/IncludeIcon';
import LineStyleIcon from 'components/Icons/LineStyleIcon';
import { trackVisitResources } from 'services/analytics';
import { STATIC_ROUTES } from 'utils/routes';

import HeaderButton from './HeaderButton';

Expand All @@ -26,6 +28,7 @@ const iconSize = { width: 14, height: 14 };
const { Text } = Typography;

const Header = () => {
const navigate = useNavigate();
const ft_variant = getFTEnvVarByKey('VARIANT');
const ft_analyticsPage = getFTEnvVarByKey('ANALYTICS_PAGE');

Expand Down Expand Up @@ -159,9 +162,14 @@ const Header = () => {
className={style.loginBtn}
key="community"
icon={<LoginOutlined />}
onClick={() => navigate(STATIC_ROUTES.LOGIN)}
title={intl.get('screen.loginPage.login')}
/>
<Button className={style.signUpBtn} type="primary">
<Button
className={style.signUpBtn}
onClick={() => navigate(STATIC_ROUTES.LOGIN)}
type="primary"
>
{intl.get('screen.loginPage.signup')}
</Button>
</div>,
Expand Down

0 comments on commit 14b6854

Please sign in to comment.