Minor tweaks
This commit is contained in:
parent
47f7ee8c91
commit
ffb17d603e
|
@ -102,11 +102,11 @@ const MessageTouchable = React.memo((props: IMessageTouchable & IMessage) => {
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const { onPress, onLongPress } = useContext(MessageContext);
|
const { onPress, onLongPress, onDiscussionPress } = useContext(MessageContext);
|
||||||
return (
|
return (
|
||||||
<Touchable
|
<Touchable
|
||||||
onLongPress={onLongPress}
|
onLongPress={onLongPress}
|
||||||
onPress={onPress}
|
onPress={() => (props.type !== 'discussion-created' ? onPress() : onDiscussionPress())}
|
||||||
disabled={(props.isInfo && !props.isThreadReply) || props.archived || props.isTemp}
|
disabled={(props.isInfo && !props.isThreadReply) || props.archived || props.isTemp}
|
||||||
style={{ backgroundColor: props.highlighted ? themes[props.theme].headerBackground : null }}>
|
style={{ backgroundColor: props.highlighted ? themes[props.theme].headerBackground : null }}>
|
||||||
<View>
|
<View>
|
||||||
|
|
|
@ -138,7 +138,7 @@ export interface IMessageInner
|
||||||
IMessageThread,
|
IMessageThread,
|
||||||
IMessageAttachments,
|
IMessageAttachments,
|
||||||
IMessageBroadcast {
|
IMessageBroadcast {
|
||||||
type: string;
|
type: 'discussion-created' | 'jitsi_call_started' | 'c' | 'd' | 'p' | 'l';
|
||||||
blocks: [];
|
blocks: [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ interface IThemeContextProps {
|
||||||
|
|
||||||
export const ThemeContext = React.createContext<IThemeContextProps>({ theme: 'light' });
|
export const ThemeContext = React.createContext<IThemeContextProps>({ theme: 'light' });
|
||||||
|
|
||||||
export function withTheme(Component: React.ComponentType<any>): (props: any) => JSX.Element {
|
export function withTheme<P extends object>(Component: React.ComponentType<P>): (props: any) => JSX.Element {
|
||||||
const ThemedComponent = (props: any) => (
|
const ThemedComponent = (props: any) => (
|
||||||
<ThemeContext.Consumer>{contexts => <Component {...props} {...contexts} />}</ThemeContext.Consumer>
|
<ThemeContext.Consumer>{contexts => <Component {...props} {...contexts} />}</ThemeContext.Consumer>
|
||||||
);
|
);
|
||||||
|
|
|
@ -179,7 +179,7 @@ const DiscussionsView = ({ navigation, route }: IDiscussionsViewProps): JSX.Elem
|
||||||
rid: item.drid,
|
rid: item.drid,
|
||||||
prid: item.rid,
|
prid: item.rid,
|
||||||
name: item.msg,
|
name: item.msg,
|
||||||
t: 'p'
|
t: 'c'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
1000,
|
1000,
|
||||||
|
|
Loading…
Reference in New Issue