From 50a99fb846ade46a44849732e8445e1cb286c58e Mon Sep 17 00:00:00 2001 From: AlexAlexandre Date: Mon, 2 Aug 2021 10:48:43 -0300 Subject: [PATCH] [IMPROVE] - fixing some errors appoint by jest --- .../{index.stories.tsx => index.stories.js} | 2 +- .../{RoomHeader.stories.tsx => RoomHeader.stories.js} | 4 ++-- app/containers/RoomHeader/RoomHeader.tsx | 6 +++--- app/presentation/RoomItem/Touchable.tsx | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) rename app/containers/BackgroundContainer/{index.stories.tsx => index.stories.js} (95%) rename app/containers/RoomHeader/{RoomHeader.stories.tsx => RoomHeader.stories.js} (97%) diff --git a/app/containers/BackgroundContainer/index.stories.tsx b/app/containers/BackgroundContainer/index.stories.js similarity index 95% rename from app/containers/BackgroundContainer/index.stories.tsx rename to app/containers/BackgroundContainer/index.stories.js index 95546ae27..0b6c9a1c6 100644 --- a/app/containers/BackgroundContainer/index.stories.tsx +++ b/app/containers/BackgroundContainer/index.stories.js @@ -24,7 +24,7 @@ stories.add('long text', () => ( )); -const ThemeStory = ({ theme, ...props }: any) => ( +const ThemeStory = ({ theme, ...props }) => ( diff --git a/app/containers/RoomHeader/RoomHeader.stories.tsx b/app/containers/RoomHeader/RoomHeader.stories.js similarity index 97% rename from app/containers/RoomHeader/RoomHeader.stories.tsx rename to app/containers/RoomHeader/RoomHeader.stories.js index b3fd29136..bfea5e272 100644 --- a/app/containers/RoomHeader/RoomHeader.stories.tsx +++ b/app/containers/RoomHeader/RoomHeader.stories.js @@ -11,7 +11,7 @@ import { ThemeContext } from '../../theme'; const stories = storiesOf('RoomHeader', module); // TODO: refactor after react-navigation v6 -const HeaderExample = ({ title }: any) => ( +const HeaderExample = ({ title }) => (
( @@ -77,7 +77,7 @@ stories.add('thread', () => ( )); -const ThemeStory = ({ theme }: any) => ( +const ThemeStory = ({ theme }) => ( diff --git a/app/containers/RoomHeader/RoomHeader.tsx b/app/containers/RoomHeader/RoomHeader.tsx index 4a753137a..e2b71d6d8 100644 --- a/app/containers/RoomHeader/RoomHeader.tsx +++ b/app/containers/RoomHeader/RoomHeader.tsx @@ -76,9 +76,9 @@ interface IRoomHeader { const SubTitle = React.memo(({ usersTyping, subtitle, renderFunc, theme, scale }: TRoomHeaderSubTitle) => { const fontSize = getSubTitleSize(scale); // typing - if (usersTyping.length) { + if (usersTyping?.length) { let usersText; - if (usersTyping.length === 2) { + if (usersTyping?.length === 2) { usersText = usersTyping.join(` ${ I18n.t('and') } `); } else { usersText = usersTyping.join(', '); @@ -147,7 +147,7 @@ const Header = React.memo(({ let scale = 1; if (!portrait && !tmid) { - if (usersTyping.length > 0 || subtitle) { + if (usersTyping?.length > 0 || subtitle) { scale = 0.8; } } diff --git a/app/presentation/RoomItem/Touchable.tsx b/app/presentation/RoomItem/Touchable.tsx index 106f0cb33..8161ac4c2 100644 --- a/app/presentation/RoomItem/Touchable.tsx +++ b/app/presentation/RoomItem/Touchable.tsx @@ -24,9 +24,9 @@ interface ITouchableProps { favorite: boolean; isRead: boolean; rid: string; - toggleFav({}?, {}?): void; - toggleRead({}?, {}?): void; - hideChannel({}?, {}?): void; + toggleFav: Function; + toggleRead: Function; + hideChannel: Function; theme: string; isFocused: boolean; swipeEnabled: boolean;