This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
import axios, { CancelTokenSource } from "axios"; | |
export default function useCancelToken( | |
identity?: any, | |
): { | |
current: CancelTokenSource; | |
cancelAndRenewal(): void; | |
} { | |
const cancelTokenSource: React.MutableRefObject< |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
import { useDebounce } from "react-use"; | |
import { useActions, useStoreState } from "app/store"; | |
import { searchedUsersSelector, searchedUsersWithoutCurrentUserSelector } from "app/selectors/search"; | |
import useCancelToken from "common/hooks/useCancelToken"; | |
import { | |
ActionCreators, | |
getSearchUsers as getSearchUsersAction, | |
} from "app/actions/user"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CustomTextRenderInput: React.FC<IProps> = ({ | |
readonly, | |
value = "", | |
onChange, | |
}) => { | |
const [currentOriginalContent, setOriginalContent] = React.useState(value); | |
const [currentRenderedContent, setRenderedContent] = React.useState( | |
mentionRender(value, CommonRenderer), | |
); | |
const handleChange = React.useCallback((e: ContentEditableEvent) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import { Router, Switch, Route } from "react-router-dom"; | |
import styled from "styled-components"; | |
import { createBrowserHistory } from "history"; | |
import MenuBar from "./components/menu"; | |
import Home from "./components/home"; | |
import SignIn from "./components/signIn"; | |
import { getAuthToken } from "./helpers/authHelper"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
import { useAuthState } from "../../helpers/authHelper"; | |
import { Redirect } from "react-router"; | |
const SignIn = () => { | |
const [username, setUsername] = React.useState(""); | |
const [password, setPassword] = React.useState(""); | |
const [isSignedIn, setAuth] = useAuthState(); | |
if (isSignedIn) { | |
return <Redirect to="/home" />; |