How to use the contexts.useChatContext function in contexts

To help you get started, we’ve selected a few contexts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mikey1384 / twinkle-network / source / containers / App / index.js View on Github external
const {
    user: {
      actions: { onCloseSigninModal, onInitSession, onLogout }
    },
    requestHelpers: { auth, initSession, uploadFileOnChat }
  } = useAppContext();
  const { signinModalShown, username } = useMyState();
  const {
    actions: {
      onPostFileUploadStatus,
      onPostUploadComplete,
      onResetChat,
      onSendFirstDirectMessage,
      onUpdateClientToApiServerProgress
    }
  } = useChatContext();
  const {
    actions: { onInitContent }
  } = useContentContext();
  const {
    state: { updateDetail, updateNoticeShown }
  } = useNotiContext();
  const {
    state: { pageVisible },
    actions: { onChangePageVisibility }
  } = useViewContext();
  const [mobileMenuShown, setMobileMenuShown] = useState(false);
  const visibilityChangeRef = useRef(null);
  const hiddenRef = useRef(null);
  const authRef = useRef(null);
  const mounted = useRef(true);
github mikey1384 / twinkle-network / source / containers / Chat / index.js View on Github external
onCreateNewChannel,
      onEnterChannelWithId,
      onEnterEmptyChat,
      onLoadMoreChannels,
      onLoadMoreMessages,
      onNotifyThatMemberLeftChannel,
      onOpenDirectMessageChannel,
      onReceiveMessage,
      onReceiveMessageOnDifferentChannel,
      onSendFirstDirectMessage,
      onSetReplyTarget,
      onSubmitMessage,
      onUpdateChessMoveViewTimeStamp,
      onUpdateSelectedChannelId
    }
  } = useChatContext();
  const {
    state: { pageVisible }
  } = useViewContext();
  const [
    currentChannelOnlineMembers,
    setCurrentChannelOnlineMembers
  ] = useState([]);
  const [createNewChannelModalShown, setCreateNewChannelModalShown] = useState(
    false
  );
  const [userListModalShown, setUserListModalShown] = useState(false);
  const [chessModalShown, setChessModalShown] = useState(false);
  const [chessCountdownObj, setChessCountdownObj] = useState({});
  const [channelName, setChannelName] = useState('');
  const [partner, setPartner] = useState(null);
  const [creatingNewDMChannel, setCreatingNewDMChannel] = useState(false);
github mikey1384 / twinkle-network / source / containers / Chat / index.js View on Github external
onClearNumUnreads,
      onCreateNewChannel,
      onEnterChannelWithId,
      onEnterEmptyChat,
      onLoadMoreChannels,
      onLoadMoreMessages,
      onNotifyThatMemberLeftChannel,
      onOpenDirectMessageChannel,
      onReceiveMessage,
      onReceiveMessageOnDifferentChannel,
      onSendFirstDirectMessage,
      onSubmitMessage,
      onUpdateChessMoveViewTimeStamp,
      onUpdateSelectedChannelId
    }
  } = useChatContext();
  const {
    state: { pageVisible }
  } = useViewContext();
  const [channelLoading, setChannelLoading] = useState(false);
  const [
    currentChannelOnlineMembers,
    setCurrentChannelOnlineMembers
  ] = useState([]);
  const [createNewChannelModalShown, setCreateNewChannelModalShown] = useState(
    false
  );
  const [userListModalShown, setUserListModalShown] = useState(false);
  const [chessModalShown, setChessModalShown] = useState(false);
  const [chessCountdownObj, setChessCountdownObj] = useState({});
  const [channelName, setChannelName] = useState('');
  const [partner, setPartner] = useState(null);
github mikey1384 / twinkle-network / source / containers / Chat / Message / index.js View on Github external
onSetActualDescription,
      onSetActualTitle,
      onSetSiteUrl,
      onSetThumbUrl
    }
  } = useContentContext();
  const {
    state: { reconnecting },
    actions: {
      onEditMessage,
      onSaveMessage,
      onSetReplyTarget,
      onUpdateChessMoveViewTimeStamp,
      onUpdateRecentChessMessage
    }
  } = useChatContext();
  const {
    state: { socketConnected }
  } = useNotiContext();
  let { username, profilePicId, targetMessage, ...post } = message;
  const [extractedUrl, setExtractedUrl] = useState('');
  const [onEdit, setOnEdit] = useState(false);
  const [editPadding, setEditPadding] = useState(false);
  const [spoilerOff, setSpoilerOff] = useState(false);
  if (fileToUpload && !userId) {
    userId = myId;
    username = myUsername;
    profilePicId = myProfilePicId;
  }
  useEffect(() => {
    if (!message.id && message.isChessMsg) {
      onUpdateRecentChessMessage(message);

contexts

ISC
Latest version published 8 years ago

Package Health Score

40 / 100
Full package analysis