Skip to content

Commit

Permalink
Navigation fixes (#125)
Browse files Browse the repository at this point in the history
* fix: fixing breadcrumb link

* fix: fixing open seedlot details screen when click on table
  • Loading branch information
ArthurEncr authored and DerekRoberts committed May 14, 2024
1 parent 8aa691a commit f380f78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable react/jsx-props-no-spreading */
import React, { useState } from 'react';
import { useNavigate } from 'react-router-dom';

import {
DataTable,
Expand Down Expand Up @@ -51,7 +52,10 @@ const SeedlotDataTable = ({ seedlots }: SeedlotDataTableProps) => {
setFirstRowIndex(pageSize * (page - 1));
};

const navigate = useNavigate();

return (

<>
<DataTable
rows={seedlots.slice(firstRowIndex, firstRowIndex + currentPageSize)}
Expand Down Expand Up @@ -80,7 +84,7 @@ const SeedlotDataTable = ({ seedlots }: SeedlotDataTableProps) => {
</TableHead>
<TableBody>
{rows.map((item: RowInterface) => (
<TableRow key={item.cells[0].value}>
<TableRow key={item.cells[0].value} onClick={() => navigate(`/seedlot/details/${item.cells[0].value}`)}>
<TableCell>{item.cells[0].value}</TableCell>
<TableCell>{`${item.cells[1].value} class`}</TableCell>
<TableCell>{item.cells[2].value.label}</TableCell>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/Seedlot/SeedlotDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const SeedlotDetails = () => {
<Row className="seedlot-details-breadcrumb">
<Breadcrumb>
<BreadcrumbItem onClick={() => navigate('/seedlot')}>Seedlots</BreadcrumbItem>
<BreadcrumbItem>My seedlots</BreadcrumbItem>
<BreadcrumbItem onClick={() => navigate('/seedlot/my-seedlots')}>My seedlots</BreadcrumbItem>
</Breadcrumb>
</Row>
<Stack gap={6}>
Expand Down

0 comments on commit f380f78

Please sign in to comment.