From 3f5f309643311ed92e957112687c06f5249d7862 Mon Sep 17 00:00:00 2001 From: AlexAlexandre Date: Thu, 29 Jul 2021 12:45:32 -0300 Subject: [PATCH] [IMPROVE] - migrate directoryItem presentation layer --- app/containers/UIKit/index.tsx | 1 + .../DirectoryItem/{index.js => index.tsx} | 42 +++++++++---------- .../DirectoryItem/{styles.js => styles.ts} | 0 3 files changed, 22 insertions(+), 21 deletions(-) rename app/presentation/DirectoryItem/{index.js => index.tsx} (74%) rename app/presentation/DirectoryItem/{styles.js => styles.ts} (100%) diff --git a/app/containers/UIKit/index.tsx b/app/containers/UIKit/index.tsx index 9f26331c5..7928e3689 100644 --- a/app/containers/UIKit/index.tsx +++ b/app/containers/UIKit/index.tsx @@ -225,6 +225,7 @@ class ModalParser extends UiKitParserModal { const { theme } = useContext(ThemeContext); const { multiline, actionId, placeholder } = element; return ( + // @ts-ignore { +type TDirectoryItemLabel = { + text: string; + theme: string; +} + +interface IDirectoryItem { + title: string; + description: string; + avatar: string; + type: string; + onPress(): void; + testID: string; + style: any; + rightLabel: string; + rid: string; + theme: string; + teamMain: boolean; +} + +const DirectoryItemLabel = React.memo(({ text, theme }: TDirectoryItemLabel) => { if (!text) { return null; } @@ -19,7 +38,7 @@ const DirectoryItemLabel = React.memo(({ text, theme }) => { const DirectoryItem = ({ title, description, avatar, onPress, testID, style, rightLabel, type, rid, theme, teamMain -}) => ( +}: IDirectoryItem) => ( ); -DirectoryItem.propTypes = { - title: PropTypes.string.isRequired, - description: PropTypes.string, - avatar: PropTypes.string, - type: PropTypes.string, - onPress: PropTypes.func.isRequired, - testID: PropTypes.string.isRequired, - style: PropTypes.any, - rightLabel: PropTypes.string, - rid: PropTypes.string, - theme: PropTypes.string, - teamMain: PropTypes.bool -}; - -DirectoryItemLabel.propTypes = { - text: PropTypes.string, - theme: PropTypes.string -}; - export default DirectoryItem; diff --git a/app/presentation/DirectoryItem/styles.js b/app/presentation/DirectoryItem/styles.ts similarity index 100% rename from app/presentation/DirectoryItem/styles.js rename to app/presentation/DirectoryItem/styles.ts