aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha <GlancingMind@outlook.com>2021-03-28 11:02:48 +0200
committerSascha <GlancingMind@outlook.com>2021-04-08 11:48:28 +0200
commitd80b2ad03898eb798f8c3c95a4c10bd119691e01 (patch)
treecd98ec3848de4b5eb17e15daddce9b899b44ca16
parentabbed0ff129755386ccbf89409ff8c3877f86d20 (diff)
downloadgit-bug-d80b2ad03898eb798f8c3c95a4c10bd119691e01.tar.gz
Prevent page reload for redirecting components
Link instantly to: - NewBugPage - BackToList
-rw-r--r--webui/src/components/BackToListButton.tsx4
-rw-r--r--webui/src/components/BugTitleForm/BugTitleForm.tsx4
-rw-r--r--webui/src/pages/list/ListQuery.tsx3
3 files changed, 8 insertions, 3 deletions
diff --git a/webui/src/components/BackToListButton.tsx b/webui/src/components/BackToListButton.tsx
index 7ca53ad0..41e1d68a 100644
--- a/webui/src/components/BackToListButton.tsx
+++ b/webui/src/components/BackToListButton.tsx
@@ -1,4 +1,5 @@
import React from 'react';
+import { Link } from 'react-router-dom';
import Button from '@material-ui/core/Button';
import { makeStyles } from '@material-ui/core/styles';
@@ -25,7 +26,8 @@ function BackToListButton() {
variant="contained"
className={classes.backButton}
aria-label="back to issue list"
- href="/"
+ component={Link}
+ to="/"
>
<ArrowBackIcon />
Back to List
diff --git a/webui/src/components/BugTitleForm/BugTitleForm.tsx b/webui/src/components/BugTitleForm/BugTitleForm.tsx
index a7d5a820..529f23a2 100644
--- a/webui/src/components/BugTitleForm/BugTitleForm.tsx
+++ b/webui/src/components/BugTitleForm/BugTitleForm.tsx
@@ -1,4 +1,5 @@
import React, { useState } from 'react';
+import { Link } from 'react-router-dom';
import { Button, makeStyles, Typography } from '@material-ui/core';
@@ -157,7 +158,8 @@ function BugTitleForm({ bug }: Props) {
className={classes.greenButton}
size="small"
variant="contained"
- href="/new"
+ component={Link}
+ to="/new"
>
New bug
</Button>
diff --git a/webui/src/pages/list/ListQuery.tsx b/webui/src/pages/list/ListQuery.tsx
index 4cd75c8d..2b46dca5 100644
--- a/webui/src/pages/list/ListQuery.tsx
+++ b/webui/src/pages/list/ListQuery.tsx
@@ -369,7 +369,8 @@ function ListQuery() {
<Button
className={classes.greenButton}
variant="contained"
- href="/new"
+ component={Link}
+ to="/new"
>
New bug
</Button>