Fixing more errors

This commit is contained in:
Clayton Wilson 2019-12-03 20:54:54 -05:00
parent 7fd976d4cb
commit fd1718a1f4
5 changed files with 17 additions and 16 deletions

View File

@ -43,5 +43,5 @@
"last 1 safari version" "last 1 safari version"
] ]
}, },
"proxy": "http://localhost:5006/twistter-e4649/us-central1/api" "proxy": "http://localhost:5001/twistter-e4649/us-central1/api"
} }

View File

@ -5,7 +5,7 @@ import axios from "axios";
// Material-UI // Material-UI
import TextField from '@material-ui/core/TextField'; import TextField from '@material-ui/core/TextField';
import Typography from '@material-ui/core/Typography'; // import Typography from '@material-ui/core/Typography';
import Button from '@material-ui/core/Button'; import Button from '@material-ui/core/Button';
import withStyles from "@material-ui/styles/withStyles"; import withStyles from "@material-ui/styles/withStyles";

View File

@ -86,7 +86,7 @@ class Home extends Component {
); );
return ( return (
authenticated ? authenticated ? (
<Grid container> <Grid container>
<Grid item sm={4} xs={8}> <Grid item sm={4} xs={8}>
<Writing_Microblogs /> <Writing_Microblogs />
@ -122,7 +122,7 @@ class Home extends Component {
</form> </form>
</div> </div>
</div> </div>
); ));
} }
} }
@ -343,7 +343,7 @@ const mapStateToProps = (state) => ({
Home.propTypes = { Home.propTypes = {
user: PropTypes.object.isRequired, user: PropTypes.object.isRequired,
clases: PropTypes.object.isRequired, classes: PropTypes.object.isRequired,
UI: PropTypes.object.isRequired UI: PropTypes.object.isRequired
} }

View File

@ -1,6 +1,7 @@
import React, { Component } from "react"; import React, { Component } from "react";
// import props // import props
import { TextField, Button } from "@material-ui/core"; // import { TextField, Button } from "@material-ui/core";
import TextField from "@material-ui/core/TextField"
import Grid from "@material-ui/core/Grid"; import Grid from "@material-ui/core/Grid";
import axios from "axios"; import axios from "axios";
import Fuse from "fuse.js"; import Fuse from "fuse.js";
@ -38,7 +39,7 @@ export class Search extends Component {
handles: res.data, handles: res.data,
loading: false loading: false
}, () => { }, () => {
console.log(res.data); // console.log(res.data);
fuse = new Fuse(this.state.handles, fuseOptions); // "list" is the item array fuse = new Fuse(this.state.handles, fuseOptions); // "list" is the item array
}) })
}) })
@ -65,7 +66,7 @@ export class Search extends Component {
let result = fuse.search(event.target.value); let result = fuse.search(event.target.value);
let parsed = []; let parsed = [];
result.forEach((res) => { result.forEach((res) => {
console.log(res) // console.log(res)
parsed.push(this.state.handles[res]) parsed.push(this.state.handles[res])
}) })
this.setState({ this.setState({
@ -80,7 +81,7 @@ export class Search extends Component {
render() { render() {
let resultMarkup = this.state.searchResult && this.state.searchResult !== "No Results" ? ( let resultMarkup = this.state.searchResult && this.state.searchResult !== "No Results" ? (
this.state.searchResult.map(res => this.state.searchResult.map(res =>
<Router> <Router key={res}>
<div> <div>
<a href={`/user/${res}`}> <a href={`/user/${res}`}>
{res} {res}

View File

@ -76,7 +76,7 @@ class user extends Component {
profile: null, profile: null,
imageUrl: null, imageUrl: null,
topics: null, topics: null,
newTopic: null newTopic: ""
}; };
} }
@ -179,7 +179,7 @@ class user extends Component {
topic => ( topic => (
<MyChip <MyChip
label={topic} label={topic}
key={topic.id} key={topic}
onDelete={key => this.handleDelete(topic)} onDelete={key => this.handleDelete(topic)}
/> />
) // console.log({ topic }.topic.id) ) // console.log({ topic }.topic.id)
@ -206,7 +206,7 @@ class user extends Component {
let postMarkup = this.state.posts ? ( let postMarkup = this.state.posts ? (
this.state.posts.map(post => ( this.state.posts.map(post => (
<Card className={classes.card}> <Card className={classes.card} key={post.postId}>
<CardContent> <CardContent>
<Typography> <Typography>
{this.state.imageUrl ? ( {this.state.imageUrl ? (
@ -215,7 +215,7 @@ class user extends Component {
<img src={noImage} height="50" width="50" /> <img src={noImage} height="50" width="50" />
)} )}
</Typography> </Typography>
<Typography variant="h7"> <Typography variant="h6">
<b>{post.userHandle}</b> <b>{post.userHandle}</b>
</Typography> </Typography>
<Typography variant="body2" color={"textSecondary"}> <Typography variant="body2" color={"textSecondary"}>
@ -285,7 +285,7 @@ class user extends Component {
<TextField <TextField
id="newTopic" id="newTopic"
label="new topic" label="new topic"
defaultValue="" // defaultValue=""
margin="normal" margin="normal"
variant="outlined" variant="outlined"
value={this.state.newTopic} value={this.state.newTopic}
@ -295,7 +295,7 @@ class user extends Component {
className={classes.addCircle} className={classes.addCircle}
color="primary" color="primary"
// iconStyle={classes.addCircle} // iconStyle={classes.addCircle}
clickable clickable="true"
onClick={this.handleAddCircle} onClick={this.handleAddCircle}
cursor="pointer" cursor="pointer"
/> />
@ -321,7 +321,7 @@ const mapStateToProps = state => ({
user.propTypes = { user.propTypes = {
user: PropTypes.object.isRequired, user: PropTypes.object.isRequired,
clases: PropTypes.object.isRequired classes: PropTypes.object.isRequired
}; };
export default connect(mapStateToProps)(withStyles(styles)(user)); export default connect(mapStateToProps)(withStyles(styles)(user));