import React, { useState, useEffect } from 'react'; import { Typography, Divider, Grid, Button, Link } from '@material-ui/core/'; import { makeStyles } from '@material-ui/core/styles'; import TrendingUpIcon from '@material-ui/icons/TrendingUp'; import { Rating } from '@material-ui/lab'; import { Feedback } from 'which-types'; import { useNavigate } from '../../hooks/useNavigate'; import { useAuth } from '../../hooks/useAuth'; import { get } from '../../requests'; const useStyles = makeStyles(theme => ({ logo: { width: theme.spacing(20), height: theme.spacing(20) }, score: { fontWeight: 'bold' }, signup: { marginLeft: theme.spacing(2) } })); const HomePage: React.FC = () => { const [feedbacks, setFeedbacks] = useState([]); const classes = useStyles(); const { navigate } = useNavigate(); const { isAuthenticated } = useAuth(); const rating = feedbacks.length && feedbacks.reduce( (acc: number, feedback: Feedback) => acc + feedback.score, 0 ) / feedbacks.length; useEffect(() => { get('/feedback').then(response => { setFeedbacks(response.data); }); }, []); const handleLetsGo = () => { navigate('feed'); }; const handleSignUp = () => { navigate('auth'); }; const GithubLink = GitHub; const TypescriptLink = Typescript; const ReactLink = React; const FeathersLink = Feathers; const MUILink = Material-UI; return ( logo User score: {rating.toFixed(1)} Which one to choose?

Have you ever found yourself stuck between two options, not being able to choose any? This is exactly the problem we are going to solve!

Share your minor everyday uncertainties with the whole world and see what others think!

{!isAuthenticated() && ( )}
About the project

The project is written in {TypescriptLink} and features {ReactLink}, {FeathersLink}, and {MUILink}. It is currently open-source and you can visit our {GithubLink} (make sure to star our repositories)!

We encourage any developer to check it out. Feel free to open issues and create Pull Requests!

All the development process is being tracked on the KanBan board (thanks GitHub). You can always check it to see what is the current state of the project.

); }; export default HomePage;