Code Monkey home page Code Monkey logo

project_2's People

Contributors

annieburns avatar

Watchers

 avatar

project_2's Issues

HandlePublish issue

https://github.com/annieburns/Project_2

Embarrassed to ask for help again but having trouble publishing a 'plot' (user input on a form) to the db. Please let me know if you have a few minutes to help solve this.

Easier to review in person but I am on the plot.jsx file, the below code results in an error saying this.props.HandlePublish is not a function.

Any input greatly appreciated!

import React, { Component } from 'react';
import { withRouter, Link } from 'react-router';
import firebase from '../../firebase.config.js';

const propTypes = {
message: React.PropTypes.string.isRequired,
};

class Plot extends React.Component {
constructor(props) {
super(props);
this.state = {
plots: [],
};

this.handleSubmit = this.handleSubmit.bind(this);
this.isSaved = this.isSaved.bind(this);
this.handlePublish = this.handlePublish.bind(this);

}

httpUpdatePlot({ id, plot, comments }) {
request.patch(url)
.send({ plot, comments })
.then(() => {
this.httpGetPlots();
});
}
httpPublishPlot({ id, plot, comments }) {
request.plot(url)
.send({ plot, comments })
.then(() => {
this.httpGetPlots();
});
}

handlePublish({ id, plot, comments }) {
if (id) {
this.httpUpdatePlot({ id, plot, comments });
} else {
this.httpPublishPlot({ plot, comments });
}
}

handleSubmit(e) {
e.preventDefault();
this.props.handlePublish({
id: this.props.id,
comments: this.state.localcomments,
plot: this.state.localplot,
});
this.setState({ saved: true });
}

isSaved() {
return this.props.comments === this.state.localcomments &&
this.props.plot === this.state.localplot;
}
render() {
let activeButtons;
if (this.isSaved()) {
activeButtons = (


);
}
return (
<div className={this.isSaved() ? 'saved' : 'not-saved'} >





{activeButtons}

);
}
}

Plot.propTypes = propTypes;

export default Plot;

Delete Function

Hi David,

If you have time this morning I am having a ton of issues getting my plots to delete. I referred to Andrews lessons and searched Google but have no luck. Any help here would be beyond greatly appreciated.

Please advise, thank you!

-Annie

After the Auth Barrier

https://github.com/annieburns/Project_2

Hi David,

Do you have a couple minutes today to meet with me? Basically I am stuck on how best to proceed after the userAuth barrier and the user is on their home screen (aka Dashboard). I have been trying to add one simple component (a button) to this home screen to allow the user to 'add a plot' but so far nothing has worked. Any input would be greatly appreciated as the answer to this would help me get moving on the rest of the basic CRUD components.

I'm on slack, let me know. Thank you!

-Annie

Project 2_Initial Submission

Definitely did not get as far as I wanted to BUT I learned a lot thus far in creating this and cannot wait to finish this.

Thank you for all your help, truly learned a lot!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.