Skip to content

Commit 25c944f

Browse files
authored
Merge pull request #1533 from stakwork/fix-host-link
fix 2 links to /bounties
2 parents 6b82c69 + 7287cc8 commit 25c944f

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/components/BountyComponents/BountyNavBar.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { observer } from 'mobx-react-lite';
44
import MaterialIcon from '@material/react-material-icon';
55
import { useHistory, useLocation } from 'react-router-dom';
66
import StartUpModal from '../../people/utils/StartUpModal';
7-
import { getHost } from '../../config';
87
import { useStores } from '../../store';
98
import { Modal } from '../../components/common';
109
import SignIn from '../../components/auth/SignIn';
@@ -317,8 +316,7 @@ const BountyNavBar: React.FC = () => {
317316
};
318317

319318
const handleViewBounties = () => {
320-
const host = getHost();
321-
window.location.href = `https://${host}/bounties`;
319+
history.push('/bounties');
322320
setIsMobileMenuOpen(false);
323321
};
324322

src/components/BountyComponents/HeroSection.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState } from 'react';
22
import styled from 'styled-components';
33
import StartUpModal from '../../people/utils/StartUpModal';
4-
import { getHost } from '../../config';
4+
import { useHistory } from 'react-router-dom';
55

66
const HeroContainer = styled.section`
77
background: #1a242e;
@@ -117,14 +117,14 @@ const Button = styled.button<{ variant: 'primary' | 'secondary' }>`
117117

118118
const HeroSection: React.FC = () => {
119119
const [isOpenStartupModal, setIsOpenStartupModal] = useState(false);
120+
const history = useHistory();
120121

121122
const handleStartEarning = () => {
122123
setIsOpenStartupModal(true);
123124
};
124125

125126
const handleViewBounties = () => {
126-
const host = getHost();
127-
window.location.href = `https://${host}/bounties`;
127+
history.push('/bounties');
128128
};
129129

130130
return (

0 commit comments

Comments
 (0)