Skip to content

Commit

Permalink
try to put sign up link behind ENV flag
Browse files Browse the repository at this point in the history
  • Loading branch information
bkiahstroud committed Sep 18, 2024
1 parent 8d381bb commit 2dbc7f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ RAILS_DB_HOST=postgres
RAILS_DB_PORT=5432
RAILS_DB_NAME=manifold_production
RAILS_REDIS_URL=redis://redis:6379

REACT_APP_ALLOW_SIGNUP=true
9 changes: 6 additions & 3 deletions client/src/global/components/sign-in-up/LoginForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default function LoginForm({
hideOverlay,
willRedirect
}) {
const signupEnabled = process.env.REACT_APP_ALLOW_SIGNUP === 'true';
const { t } = useTranslation();
const dispatch = useDispatch();
const authentication = useFromStore("authentication");
Expand Down Expand Up @@ -116,9 +117,11 @@ export default function LoginForm({
<SharedStyles.ViewLink onClick={e => handleViewChange("password", e)}>
{t("forms.signin_overlay.forgot_password")}
</SharedStyles.ViewLink>
<SharedStyles.ViewLink onClick={e => handleViewChange("terms", e)}>
{t("forms.signin_overlay.need_account")}
</SharedStyles.ViewLink>
{signupEnabled && (
<SharedStyles.ViewLink onClick={e => handleViewChange("terms", e)}>
{t("forms.signin_overlay.need_account")}
</SharedStyles.ViewLink>
)}
</SharedStyles.LinksWrapper>
<OAuthOptions />
</div>
Expand Down

0 comments on commit 2dbc7f4

Please sign in to comment.