diff --git a/apps/user-ui/components/icons/CartIcon.tsx b/apps/user-ui/components/icons/CartIcon.tsx index aaa878c..a305415 100644 --- a/apps/user-ui/components/icons/CartIcon.tsx +++ b/apps/user-ui/components/icons/CartIcon.tsx @@ -1,13 +1,8 @@ import React from 'react'; import Svg, { Path } from 'react-native-svg'; +import type { TabIconProps } from '@packages/shared'; -interface CartIconProps { - focused: boolean; - size: number; - color: string; -} - -const CartIcon: React.FC = ({ focused, size, color }) => { +const CartIcon: React.FC = ({ focused, size, color }) => { if (focused) { // Focused state SVG (cart without handle) return ( diff --git a/apps/user-ui/components/icons/HomeIcon.tsx b/apps/user-ui/components/icons/HomeIcon.tsx index b2629ec..36008a9 100644 --- a/apps/user-ui/components/icons/HomeIcon.tsx +++ b/apps/user-ui/components/icons/HomeIcon.tsx @@ -1,13 +1,8 @@ import React from 'react'; import Svg, { Path } from 'react-native-svg'; +import type { TabIconProps } from '@packages/shared'; -interface HomeIconProps { - focused: boolean; - size: number; - color: string; -} - -const HomeIcon: React.FC = ({ focused, size, color }) => { +const HomeIcon: React.FC = ({ focused, size, color }) => { if (focused) { // Selected state SVG (filled house) return ( diff --git a/apps/user-ui/components/icons/MeIcon.tsx b/apps/user-ui/components/icons/MeIcon.tsx index cf9a3c0..0a03407 100644 --- a/apps/user-ui/components/icons/MeIcon.tsx +++ b/apps/user-ui/components/icons/MeIcon.tsx @@ -1,13 +1,8 @@ import React from 'react'; import Svg, { Path } from 'react-native-svg'; +import type { TabIconProps } from '@packages/shared'; -interface MeIconProps { - focused: boolean; - size: number; - color: string; -} - -const MeIcon: React.FC = ({ focused, size, color }) => { +const MeIcon: React.FC = ({ focused, size, color }) => { if (focused) { // Selected state SVG (filled user) return ( diff --git a/apps/user-ui/components/icons/OffersIcon.tsx b/apps/user-ui/components/icons/OffersIcon.tsx index b066b78..f06834f 100644 --- a/apps/user-ui/components/icons/OffersIcon.tsx +++ b/apps/user-ui/components/icons/OffersIcon.tsx @@ -1,13 +1,8 @@ import React from 'react'; import Svg, { Path } from 'react-native-svg'; +import type { TabIconProps } from '@packages/shared'; -interface OffersIconProps { - focused: boolean; - size: number; - color: string; -} - -const OffersIcon: React.FC = ({ focused, size, color }) => { +const OffersIcon: React.FC = ({ focused, size, color }) => { if (focused) { // Selected state SVG (filled offer tag) return ( diff --git a/apps/user-ui/components/icons/StoresIcon.tsx b/apps/user-ui/components/icons/StoresIcon.tsx index 575a631..c335e25 100644 --- a/apps/user-ui/components/icons/StoresIcon.tsx +++ b/apps/user-ui/components/icons/StoresIcon.tsx @@ -1,13 +1,8 @@ import React from 'react'; import Svg, { Path } from 'react-native-svg'; +import type { TabIconProps } from '@packages/shared'; -interface StoresIconProps { - focused: boolean; - size: number; - color: string; -} - -const StoresIcon: React.FC = ({ focused, size, color }) => { +const StoresIcon: React.FC = ({ focused, size, color }) => { if (focused) { // Selected state SVG (filled squares) return ( diff --git a/change-log.txt b/change-log.txt index bdc0a3e..5f43df5 100644 --- a/change-log.txt +++ b/change-log.txt @@ -984,3 +984,20 @@ Excluded: MyTouchableOpacityProps (optional children + extends — different sha [2026-09-05 11:15:00] COMPLETED Cluster-1 ReactParentComponent unification (11 files + shared def + fallback-ui tsconfig). Verification: user-ui 106, admin-ui 122, backend 11 (all = baselines); fallback-ui 107 total with zero errors in touched files. Zero leftover local interfaces. Docs: cluster-01 file + types_inventory status section marked resolved. + +[2026-09-05 11:20:24] ADD shared TabIconProps for Cluster-2 unification. +=== packages/shared/types/primitives.types.ts === +- appended: + export interface TabIconProps { + focused: boolean + size: number + color: string + } + +[2026-09-05 11:21:00] Cluster-2 unification: replace 6 local tab-icon prop interfaces with shared TabIconProps. +- apps/user-ui/components/icons/{HomeIcon,OffersIcon,CartIcon,StoresIcon,MeIcon}.tsx + packages/ui/src/components/icons/CartIcon.tsx: in each file delete lines 4-8 (local interface + trailing blank line) and add import type { TabIconProps } from '@packages/shared' after the react-native-svg import; update the single annotation React.FC → React.FC +- Excluded: nothing — all 6 members verified byte-identical shape, single local use each, no cross-file consumers. + +[2026-09-05 11:25:00] COMPLETED Cluster-2 TabIconProps unification (6 files + shared def). +Added shared TabIconProps {focused, size, color} in primitives.types.ts (auto-exported via existing primitives star). Replaced all 6 local interfaces (5 user-ui icons + ui CartIcon), each verified single local use, zero cross-file consumers. +Verification: user-ui 106, admin-ui 122, backend 11 (all = baselines); zero leftover local interfaces. Docs: cluster-02 file + types_inventory status section marked resolved. diff --git a/packages/shared/types/primitives.types.ts b/packages/shared/types/primitives.types.ts index 43189a2..55c8685 100644 --- a/packages/shared/types/primitives.types.ts +++ b/packages/shared/types/primitives.types.ts @@ -23,3 +23,9 @@ export interface IdName { export interface ReactParentComponent { children: ReactNode } + +export interface TabIconProps { + focused: boolean + size: number + color: string +} diff --git a/packages/ui/src/components/icons/CartIcon.tsx b/packages/ui/src/components/icons/CartIcon.tsx index aaa878c..a305415 100644 --- a/packages/ui/src/components/icons/CartIcon.tsx +++ b/packages/ui/src/components/icons/CartIcon.tsx @@ -1,13 +1,8 @@ import React from 'react'; import Svg, { Path } from 'react-native-svg'; +import type { TabIconProps } from '@packages/shared'; -interface CartIconProps { - focused: boolean; - size: number; - color: string; -} - -const CartIcon: React.FC = ({ focused, size, color }) => { +const CartIcon: React.FC = ({ focused, size, color }) => { if (focused) { // Focused state SVG (cart without handle) return (