Skip to content

Commit

Permalink
join via is now button instead of text link
Browse files Browse the repository at this point in the history
  • Loading branch information
roienatan committed Oct 22, 2023
1 parent ab79367 commit 532bbe1
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC } from "react";
import { NavLink } from "react-router-dom";
import { NavLink, useHistory } from "react-router-dom";
import { useJoinProjectAutomatically } from "@/pages/common/hooks";
import { useCommonDataContext } from "@/pages/common/providers";
import { useRoutesContext } from "@/shared/contexts";
Expand All @@ -15,6 +15,7 @@ interface CommonEntranceJoinProps {

const CommonEntranceJoin: FC<CommonEntranceJoinProps> = (props) => {
const { withJoinRequest = false, common, isProject } = props;
const history = useHistory();
const {
parentCommon,
parentCommonMember,
Expand Down Expand Up @@ -47,13 +48,13 @@ const CommonEntranceJoin: FC<CommonEntranceJoinProps> = (props) => {
</p>
)}
{!commonMember && rootCommon && !rootCommonMember && (
<p className={styles.joinHint}>
Join via{" "}
<NavLink to={getCommonPageAboutTabPath(rootCommon.id)}>
{rootCommon.name}
</NavLink>{" "}
page
</p>
<Button
className={styles.joinButton}
variant={ButtonVariant.OutlineDarkPink}
onClick={() => history.push(getCommonPageAboutTabPath(rootCommon.id))}
>
Join via {rootCommon.name} page
</Button>
)}
{!commonMember &&
rootCommonMember &&
Expand Down

0 comments on commit 532bbe1

Please sign in to comment.