mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 13:13:25 +00:00
refactor to tamagui
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
|
||||
import { defaultTheme } from "@movie-web/tailwind-config/themes";
|
||||
import { useTheme } from "tamagui";
|
||||
|
||||
interface SvgTabBarIconProps {
|
||||
focused?: boolean;
|
||||
@@ -11,9 +11,8 @@ export default function SvgTabBarIcon({
|
||||
focused,
|
||||
children,
|
||||
}: SvgTabBarIconProps) {
|
||||
const fillColor = focused
|
||||
? defaultTheme.extend.colors.tabBar.active
|
||||
: defaultTheme.extend.colors.tabBar.inactive;
|
||||
const theme = useTheme();
|
||||
const fillColor = focused ? theme.tabBarIconFocused.val : theme.tabBarIcon.val;
|
||||
|
||||
if (React.isValidElement(children)) {
|
||||
return React.cloneElement(children, { fillColor } as React.Attributes);
|
||||
|
Reference in New Issue
Block a user