-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: restored basket tab in sidebar (#2824)
- Loading branch information
1 parent
a7ef598
commit d0d38ff
Showing
8 changed files
with
41 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { useUnit } from 'effector-react'; | ||
|
||
import { $features } from '@/shared/config/features'; | ||
import { createFeature } from '@/shared/effector'; | ||
import { Paths } from '@/shared/routes'; | ||
import { BodyText } from '@/shared/ui'; | ||
import { basketModel } from '@/entities/basket'; | ||
import { walletModel } from '@/entities/wallet'; | ||
import { navigationBottomLinksPipeline } from '@/features/app-shell'; | ||
import { basketUtils } from '@/features/operations/OperationsConfirm'; | ||
|
||
export const basketNavigationFeature = createFeature({ | ||
name: 'basket/navigation', | ||
enable: $features.map(({ basket }) => basket), | ||
}); | ||
|
||
basketNavigationFeature.inject(navigationBottomLinksPipeline, (items) => { | ||
const wallet = useUnit(walletModel.$activeWallet); | ||
const basket = useUnit(basketModel.$basket); | ||
|
||
if (!wallet || !basketUtils.isBasketAvailable(wallet)) { | ||
return items; | ||
} | ||
|
||
return items.concat({ | ||
order: 0, | ||
icon: 'operations', | ||
title: 'navigation.basketLabel', | ||
link: Paths.BASKET, | ||
badge: ( | ||
<BodyText className="ml-auto text-text-tertiary"> | ||
{basket.filter((tx) => tx.initiatorWallet === wallet?.id).length || ''} | ||
</BodyText> | ||
), | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export { Navigation } from './ui/Navigation'; | ||
export { navigationModel } from './model/navigation-model'; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters