-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from jzolo22/newUserForm
new user form
- Loading branch information
Showing
6 changed files
with
45 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/index.js":"1","/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/NavBar.js":"2","/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/HomePage.js":"3","/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/redux/actions.js":"4","/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/reportWebVitals.js":"5","/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/TrailShow.js":"6","/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/LoginForm.js":"7","/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/containers/TrailsList.js":"8","/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/Trail.js":"9","/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/SearchForm.js":"10","/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/Profile.js":"11","/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/TrailForm.js":"12"},{"size":866,"mtime":1609951773218,"results":"13","hashOfConfig":"14"},{"size":1753,"mtime":1609971700087,"results":"15","hashOfConfig":"14"},{"size":5274,"mtime":1610062934027,"results":"16","hashOfConfig":"14"},{"size":4338,"mtime":1609951773221,"results":"17","hashOfConfig":"14"},{"size":362,"mtime":1608848533095,"results":"18","hashOfConfig":"14"},{"size":2847,"mtime":1610037007108,"results":"19","hashOfConfig":"14"},{"size":1224,"mtime":1610037561329,"results":"20","hashOfConfig":"14"},{"size":3499,"mtime":1610050376293,"results":"21","hashOfConfig":"14"},{"size":367,"mtime":1610044126424,"results":"22","hashOfConfig":"14"},{"size":1160,"mtime":1610047600221,"results":"23","hashOfConfig":"14"},{"size":7569,"mtime":1610065212668,"results":"24","hashOfConfig":"14"},{"size":2391,"mtime":1610062689055,"results":"25","hashOfConfig":"14"},{"filePath":"26","messages":"27","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"28"},"6dmgbn",{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"31","messages":"32","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"37","messages":"38","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"39"},{"filePath":"40","messages":"41","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"44","messages":"45","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"48","messages":"49","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"50","messages":"51","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/index.js",[],["52","53"],"/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/NavBar.js",[],"/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/HomePage.js",[],"/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/redux/actions.js",[],"/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/reportWebVitals.js",[],"/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/TrailShow.js",["54","55"],"import React from 'react'\nimport { addUserTrail } from '../redux/actions'\nimport {connect} from 'react-redux'\n// import REACT_APP_GOOGLE_API_KEY from '../.env'\n\nclass TrailShow extends React.Component {\n\n state = {\n clicked: false\n }\n\n addUserTrail = () => {\n let date = new Date()\n this.props.addUserTrail({ \n trail_id: this.props.trailObj.id,\n user_id: this.props.user.user.id,\n date: date\n })\n window.alert(\"Trail added to your list!\")\n }\n\n clickDirections = () => {\n this.setState({clicked: !this.state.clicked})\n }\n\n hours = (mins) => {\n let hours = Math.floor(mins / 60) \n let minutes = mins % 60\n if (hours === 1) {\n return `${hours} hour and ${minutes} minutes to complete` \n } else if (minutes === 1) {\n return `${hours} hours and ${minutes} minute to complete` \n } else {\n return `${hours} hours and ${minutes} minutes to complete` \n }\n \n }\n \n render(){\n console.log(this.props)\n return (\n <div className=\"trail-show\">\n <h1>{this.props.trailObj.name}</h1>\n <h2>in {this.props.trailObj.location}</h2>\n <button onClick={this.addUserTrail}>Add To My Trails</button>\n <img src={this.props.trailObj.image_url} alt={this.props.trailObj.name} />\n <h3>Length: {this.props.trailObj.length} miles</h3>\n <h4>{this.hours(this.props.trailObj.duration)} </h4>\n <h3>Difficulty level: {this.props.trailObj.difficulty}</h3>\n\n {this.state.clicked? null :\n <iframe className=\"map\" src={`https://www.google.com/maps/embed/v1/place?key=${process.env.REACT_APP_GOOGLE_API_KEY}&q=${this.props.trailObj.name} ${this.props.trailObj.location}&zoom=8`}> </iframe>\n } \n\n {this.state.clicked? \n <iframe className=\"map\" src={`https://www.google.com/maps/embed/v1/directions?key=${process.env.REACT_APP_GOOGLE_API_KEY}&origin=${this.props.user.user.city}&destination=${this.props.trailObj.name} ${this.props.trailObj.location}&mode=driving&zoom=8`}> \n </iframe>\n : null}\n \n \n <br />\n <button onClick={this.clickDirections}>\n {this.state.clicked ? \"See trail on map\" : \"Get directions\" }\n </button>\n\n\n \n </div>\n )\n }\n}\n\nconst mapStateToProps = (state) => {\n return {user: state.user}\n}\n\nconst mapDispatchToProps = (dispatch) => {\n return {\n addUserTrail: (userTrailObj) => dispatch(addUserTrail(userTrailObj))\n }\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(TrailShow)","/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/LoginForm.js",[],"/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/containers/TrailsList.js",[],"/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/Trail.js",[],"/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/SearchForm.js",["56"],"/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/Profile.js",[],"/Users/juliazolotarev/Documents/Flatiron/assignments/Mod-4/trails-with-friends/trails-with-friends-frontend/src/components/TrailForm.js",[],{"ruleId":"57","replacedBy":"58"},{"ruleId":"59","replacedBy":"60"},{"ruleId":"61","severity":1,"message":"62","line":52,"column":17,"nodeType":"63","endLine":52,"endColumn":206},{"ruleId":"61","severity":1,"message":"62","line":56,"column":21,"nodeType":"63","endLine":56,"endColumn":273},{"ruleId":"64","severity":1,"message":"65","line":2,"column":9,"nodeType":"66","messageId":"67","endLine":2,"endColumn":16},"no-native-reassign",["68"],"no-negated-in-lhs",["69"],"jsx-a11y/iframe-has-title","<iframe> elements must have a unique title property.","JSXOpeningElement","no-unused-vars","'connect' is defined but never used.","Identifier","unusedVar","no-global-assign","no-unsafe-negation"] | ||
[{"/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/index.js":"1","/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/redux/reducer.js":"2","/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/components/HomePage.js":"3","/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/components/LoginForm.js":"4","/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/components/TrailShow.js":"5","/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/components/Trail.js":"6","/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/redux/actions.js":"7","/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/containers/TrailsList.js":"8","/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/components/NavBar.js":"9","/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/components/NewUserForm.js":"10"},{"size":866,"mtime":1609771189093,"results":"11","hashOfConfig":"12"},{"size":1848,"mtime":1609971498512,"results":"13","hashOfConfig":"12"},{"size":5287,"mtime":1610072323109,"results":"14","hashOfConfig":"12"},{"size":1224,"mtime":1610068795788,"results":"15","hashOfConfig":"12"},{"size":2847,"mtime":1610072078579,"results":"16","hashOfConfig":"12"},{"size":367,"mtime":1610068795793,"results":"17","hashOfConfig":"12"},{"size":4338,"mtime":1609899844746,"results":"18","hashOfConfig":"12"},{"size":3499,"mtime":1610068795798,"results":"19","hashOfConfig":"12"},{"size":1753,"mtime":1609970421979,"results":"20","hashOfConfig":"12"},{"size":1957,"mtime":1610070992054,"results":"21","hashOfConfig":"12"},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},"15x815f",{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"27","messages":"28","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"31","messages":"32","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/index.js",[],["43","44"],"/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/redux/reducer.js",[],"/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/components/HomePage.js",[],"/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/components/LoginForm.js",[],"/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/components/TrailShow.js",["45","46"],"/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/components/Trail.js",[],"/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/redux/actions.js",[],"/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/containers/TrailsList.js",[],"/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/components/NavBar.js",[],"/Users/jonathanhakimian/Desktop/Flatiron/Trails_With_Friends/trails-with-friends-frontend/src/components/NewUserForm.js",[],{"ruleId":"47","replacedBy":"48"},{"ruleId":"49","replacedBy":"50"},{"ruleId":"51","severity":1,"message":"52","line":52,"column":17,"nodeType":"53","endLine":52,"endColumn":206},{"ruleId":"51","severity":1,"message":"52","line":56,"column":21,"nodeType":"53","endLine":56,"endColumn":273},"no-native-reassign",["54"],"no-negated-in-lhs",["55"],"jsx-a11y/iframe-has-title","<iframe> elements must have a unique title property.","JSXOpeningElement","no-global-assign","no-unsafe-negation"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters