[IMPROVE] - fixing some errors appoint by jest

This commit is contained in:
AlexAlexandre 2021-08-02 10:48:43 -03:00
parent 20d7b6a051
commit 50a99fb846
4 changed files with 9 additions and 9 deletions

View File

@ -24,7 +24,7 @@ stories.add('long text', () => (
<BackgroundContainer text={longText} /> <BackgroundContainer text={longText} />
)); ));
const ThemeStory = ({ theme, ...props }: any) => ( const ThemeStory = ({ theme, ...props }) => (
<ThemeContext.Provider <ThemeContext.Provider
value={{ theme }} value={{ theme }}
> >

View File

@ -11,7 +11,7 @@ import { ThemeContext } from '../../theme';
const stories = storiesOf('RoomHeader', module); const stories = storiesOf('RoomHeader', module);
// TODO: refactor after react-navigation v6 // TODO: refactor after react-navigation v6
const HeaderExample = ({ title }: any) => ( const HeaderExample = ({ title }) => (
<Header <Header
headerTitle={() => ( headerTitle={() => (
<View style={{ flex: 1, paddingHorizontal: 12 }}> <View style={{ flex: 1, paddingHorizontal: 12 }}>
@ -77,7 +77,7 @@ stories.add('thread', () => (
</> </>
)); ));
const ThemeStory = ({ theme }: any) => ( const ThemeStory = ({ theme }) => (
<ThemeContext.Provider <ThemeContext.Provider
value={{ theme }} value={{ theme }}
> >

View File

@ -76,9 +76,9 @@ interface IRoomHeader {
const SubTitle = React.memo(({ usersTyping, subtitle, renderFunc, theme, scale }: TRoomHeaderSubTitle) => { const SubTitle = React.memo(({ usersTyping, subtitle, renderFunc, theme, scale }: TRoomHeaderSubTitle) => {
const fontSize = getSubTitleSize(scale); const fontSize = getSubTitleSize(scale);
// typing // typing
if (usersTyping.length) { if (usersTyping?.length) {
let usersText; let usersText;
if (usersTyping.length === 2) { if (usersTyping?.length === 2) {
usersText = usersTyping.join(` ${ I18n.t('and') } `); usersText = usersTyping.join(` ${ I18n.t('and') } `);
} else { } else {
usersText = usersTyping.join(', '); usersText = usersTyping.join(', ');
@ -147,7 +147,7 @@ const Header = React.memo(({
let scale = 1; let scale = 1;
if (!portrait && !tmid) { if (!portrait && !tmid) {
if (usersTyping.length > 0 || subtitle) { if (usersTyping?.length > 0 || subtitle) {
scale = 0.8; scale = 0.8;
} }
} }

View File

@ -24,9 +24,9 @@ interface ITouchableProps {
favorite: boolean; favorite: boolean;
isRead: boolean; isRead: boolean;
rid: string; rid: string;
toggleFav({}?, {}?): void; toggleFav: Function;
toggleRead({}?, {}?): void; toggleRead: Function;
hideChannel({}?, {}?): void; hideChannel: Function;
theme: string; theme: string;
isFocused: boolean; isFocused: boolean;
swipeEnabled: boolean; swipeEnabled: boolean;