Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}> = ({ id, convKind, members, previousMessageId, nextMessageId, convPK }) => {
const ctx = useMsgrContext()
const inte = useInteraction(id, convPK)
const previousMessage = useInteraction(previousMessageId, convPK)
const nextMessage = useInteraction(nextMessageId, convPK)
const client: any = useClient()
const navigation = useNativeNavigation()
const _styles = useStylesMessage()
const [{ row, margin, padding, column, text, border, color, flex }, { scaleSize }] = useStyles()
const lastInte = useLastConvInteraction(convPK, interactionsFilter)
if (!inte) {
return null
}
let monitorPayload
if (inte.type === messengerpb.AppMessage.Type.TypeMonitorMetadata) {
/* typespb.MonitorGroup.TypeEventMonitor */
const monitorEvent = inte.payload.event
switch (monitorEvent.type) {
case eventMonitorTypes.TypeEventMonitorAdvertiseGroup:
const msgAdvertise = `local peer advertised ${monitorEvent.advertiseGroup.peerId.substr(
monitorEvent.advertiseGroup.peerId.length - 10,
)} on ${monitorEvent.advertiseGroup.driverName}, with ${
monitorEvent.advertiseGroup.maddrs.length
export default function useScrollToTop(
ref: React.RefObject
) {
const navigation = useNavigation();
const route = useRoute();
React.useEffect(() => {
let current = navigation;
// The screen might be inside another navigator such as stack nested in tabs
// We need to find the closest tab navigator and add the listener there
while (current && current.dangerouslyGetState().type !== 'tab') {
current = current.dangerouslyGetParent();
}
if (!current) {
return;
}
const unsubscribe = current.addListener(
}> = ({ inte, msgBorderColor, isFollowedMessage, msgBackgroundColor, msgTextColor }) => {
const {
payload: { body: message },
} = inte
const client = useClient()
const navigation = useNativeNavigation()
const [{ margin, padding, column, border }, { scaleSize }] = useStyles()
const [isReadMore, setReadMore] = useState(false)
useEffect(() => {
message && setReadMore(message.length > READ_MORE_MESSAGE_LENGTH)
}, [message])
return (
const DeleteAccountContent: React.FC<{}> = () => {
const { deleteAccount } = useMsgrContext()
const _styles = useStylesDeleteAccount()
const [{ row, margin, background, border, color, padding, text, column }] = useStyles()
const navigation = useReactNavigation()
const [deleteConfirmation, setDeleteConfirmation] = useState()
const confirmed = deleteConfirmation === DELETE_STR
return (
{(t: any): React.ReactNode => (
<>