File tree Expand file tree Collapse file tree 14 files changed +87
-13
lines changed
routes/$chainSlug/_layout Expand file tree Collapse file tree 14 files changed +87
-13
lines changed Original file line number Diff line number Diff line change 1+ import { useRouter , useCanGoBack } from '@tanstack/react-router' ;
2+ import { ChevronLeft } from 'lucide-react' ;
3+ import { Button } from './button' ;
4+
5+ export function BackButton ( { className = '' } : { className ?: string } ) {
6+ const router = useRouter ( ) ;
7+ const canGoBack = useCanGoBack ( ) ;
8+
9+ if ( ! canGoBack ) return null ;
10+
11+ return (
12+ < Button
13+ variant = "outline"
14+ size = "sm"
15+ className = { `text-grey-400 border-grey-300 pr-4! uppercase ${ className } ` }
16+ onClick = { ( ) => router . history . back ( ) }
17+ >
18+ < ChevronLeft />
19+ Back
20+ </ Button >
21+ ) ;
22+ }
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { Stepper } from '@/components/Stepper';
1010import IexecAccountIcon from '@/components/icons/IexecAccountIcon' ;
1111import WalletIcon from '@/components/icons/WalletIcon' ;
1212import { ChainSelector } from '@/components/navbar/ChainSelector' ;
13+ import { BackButton } from '@/components/ui/BackButton' ;
1314import { Button } from '@/components/ui/button' ;
1415import { getIExec } from '@/externals/iexecSdkClient' ;
1516import { useLoginLogout } from '@/hooks/useLoginLogout' ;
@@ -184,7 +185,10 @@ function RouteComponent() {
184185
185186 return (
186187 < div className = "mt-8 flex flex-col gap-10" >
187- < AccountBreadcrumbs />
188+ < div className = "flex items-center gap-2" >
189+ < BackButton />
190+ < AccountBreadcrumbs />
191+ </ div >
188192 < div className = "flex flex-col items-center gap-2" >
189193 < h1 className = "flex items-center gap-2 text-2xl font-extrabold" >
190194 IExec Wallet Manager
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { createFileRoute } from '@tanstack/react-router';
55import { LoaderCircle } from 'lucide-react' ;
66import { useState } from 'react' ;
77import AddressIcon from '@/components/icons/AddressIcon' ;
8+ import { BackButton } from '@/components/ui/BackButton' ;
89import { DetailsTable } from '@/modules/DetailsTable' ;
910import { ErrorAlert } from '@/modules/ErrorAlert' ;
1011import { Tabs } from '@/modules/Tabs' ;
@@ -132,7 +133,10 @@ function AddressRoute() {
132133 < LoaderCircle className = "animate-spin" />
133134 ) }
134135 </ h1 >
135- < AddressBreadcrumbs addressId = { addressAddress } />
136+ < div className = "flex items-center gap-2" >
137+ < BackButton />
138+ < AddressBreadcrumbs addressId = { addressAddress } />
139+ </ div >
136140 </ div >
137141
138142 { hasPastError && ! addressOverview ? (
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { useQuery } from '@tanstack/react-query';
44import { createFileRoute } from '@tanstack/react-router' ;
55import { LoaderCircle } from 'lucide-react' ;
66import AppIcon from '@/components/icons/AppIcon' ;
7+ import { BackButton } from '@/components/ui/BackButton' ;
78import { DetailsTable } from '@/modules/DetailsTable' ;
89import { ErrorAlert } from '@/modules/ErrorAlert' ;
910import { AppBreadcrumbs } from '@/modules/apps/app/AppBreadcrumbs' ;
@@ -92,7 +93,10 @@ function AppsRoute() {
9293 < LoaderCircle className = "animate-spin" />
9394 ) }
9495 </ h1 >
95- < AppBreadcrumbs appId = { appAddress } />
96+ < div className = "flex items-center gap-2" >
97+ < BackButton />
98+ < AppBreadcrumbs appId = { appAddress } />
99+ </ div >
96100 </ div >
97101
98102 < div className = "space-y-10" >
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { LoaderCircle } from 'lucide-react';
66import { DataTable } from '@/components/DataTable' ;
77import { PaginatedNavigation } from '@/components/PaginatedNavigation' ;
88import AppIcon from '@/components/icons/AppIcon' ;
9+ import { BackButton } from '@/components/ui/BackButton' ;
910import { usePageParam } from '@/hooks/usePageParam' ;
1011import { ErrorAlert } from '@/modules/ErrorAlert' ;
1112import { AppBreadcrumbsList } from '@/modules/apps/AppBreadcrumbs' ;
@@ -94,7 +95,10 @@ function AppsRoute() {
9495 < LoaderCircle className = "animate-spin" />
9596 ) }
9697 </ h1 >
97- < AppBreadcrumbsList />
98+ < div className = "flex items-center gap-2" >
99+ < BackButton />
100+ < AppBreadcrumbsList />
101+ </ div >
98102 </ div >
99103
100104 { hasPastError && ! data . length ? (
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { useQuery } from '@tanstack/react-query';
44import { createFileRoute } from '@tanstack/react-router' ;
55import { LoaderCircle } from 'lucide-react' ;
66import DatasetIcon from '@/components/icons/DatasetIcon' ;
7+ import { BackButton } from '@/components/ui/BackButton' ;
78import { DetailsTable } from '@/modules/DetailsTable' ;
89import { ErrorAlert } from '@/modules/ErrorAlert' ;
910import { DatasetBreadcrumbs } from '@/modules/datasets/dataset/DatasetBreadcrumbs' ;
@@ -95,7 +96,10 @@ function DatasetsRoute() {
9596 < LoaderCircle className = "animate-spin" />
9697 ) }
9798 </ h1 >
98- < DatasetBreadcrumbs datasetId = { datasetAddress } />
99+ < div className = "flex items-center gap-2" >
100+ < BackButton />
101+ < DatasetBreadcrumbs datasetId = { datasetAddress } />
102+ </ div >
99103 </ div >
100104
101105 < div className = "space-y-10" >
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { LoaderCircle } from 'lucide-react';
66import { DataTable } from '@/components/DataTable' ;
77import { PaginatedNavigation } from '@/components/PaginatedNavigation' ;
88import DatasetIcon from '@/components/icons/DatasetIcon' ;
9+ import { BackButton } from '@/components/ui/BackButton' ;
910import { usePageParam } from '@/hooks/usePageParam' ;
1011import { ErrorAlert } from '@/modules/ErrorAlert' ;
1112import { DatasetBreadcrumbsList } from '@/modules/datasets/DatasetBreadcrumbs' ;
@@ -94,7 +95,10 @@ function DatasetsRoute() {
9495 < LoaderCircle className = "animate-spin" />
9596 ) }
9697 </ h1 >
97- < DatasetBreadcrumbsList />
98+ < div className = "flex items-center gap-2" >
99+ < BackButton />
100+ < DatasetBreadcrumbsList />
101+ </ div >
98102 </ div >
99103
100104 { hasPastError && ! data . length ? (
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { createFileRoute } from '@tanstack/react-router';
55import { LoaderCircle } from 'lucide-react' ;
66import { useState } from 'react' ;
77import DealIcon from '@/components/icons/DealIcon' ;
8+ import { BackButton } from '@/components/ui/BackButton' ;
89import { DetailsTable } from '@/modules/DetailsTable' ;
910import { ErrorAlert } from '@/modules/ErrorAlert' ;
1011import { Tabs } from '@/modules/Tabs' ;
@@ -97,7 +98,10 @@ function DealsRoute() {
9798 < LoaderCircle className = "animate-spin" />
9899 ) }
99100 </ h1 >
100- < DealBreadcrumbs dealId = { dealAddress } />
101+ < div className = "flex items-center gap-2" >
102+ < BackButton />
103+ < DealBreadcrumbs dealId = { dealAddress } />
104+ </ div >
101105 </ div >
102106
103107 < Tabs
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { LoaderCircle } from 'lucide-react';
66import { DataTable } from '@/components/DataTable' ;
77import { PaginatedNavigation } from '@/components/PaginatedNavigation' ;
88import DealIcon from '@/components/icons/DealIcon' ;
9+ import { BackButton } from '@/components/ui/BackButton' ;
910import { usePageParam } from '@/hooks/usePageParam' ;
1011import { ErrorAlert } from '@/modules/ErrorAlert' ;
1112import { AllDealsBreadcrumbs } from '@/modules/deals/DealBreadcrumbs' ;
@@ -94,7 +95,10 @@ function DealsRoute() {
9495 < LoaderCircle className = "animate-spin" />
9596 ) }
9697 </ h1 >
97- < AllDealsBreadcrumbs />
98+ < div className = "flex items-center gap-2" >
99+ < BackButton />
100+ < AllDealsBreadcrumbs />
101+ </ div >
98102 </ div >
99103 { hasPastError && ! data . length ? (
100104 < ErrorAlert message = "An error occurred during deals loading." />
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { useQuery } from '@tanstack/react-query';
44import { createFileRoute } from '@tanstack/react-router' ;
55import { LoaderCircle } from 'lucide-react' ;
66import TaskIcon from '@/components/icons/TaskIcon' ;
7+ import { BackButton } from '@/components/ui/BackButton' ;
78import { DetailsTable } from '@/modules/DetailsTable' ;
89import { ErrorAlert } from '@/modules/ErrorAlert' ;
910import { SearcherBar } from '@/modules/search/SearcherBar' ;
@@ -91,7 +92,10 @@ function TasksRoute() {
9192 < LoaderCircle className = "animate-spin" />
9293 ) }
9394 </ h1 >
94- < TaskBreadcrumbs taskId = { taskAddress } />
95+ < div className = "flex items-center gap-2" >
96+ < BackButton />
97+ < TaskBreadcrumbs taskId = { taskAddress } />
98+ </ div >
9599 </ div >
96100
97101 { hasPastError && ! taskDetails ? (
You can’t perform that action at this time.
0 commit comments