[IMPROVE] - fixing some errors appoint by jest
This commit is contained in:
parent
20d7b6a051
commit
50a99fb846
|
@ -24,7 +24,7 @@ stories.add('long text', () => (
|
|||
<BackgroundContainer text={longText} />
|
||||
));
|
||||
|
||||
const ThemeStory = ({ theme, ...props }: any) => (
|
||||
const ThemeStory = ({ theme, ...props }) => (
|
||||
<ThemeContext.Provider
|
||||
value={{ theme }}
|
||||
>
|
|
@ -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 }) => (
|
||||
<Header
|
||||
headerTitle={() => (
|
||||
<View style={{ flex: 1, paddingHorizontal: 12 }}>
|
||||
|
@ -77,7 +77,7 @@ stories.add('thread', () => (
|
|||
</>
|
||||
));
|
||||
|
||||
const ThemeStory = ({ theme }: any) => (
|
||||
const ThemeStory = ({ theme }) => (
|
||||
<ThemeContext.Provider
|
||||
value={{ theme }}
|
||||
>
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue