Skip to content

Commit 750bd36

Browse files
committed
Use React Router in history buttons
1 parent 3db6ce0 commit 750bd36

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

frontend/src/components/SimulationHistorySidebar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import { Button, Typography } from "@equinor/eds-core-react";
33
import { Entry, useSimulationHistory } from "@/hooks/useSimulationHistory.ts";
4+
import { Link } from "react-router-dom";
45

56
const SimulationHistory: React.FC = () => {
67
const simulationHistory = useSimulationHistory();
@@ -26,7 +27,7 @@ const SimulationHistory: React.FC = () => {
2627
<div style={{ display: "flex", flexFlow: "column", gap: "1em" }} key={date}>
2728
<Typography variant="h3">{date}</Typography>
2829
{entries.map((entry) => (
29-
<Button variant="outlined" href={`/simulations/${entry.id}`} key={entry.id}>
30+
<Button as={Link} variant="outlined" to={`/simulations/${entry.id}`} key={entry.id}>
3031
{entry.displayName} @ {entry.createdAt.getHours()}:{entry.createdAt.getMinutes()}
3132
</Button>
3233
))}

0 commit comments

Comments
 (0)