Icon type change.

This commit is contained in:
shafi54 2026-09-05 11:23:39 +05:30
parent 7ad1b81356
commit bfb67e626b
8 changed files with 35 additions and 42 deletions

View file

@ -1,13 +1,8 @@
import React from 'react'; import React from 'react';
import Svg, { Path } from 'react-native-svg'; import Svg, { Path } from 'react-native-svg';
import type { TabIconProps } from '@packages/shared';
interface CartIconProps { const CartIcon: React.FC<TabIconProps> = ({ focused, size, color }) => {
focused: boolean;
size: number;
color: string;
}
const CartIcon: React.FC<CartIconProps> = ({ focused, size, color }) => {
if (focused) { if (focused) {
// Focused state SVG (cart without handle) // Focused state SVG (cart without handle)
return ( return (

View file

@ -1,13 +1,8 @@
import React from 'react'; import React from 'react';
import Svg, { Path } from 'react-native-svg'; import Svg, { Path } from 'react-native-svg';
import type { TabIconProps } from '@packages/shared';
interface HomeIconProps { const HomeIcon: React.FC<TabIconProps> = ({ focused, size, color }) => {
focused: boolean;
size: number;
color: string;
}
const HomeIcon: React.FC<HomeIconProps> = ({ focused, size, color }) => {
if (focused) { if (focused) {
// Selected state SVG (filled house) // Selected state SVG (filled house)
return ( return (

View file

@ -1,13 +1,8 @@
import React from 'react'; import React from 'react';
import Svg, { Path } from 'react-native-svg'; import Svg, { Path } from 'react-native-svg';
import type { TabIconProps } from '@packages/shared';
interface MeIconProps { const MeIcon: React.FC<TabIconProps> = ({ focused, size, color }) => {
focused: boolean;
size: number;
color: string;
}
const MeIcon: React.FC<MeIconProps> = ({ focused, size, color }) => {
if (focused) { if (focused) {
// Selected state SVG (filled user) // Selected state SVG (filled user)
return ( return (

View file

@ -1,13 +1,8 @@
import React from 'react'; import React from 'react';
import Svg, { Path } from 'react-native-svg'; import Svg, { Path } from 'react-native-svg';
import type { TabIconProps } from '@packages/shared';
interface OffersIconProps { const OffersIcon: React.FC<TabIconProps> = ({ focused, size, color }) => {
focused: boolean;
size: number;
color: string;
}
const OffersIcon: React.FC<OffersIconProps> = ({ focused, size, color }) => {
if (focused) { if (focused) {
// Selected state SVG (filled offer tag) // Selected state SVG (filled offer tag)
return ( return (

View file

@ -1,13 +1,8 @@
import React from 'react'; import React from 'react';
import Svg, { Path } from 'react-native-svg'; import Svg, { Path } from 'react-native-svg';
import type { TabIconProps } from '@packages/shared';
interface StoresIconProps { const StoresIcon: React.FC<TabIconProps> = ({ focused, size, color }) => {
focused: boolean;
size: number;
color: string;
}
const StoresIcon: React.FC<StoresIconProps> = ({ focused, size, color }) => {
if (focused) { if (focused) {
// Selected state SVG (filled squares) // Selected state SVG (filled squares)
return ( return (

View file

@ -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). [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. 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<XxxIconProps> → React.FC<TabIconProps>
- 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.

View file

@ -23,3 +23,9 @@ export interface IdName {
export interface ReactParentComponent { export interface ReactParentComponent {
children: ReactNode children: ReactNode
} }
export interface TabIconProps {
focused: boolean
size: number
color: string
}

View file

@ -1,13 +1,8 @@
import React from 'react'; import React from 'react';
import Svg, { Path } from 'react-native-svg'; import Svg, { Path } from 'react-native-svg';
import type { TabIconProps } from '@packages/shared';
interface CartIconProps { const CartIcon: React.FC<TabIconProps> = ({ focused, size, color }) => {
focused: boolean;
size: number;
color: string;
}
const CartIcon: React.FC<CartIconProps> = ({ focused, size, color }) => {
if (focused) { if (focused) {
// Focused state SVG (cart without handle) // Focused state SVG (cart without handle)
return ( return (