MenuContainer.js 554 Bytes
import React from "react";
import { withRouter } from "react-router-dom";
import { useMutation } from "@apollo/react-hooks";
import { gql } from "apollo-boost";
import MenuPresenter from "./MenuPresenter";

const LOG_OUT = gql`
  mutation logUserOut {
    logUserOut @client
  }
`;

export default withRouter(({ match, location, history, chName }) => {
  const [logOut] = useMutation(LOG_OUT);
  return (
    <MenuPresenter
      logOut={logOut}
      match={match}
      location={location}
      history={history}
      chName={chName}
    />
  );
});