import React, { useState } from "react"; import { useParams } from "react-router-dom"; import NavBar from "./shared/NavBar"; import NavBarUser from "./shared/NavBarUser"; import config from "../config"; import { Button, Card, CardContent, CardMedia, Chip, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, IconButton, TextField, Typography } from "@material-ui/core"; import { Autocomplete } from "@material-ui/lab"; import { Add } from "@material-ui/icons"; import feeds from "./dummyData/feeds.json"; import allCategories from "./dummyData/categories.json"; const feedCategories = Array.from(new Set(feeds.map(i => i.tags).flat())); function User() { const { username } = useParams(); const [ interests, setInterests ] = useState(feedCategories); const [ newInterests, setNewInterests ] = useState([]); const [ openDialog, setOpenDialog ] = useState(false); // TODO: Grab these values from the API const name = "Ceda EI"; const about = "I am a 20-year old student from India who has an interest in system administration and programming. I am a Linux user who likes to rice his desktop and have some experience managing servers."; function handleOpen() { setOpenDialog(true); } function handleClose() { setNewInterests([]); setOpenDialog(false); } function handleAdd() { setInterests([...interests, ...newInterests]); handleClose(); } return (<>
{name} @{username}
About Me {about}
Interests
{interests.map((tag, idx) => )}
Add Interests Add interests to follow here. ( )} value={newInterests} onChange={(_, e) => setNewInterests(e)} /> ); } export default User;