From 382d0d2e7498beeeae2105d42ff52e378f3354d4 Mon Sep 17 00:00:00 2001 From: Sokolovskii Ivan Date: Fri, 23 Jan 2026 08:47:45 +0300 Subject: [PATCH] =?UTF-8?q?fix(types):=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=82=D0=B8=D0=BF=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=B2=D0=BE=D0=B9=D1=81?= =?UTF-8?q?=D1=82=D0=B0=20style=20=D0=B2=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D1=82=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Avatar/Avatar.tsx | 3 ++- src/components/Badge/Badge.tsx | 3 ++- src/components/Input/FloatLabel.tsx | 4 ++-- src/components/Input/InputGroup.tsx | 10 ++++++++-- src/components/Input/InputText.tsx | 4 ++-- src/components/Input/InputTextBase/types.ts | 9 +++++++-- src/components/Message/Message.tsx | 3 ++- src/components/ToggleButton/ToggleButton.tsx | 3 ++- 8 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/components/Avatar/Avatar.tsx b/src/components/Avatar/Avatar.tsx index f0ad6f3..bfae1fb 100644 --- a/src/components/Avatar/Avatar.tsx +++ b/src/components/Avatar/Avatar.tsx @@ -14,6 +14,7 @@ import { type ImageSourcePropType, type LayoutChangeEvent, type LayoutRectangle, + type StyleProp, Text, useWindowDimensions, View, @@ -38,7 +39,7 @@ interface AvatarBase extends AccessibilityProps { */ shape?: 'square' | 'circle' /** Дополнительная стилизация для контейнера компонента */ - style?: ViewStyle + style?: StyleProp testID?: string /** Callback функция при ошибке загрузки картинки */ onError?: ComponentProps['onError'] diff --git a/src/components/Badge/Badge.tsx b/src/components/Badge/Badge.tsx index 77fa7ae..185b14c 100644 --- a/src/components/Badge/Badge.tsx +++ b/src/components/Badge/Badge.tsx @@ -4,6 +4,7 @@ import { Dimensions, type LayoutChangeEvent, type LayoutRectangle, + type StyleProp, Text, View, type ViewStyle, @@ -22,7 +23,7 @@ export interface BadgeBase */ severity?: BadgeSeverity /** Дополнительная стилизация для контейнера компонента */ - style?: ViewStyle + style?: StyleProp } interface BadgeText extends BadgeBase { diff --git a/src/components/Input/FloatLabel.tsx b/src/components/Input/FloatLabel.tsx index f206195..2befd2e 100644 --- a/src/components/Input/FloatLabel.tsx +++ b/src/components/Input/FloatLabel.tsx @@ -1,5 +1,5 @@ import { memo } from 'react' -import { View, type ViewStyle } from 'react-native' +import { View, type StyleProp, type ViewStyle } from 'react-native' import { InputTextBase } from './InputTextBase/InputTextBase' import type { InputTextBaseProps } from './InputTextBase/types' @@ -10,7 +10,7 @@ export interface FloatLabelProps extends InputTextBaseProps { /** Показать индикатор загрузки в поле */ loading?: boolean /** Дополнительная стилизация для контейнера компонента */ - style?: ViewStyle + style?: StyleProp } /** diff --git a/src/components/Input/InputGroup.tsx b/src/components/Input/InputGroup.tsx index d9a2552..b837943 100644 --- a/src/components/Input/InputGroup.tsx +++ b/src/components/Input/InputGroup.tsx @@ -1,5 +1,11 @@ import { memo, useCallback, useImperativeHandle, useMemo, useRef } from 'react' -import { type TextInput, View, StyleSheet, type ViewStyle } from 'react-native' +import { + type TextInput, + View, + StyleSheet, + type ViewStyle, + type StyleProp, +} from 'react-native' import { makeStyles } from '../../utils/makeStyles' @@ -14,7 +20,7 @@ interface InputGroupBaseProps { /** Содержимое правого аддона группы */ right?: InputGroupAddonProps['content'] /** Дополнительная стилизация для контейнера компонента */ - style?: ViewStyle + style?: StyleProp } export type InputGroupProps = InputGroupBaseProps & InputTextBaseProps diff --git a/src/components/Input/InputText.tsx b/src/components/Input/InputText.tsx index ca8fb3e..5d93330 100644 --- a/src/components/Input/InputText.tsx +++ b/src/components/Input/InputText.tsx @@ -1,12 +1,12 @@ import { memo } from 'react' -import { View, type ViewStyle } from 'react-native' +import { View, type StyleProp, type ViewStyle } from 'react-native' import { InputTextBase } from './InputTextBase/InputTextBase' import type { InputTextBaseProps } from './InputTextBase/types' export interface InputTextProps extends InputTextBaseProps { /** Дополнительная стилизация для контейнера компонента */ - style?: ViewStyle + style?: StyleProp } /** diff --git a/src/components/Input/InputTextBase/types.ts b/src/components/Input/InputTextBase/types.ts index a169d73..34f29fa 100644 --- a/src/components/Input/InputTextBase/types.ts +++ b/src/components/Input/InputTextBase/types.ts @@ -1,5 +1,10 @@ import type { Ref, ReactNode } from 'react' -import type { TextInputProps, ViewStyle, TextInput } from 'react-native' +import type { + TextInputProps, + ViewStyle, + TextInput, + StyleProp, +} from 'react-native' /** @see TextInputProps */ export interface InputTextBaseProps extends Omit< @@ -21,7 +26,7 @@ export interface InputTextBaseProps extends Omit< /** Озвучка для кнопки очистки поля */ clearButtonAccessibilityLabel?: string /** Управление стилем контейнера поля ввода */ - containerStyle?: ViewStyle + containerStyle?: StyleProp /** Управление доступностью поля */ disabled?: boolean /** Ref для управления полем ввода */ diff --git a/src/components/Message/Message.tsx b/src/components/Message/Message.tsx index 284a64d..656c3f1 100644 --- a/src/components/Message/Message.tsx +++ b/src/components/Message/Message.tsx @@ -8,6 +8,7 @@ import { import { type ComponentProps, memo, type ReactNode, useMemo } from 'react' import { type AccessibilityProps, + type StyleProp, View, type ViewProps, type ViewStyle, @@ -56,7 +57,7 @@ export interface MessageProps severity?: 'info' | 'success' | 'warning' | 'danger' /** Дополнительная стилизация для контейнера компонента */ - style?: ViewStyle + style?: StyleProp /** Значение таймера, если нужно отображать таймер вместо иконки */ timerValue?: number diff --git a/src/components/ToggleButton/ToggleButton.tsx b/src/components/ToggleButton/ToggleButton.tsx index e57fbfc..8ec530a 100644 --- a/src/components/ToggleButton/ToggleButton.tsx +++ b/src/components/ToggleButton/ToggleButton.tsx @@ -2,6 +2,7 @@ import { memo, useCallback, useMemo, useState } from 'react' import { type AccessibilityProps, Pressable, + type StyleProp, Text, View, type ViewProps, @@ -44,7 +45,7 @@ export interface ToggleButtonProps */ size?: 'xlarge' | 'large' | 'base' | 'small' /** Дополнительная стилизация для контейнера компонента */ - style?: ViewStyle + style?: StyleProp /** SVG-иконка */ Icon?: SvgSource }