From 1306c1654af028d9d05276111082db9ee8c7f463 Mon Sep 17 00:00:00 2001 From: Leon Liang Date: Fri, 27 Sep 2019 19:35:33 -0400 Subject: [PATCH] restructure files --- .../src/components/layout/NavBar.js | 31 +++++++++++ .../src/components/profile/StaticProfile.js | 0 .../src/components/topic/ChipsArray.js | 52 +++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 twistter-frontend/src/components/layout/NavBar.js create mode 100644 twistter-frontend/src/components/profile/StaticProfile.js create mode 100644 twistter-frontend/src/components/topic/ChipsArray.js diff --git a/twistter-frontend/src/components/layout/NavBar.js b/twistter-frontend/src/components/layout/NavBar.js new file mode 100644 index 0000000..9a7d6eb --- /dev/null +++ b/twistter-frontend/src/components/layout/NavBar.js @@ -0,0 +1,31 @@ +/* eslint-disable */ +import React, { Component } from 'react'; +import { Link } from 'react-router-dom'; +import AppBar from '@material-ui/core/AppBar'; +import ToolBar from '@material-ui/core/Toolbar'; +import Button from '@material-ui/core/Button'; + +export class Navbar extends Component { + render() { + return ( + + + + + + + + + ) + } +} + +export default Navbar; diff --git a/twistter-frontend/src/components/profile/StaticProfile.js b/twistter-frontend/src/components/profile/StaticProfile.js new file mode 100644 index 0000000..e69de29 diff --git a/twistter-frontend/src/components/topic/ChipsArray.js b/twistter-frontend/src/components/topic/ChipsArray.js new file mode 100644 index 0000000..a99afd1 --- /dev/null +++ b/twistter-frontend/src/components/topic/ChipsArray.js @@ -0,0 +1,52 @@ +import React from 'react'; +import { makeStyles } from '@material-ui/core/styles'; +import Chip from '@material-ui/core/Chip'; +import Paper from '@material-ui/core/Paper'; + +const useStyles = makeStyles(theme => ({ + root: { + display: 'flex', + justifyContent: 'center', + flexWrap: 'wrap', + padding: theme.spacing(0.5), + }, + chip: { + margin: theme.spacing(0.5), + }, +})); + +export default function ChipsArray() { + const classes = useStyles(); + const [chipData, setChipData] = React.useState([ + { key: 0, label: 'Angular' }, + { key: 1, label: 'jQuery' }, + { key: 2, label: 'Polymer' }, + { key: 3, label: 'React' }, + { key: 4, label: 'Vue.js' }, + ]); + + const handleDelete = chipToDelete => () => { + if (chipToDelete.label === 'React') { + alert('Why would you want to delete React?! :)'); + return; + } + + setChipData(chips => chips.filter(chip => chip.key !== chipToDelete.key)); + }; + + return ( + + {chipData.map(data => { + + return ( + + ); + })} + + ); +} \ No newline at end of file