import React, { useState } from 'react' import _ from 'lodash' import Container from '@material-ui/core/Container' import Grid from '@material-ui/core/Grid' import Tabs from '@material-ui/core/Tabs' import Tab from '@material-ui/core/Tab' import Box from '@material-ui/core/Box' import Typography from '@material-ui/core/Typography' import Chip from '@material-ui/core/Chip' import Paper from '@material-ui/core/Paper'; import { makeStyles } from '@material-ui/core/styles' import useAuth from '@wasp/auth/useAuth.js' import { useQuery } from '@wasp/queries' import getTags from '@wasp/queries/getTags' import getFollowedArticles from '@wasp/queries/getFollowedArticles' import getAllArticles from '@wasp/queries/getAllArticles' import Navbar from './Navbar' import ArticleListPaginated from './article/components/ArticleListPaginated' import addWaspSourceHeader from './addWaspSourceHeader' const MainPage = () => { const { data: me } = useAuth() return ( ) } const useStylesFeedTabs = makeStyles((theme) => ({ root: { marginBottom: theme.spacing(2), }, })) const FeedTabs = ({ me }) => { const classes = useStylesFeedTabs() const [value, setValue] = useState(1); const handleChange = (event, newValue) => setValue(newValue) return ( <> { me && ( ({ skip, take })} pageSize={5} /> )} ({ skip, take })} pageSize={5} /> ) } function TabPanel(props) { const { children, value, index, ...other } = props return ( ) } const useStylesTags = makeStyles((theme) => ({ root: { padding: theme.spacing(0.5), margin: 0, }, chip: { margin: theme.spacing(0.5), }, title: { marginLeft: theme.spacing(0.5) } })) const Tags = () => { const classes = useStylesTags() const { data: tags } = useQuery(getTags) if (!tags) return null const popularTags = _.take(_.sortBy(tags, [t => -1 * t.numArticles]), 10) return ( Popular tags { popularTags.map(tag => ( ))} ) } export default addWaspSourceHeader(MainPage)