Skip to content

Commit 7287cc8

Browse files
committed
use history
1 parent 3d3f60f commit 7287cc8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/components/BountyComponents/BountyNavBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ const BountyNavBar: React.FC = () => {
316316
};
317317

318318
const handleViewBounties = () => {
319-
window.location.href = `${window.location.origin}/bounties`;
319+
history.push('/bounties');
320320
setIsMobileMenuOpen(false);
321321
};
322322

src/components/BountyComponents/HeroSection.tsx

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

56
const HeroContainer = styled.section`
67
background: #1a242e;
@@ -116,13 +117,14 @@ const Button = styled.button<{ variant: 'primary' | 'secondary' }>`
116117

117118
const HeroSection: React.FC = () => {
118119
const [isOpenStartupModal, setIsOpenStartupModal] = useState(false);
120+
const history = useHistory();
119121

120122
const handleStartEarning = () => {
121123
setIsOpenStartupModal(true);
122124
};
123125

124126
const handleViewBounties = () => {
125-
window.location.href = `${window.location.origin}/bounties`;
127+
history.push('/bounties');
126128
};
127129

128130
return (

0 commit comments

Comments
 (0)