Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
944
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const DashboardContainer = () => {
  2.   const { state } = useContext(SpotifyDataContext);
  3.   const windowWidth = useWindowSize();
  4.  
  5.   return (
  6.     <Dashboard>
  7.       <Header />
  8.       <div className="body" id="body">
  9.         {windowWidth.width > 900 ? <Sidebar /> : null}
  10.  
  11.         <ContentWrapper>
  12.           <TimerangeBar></TimerangeBar>
  13.           {windowWidth.width < 900 ? <MobileSidebar /> : null}
  14.  
  15.           {/* This KEY seems like a hack. However i didn't manage to find another way.*/}
  16.           <Content type={state.type} timeperiod={state.timeperiod} key={state.type} />
  17.         </ContentWrapper>
  18.       </div>
  19.     </Dashboard>
  20.   );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement