Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui-ux): hide bottom nagivation when EMV network is selected #4011

Merged
merged 2 commits into from
Aug 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 54 additions & 43 deletions mobile-app/app/screens/AppNavigator/BottomTabNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
PortfolioIcon,
} from "@screens/WalletNavigator/assets/BottomNavIcon";
import { useThemeContext } from "@waveshq/walletkit-ui";
import { DomainType, useDomainContext } from "@contexts/DomainContext";
import { PortfolioNavigator } from "./screens/Portfolio/PortfolioNavigator";
import { DexNavigator } from "./screens/Dex/DexNavigator";
import { LoansNavigator } from "./screens/Loans/LoansNavigator";
Expand Down Expand Up @@ -41,6 +42,7 @@ const getTabBarLabel = ({

export function BottomTabNavigator(): JSX.Element {
const { isLight } = useThemeContext();
const { domain } = useDomainContext();
return (
<>
<OceanInterface />
Expand All @@ -54,7 +56,8 @@ export function BottomTabNavigator(): JSX.Element {
"px-5 py-2 h-16 border-t",
{ "bg-mono-light-v2-00 border-mono-light-v2-100": isLight },
{ "bg-mono-dark-v2-00 border-mono-dark-v2-100": !isLight },
{ "pt-1 pb-4 h-24": Platform.OS === "ios" }
{ "pt-1 pb-4 h-24": Platform.OS === "ios" },
{ hidden: domain !== DomainType.DFI }
),
tabBarActiveTintColor: getColor("brand-v2-500"),
tabBarInactiveTintColor: isLight
Expand All @@ -80,50 +83,58 @@ export function BottomTabNavigator(): JSX.Element {
}}
/>

<BottomTab.Screen
component={DexNavigator}
name="DEX"
options={{
tabBarLabel: ({ focused, color }) =>
getTabBarLabel({
focused,
color,
title: translate("BottomTabNavigator", "DEX"),
}),
tabBarTestID: "bottom_tab_dex",
tabBarIcon: ({ color }) => <DEXIcon color={color} size={24} />,
}}
/>
{domain === DomainType.DFI && (
<>
<BottomTab.Screen
component={DexNavigator}
name="DEX"
options={{
tabBarLabel: ({ focused, color }) =>
getTabBarLabel({
focused,
color,
title: translate("BottomTabNavigator", "DEX"),
}),
tabBarTestID: "bottom_tab_dex",
tabBarIcon: ({ color }) => <DEXIcon color={color} size={24} />,
}}
/>

<BottomTab.Screen
component={LoansNavigator}
name="Loans"
options={{
tabBarLabel: ({ focused, color }) =>
getTabBarLabel({
focused,
color,
title: translate("BottomTabNavigator", "Loans"),
}),
tabBarTestID: "bottom_tab_loans",
tabBarIcon: ({ color }) => <LoansIcon color={color} size={24} />,
}}
/>
<BottomTab.Screen
component={LoansNavigator}
name="Loans"
options={{
tabBarLabel: ({ focused, color }) =>
getTabBarLabel({
focused,
color,
title: translate("BottomTabNavigator", "Loans"),
}),
tabBarTestID: "bottom_tab_loans",
tabBarIcon: ({ color }) => (
<LoansIcon color={color} size={24} />
),
}}
/>

<BottomTab.Screen
component={AuctionsNavigator}
name="Auctions"
options={{
tabBarLabel: ({ focused, color }) =>
getTabBarLabel({
focused,
color,
title: translate("BottomTabNavigator", "Auctions"),
}),
tabBarTestID: "bottom_tab_auctions",
tabBarIcon: ({ color }) => <AuctionsIcon color={color} size={24} />,
}}
/>
<BottomTab.Screen
component={AuctionsNavigator}
name="Auctions"
options={{
tabBarLabel: ({ focused, color }) =>
getTabBarLabel({
focused,
color,
title: translate("BottomTabNavigator", "Auctions"),
}),
tabBarTestID: "bottom_tab_auctions",
tabBarIcon: ({ color }) => (
<AuctionsIcon color={color} size={24} />
),
}}
/>
</>
)}
</BottomTab.Navigator>
</>
);
Expand Down