diff --git a/src/Components/Feature.js b/src/Components/Feature.js index b8fc44b..23162ca 100644 --- a/src/Components/Feature.js +++ b/src/Components/Feature.js @@ -19,7 +19,7 @@ const Feature = ({ features, index, setFeatures, editable }) => { updatedFeature.downVoted = false; let newVote = updatedFeature.upVoted ? 1 : (updatedFeature.downVoted ? -1 : 0); updatedFeature.votes = updatedFeature.votes - currentVote + newVote; - setFeatures(features.map((feature) => feature._id === features[index]._id ? updatedFeature : feature)); + setFeatures(features.map((feature) => feature.id === features[index].id ? updatedFeature : feature)); }; const downVote = () => { const updatedFeature = { ...features[index] }; @@ -28,7 +28,7 @@ const Feature = ({ features, index, setFeatures, editable }) => { updatedFeature.upVoted = false; let newVote = updatedFeature.upVoted ? 1 : (updatedFeature.downVoted ? -1 : 0); updatedFeature.votes = updatedFeature.votes - currentVote + newVote; - setFeatures(features.map((feature) => feature._id === features[index]._id ? updatedFeature : feature)); + setFeatures(features.map((feature) => feature.id === features[index].id ? updatedFeature : feature)); }; const capitalizeFirstLetter = (string) => { return string.charAt(0).toUpperCase() + string.slice(1); diff --git a/src/Components/ProjectForm.js b/src/Components/ProjectForm.js index 54afbec..85d277d 100644 --- a/src/Components/ProjectForm.js +++ b/src/Components/ProjectForm.js @@ -2,7 +2,12 @@ import React from 'react'; import { ReactSession } from "react-client-session"; import styled from "styled-components"; import TextField from "@mui/material/TextField"; +import Button from '@mui/material/Button'; import Service from "../Service"; +import FilledInput from '@mui/material/FilledInput'; +import InputAdornment from '@mui/material/InputAdornment'; +import FormControl from '@mui/material/FormControl'; +import { useHistory } from "react-router-dom"; const Styles = styled.div` background: #218888; @@ -12,7 +17,7 @@ const Styles = styled.div` border-bottom: 1px solid white; color: #6f6f6f; font-family: sans-serif; - font-size: 20px; + font-size: 30px; font-weight: 600; line-height: 24px; padding: 10px; @@ -22,12 +27,14 @@ const Styles = styled.div` form { background: white; border: 1px solid #dedede; + border-radius: 30px; display: flex; flex-direction: column; justify-content: space-around; margin: 0 auto; max-width: 1000px; - padding: 50px 200px; + padding: 20px 100px; + padding-bottom: 60px; } input { @@ -45,6 +52,7 @@ const Styles = styled.div` font-size: 14px; font-weight: 500; margin-bottom: 5px; + width: 100%; } .error { @@ -60,6 +68,13 @@ const Styles = styled.div` font-family: sans-serif; font-size: 14px; margin: 20px 0px; + } + + Button{ + background-color: #218888; + } + + `; // @@ -77,6 +92,14 @@ function ProjectForm() { const [message, setMessage] = React.useState(""); const [user, setUser] = React.useState([""]); const [tags, setTags] = React.useState(""); + const [country, setCountry] = React.useState(""); + const [funding, setFunding] = React.useState(""); + + const history=useHistory(); + + const handleRoute = () =>{ + history.push("/dashboard"); + } React.useEffect(() => { setUser(ReactSession.get("username")); @@ -98,11 +121,22 @@ function ProjectForm() { setTags(e.target.value); } + const handleLaunchCountryChange = (e) => { + setCountry(e.target.value); + } + + const handleFundingChange = (e) => { + setFunding(e.target.value); + } + + const handleSubmit = (event) => { const form = new FormData(); form.append("productName", name); form.append("productDescription", description); + form.append("lauchCountry", country); form.append("imageUrl", imageURL); + form.append("initialFunding", imageURL); form.append("email", user); form.append("tags", tags); Service.post("addProduct", form) @@ -114,7 +148,7 @@ function ProjectForm() { } }).catch(function(err){ setMessage("There was a problem submitting your product. Please try again later.") - }); + }); } return ( @@ -129,7 +163,6 @@ function ProjectForm() { +
+
+ + +
+
+ + + $} + multiline + maxRows={1} + /> + +
- - +

+ + {/* */} ); diff --git a/src/Service.js b/src/Service.js index 7517e33..6ed0fc5 100644 --- a/src/Service.js +++ b/src/Service.js @@ -1,5 +1,5 @@ -const baseUrl = "http://localhost:5000/"; - //const baseUrl = "https://damp-citadel-25681.herokuapp.com/" +// const baseUrl = "http://localhost:5000/"; + const baseUrl = "https://damp-citadel-25681.herokuapp.com/" // const requestOptionsBuilder = (method, body, headers) => { // let options = {