diff --git a/src/App/Home/Dashboard/Dashboard.js b/src/App/Home/Dashboard/Dashboard.js
index 062e4bc..9dd3611 100644
--- a/src/App/Home/Dashboard/Dashboard.js
+++ b/src/App/Home/Dashboard/Dashboard.js
@@ -1,15 +1,138 @@
-import React from 'react'
+import React, { Component } from 'react'
import { withRouter } from 'react-router-dom'
+import { Button, Input, Form } from 'semantic-ui-react'
+import { createProject } from '../../../graphql/mutations'
+import { Mutation } from "react-apollo";
// Dashboard: Dashboard style setup with some grouping and visualizations
+
+const defaultState = {
+ editing: false,
+}
+
+// Change this buttons on click to trigger a create project.
+
+// TODO: Replace button with "trigger" component
+const CreateProject = ( {title, owners} ) => {
+
+ let input;
+ let editing = false;
+
+ return (
+
+ {(createProject, { data }) => (
+
+
+ )}
+
+
+ /*
+
+ {(createProject, { data }) => (
+
+ */
+ );
+};
+
+
+
+
+
+// Add button that sends "createProject" mutation request on click
+
+// TODO: input Visible true!!!. when input visible is true, render add project input.
+// Stateful component: when you click this button, it will see.
+
+/*
+class MenuAddProject extends Component {
+
+ constructor(props) {
+ super(props)
+ this.state = {
+ inputValue: ''
+ }
+ }
+
+ handleChange(event) {
+ this.setState({value: event.target.value})
+ }
+
+ render() {
+ console.log("hello!");
+ }
+
+ // We dont need a form.
+ render() {
+ return (
+
+ {(createProject, { data }) => (
+
+ )
+ }
+
+ render() {
+ return (
+
+
+ )
+ }
+
+
+}
+
+*/
+
+/*
+const MenuAddProjectButton = () => {
+
+ let editing = false
+
+ return (
+
+
+ )
+}
+*/
+
class Dashboard extends React.Component {
render() {
return (
- Dashboard
+ Dashboard
+
)
}
-
}
+
export default withRouter(Dashboard)
diff --git a/src/App/components/sidebar.js b/src/App/components/sidebar.js
index 3cfe974..75d2f03 100644
--- a/src/App/components/sidebar.js
+++ b/src/App/components/sidebar.js
@@ -1,9 +1,34 @@
import React from 'react'
-import { Sidebar, Segment, Menu, Icon, Divider } from 'semantic-ui-react'
+import { Button, Sidebar, Segment, Menu, Icon, Divider, Input } from 'semantic-ui-react'
import { Link } from 'react-router-dom'
import styled from 'styled-components'
+import { createProject } from '../../graphql/mutations'
import { AnvilSidebar } from '../../utils/anvil'
+
+// Add button that sends "createProject" mutation request on click
+const MenuAddProjectButton = ({createProject}) => {
+
+ const handleRef = (c) => {
+ this.inputRef = c
+ }
+
+ const focus = () => {
+ this.inputRef.focus()
+ }
+
+ let editing = false
+
+ return (
+
+
+ )
+}
class Sidenav extends React.Component {
render() {
return (
@@ -37,6 +62,8 @@ const MenuProjects = ({ projects }) => {
{project.title}
+ {/* console.log('memes')}/>*/}
+
)
})
diff --git a/src/graphql/mutations.js b/src/graphql/mutations.js
index 9c42702..6864904 100644
--- a/src/graphql/mutations.js
+++ b/src/graphql/mutations.js
@@ -18,4 +18,18 @@ const deleteTask = gql`
}
`
-export { updateTask, deleteTask }
\ No newline at end of file
+// createProject(owners: [ID],title: String!): Project
+const createProject = gql`
+ mutation createProject($title: String!) {
+ createProject(title: $title) {
+ id
+
+ owners {
+ id
+ }
+ title
+ }
+ }
+`
+
+export { updateTask, deleteTask, createProject }
\ No newline at end of file