Skip to content

Commit

Permalink
Better approach
Browse files Browse the repository at this point in the history
  • Loading branch information
jscriptcoder committed Mar 21, 2023
1 parent 3358e29 commit 06444c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/bridge-ui/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
pausable: false,
};
// TODO: Not found route
const routes = {
'/:tab?': wrap({
component: Home,
Expand Down
9 changes: 6 additions & 3 deletions packages/bridge-ui/src/pages/home/Home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
let bridgeWidth: number;
let bridgeHeight: number;
$: activeTab = $location.replace('/', '').startsWith('transactions')
? 'transactions'
: 'bridge';
// TODO: think about a more general approach here.
// We're assuming we have two tabs. The base location
// corresponde with `bridge` tab => /, otherwise we're
// opening the second tab `transactions`. What if we add
// a new tab?
$: activeTab = $location === '/' ? 'bridge' : 'transactions';
// TODO: do we really need all these tricks to style containers
// Rethink this part: fluid, fixing on small screens
Expand Down

0 comments on commit 06444c0

Please sign in to comment.