From e38dc962f26289b5ad1859581d9936da1ceefe06 Mon Sep 17 00:00:00 2001 From: Imamuzzaki Abu Salam Date: Fri, 18 Aug 2023 12:28:14 +0000 Subject: [PATCH 1/2] feat: button width can be number, string, or null --- src/Button.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Button.tsx b/src/Button.tsx index 9781ab4..5ee52f6 100644 --- a/src/Button.tsx +++ b/src/Button.tsx @@ -79,7 +79,7 @@ export type ButtonTypes = { textColor?: string; textLineHeight?: number; textSize?: number; - width?: number | null; + width?: number | string | null; children?: string | ReactNode; onPress?: (callback?: () => void) => void; onLongPress?: PressableProps['onLongPress']; From ce8f74add7038431853081a85cdd2d864605ceee Mon Sep 17 00:00:00 2001 From: Imamuzzaki Abu Salam Date: Fri, 18 Aug 2023 13:40:26 +0000 Subject: [PATCH 2/2] feat: add Percentage type --- src/Button.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Button.tsx b/src/Button.tsx index 5ee52f6..5e88b28 100644 --- a/src/Button.tsx +++ b/src/Button.tsx @@ -40,6 +40,8 @@ import { } from './constants'; import Placeholder from './Placeholder'; +type Percentage = `${number}%`; + export type ButtonTypes = { activityColor?: string; activeOpacity?: number; @@ -79,7 +81,7 @@ export type ButtonTypes = { textColor?: string; textLineHeight?: number; textSize?: number; - width?: number | string | null; + width?: number | 'auto' | Percentage | null; children?: string | ReactNode; onPress?: (callback?: () => void) => void; onLongPress?: PressableProps['onLongPress'];