Skip to content

Commit b73a0e4

Browse files
AnthonytorreroAnthonytorrero
authored andcommitted
comments done with styling. Before pushing to master
1 parent 370d542 commit b73a0e4

File tree

5 files changed

+21
-52
lines changed

5 files changed

+21
-52
lines changed

app/src/Dashboard/FormsContainer.tsx

Lines changed: 0 additions & 38 deletions
This file was deleted.

app/src/Dashboard/Project.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, } from 'react';
1+
import React, { useState } from 'react';
22
import { useMutation } from '@apollo/client';
33
import {
44
ADD_LIKE,
@@ -10,6 +10,9 @@ import {
1010
import { withStyles, createStyles, makeStyles, Theme } from '@material-ui/core/styles';
1111
import CloseIcon from '@material-ui/icons/Close';
1212
import AddCommentIcon from '@material-ui/icons/AddComment';
13+
14+
import Button from '@material-ui/core/Button';
15+
1316
import FavoriteBorderIcon from '@material-ui/icons/FavoriteBorder';
1417
import FavoriteIcon from '@material-ui/icons/Favorite';
1518
import StarIcon from '@material-ui/icons/Star';
@@ -102,6 +105,7 @@ const Project = ({
102105
publishProject(myVar);
103106
}
104107

108+
105109
//Adds the comment to the project
106110
function handleComment(e) {
107111
e.preventDefault();
@@ -116,13 +120,15 @@ const Project = ({
116120
addComment(myVar)
117121
}
118122

123+
119124
//sets state of commentVal to what the user types in to comment
120125
function handleChange(e) {
121126
e.preventDefault();
122127
let commentValue = e.target.value;
123128
setCommentVal(commentValue);
124129
}
125130

131+
126132
const recentComments = [];
127133
if (comments.length > 0) {
128134
const reversedCommentArray = comments.slice(0).reverse();
@@ -136,13 +142,11 @@ const Project = ({
136142
)}
137143
}
138144

139-
// ---Clear canvas functionality---
140145
// Closes out the open modal
141146
const closeModal = () => setModal('');
142147

143-
// Creates modal that asks if user wants to clear workspace
144-
// If user clears their workspace, then their components are removed from state and the modal is closed
145-
const clearWorkspace = () => {
148+
// Creates modal that asks if user wants to delete project
149+
const deleteProjectModal = () => {
146150
//Deletes project from the database
147151
const handleDelete = (e) => {
148152
e.preventDefault();
@@ -196,7 +200,7 @@ const Project = ({
196200
<div className = 'project'>
197201
<div className = 'header'>
198202
{ currUsername === username ?
199-
<IconButton tooltip = "Delete Project" onClick={ clearWorkspace } style={{position: 'absolute', right: '0'}}>
203+
<IconButton tooltip = "Delete Project" onClick={ deleteProjectModal } style={{position: 'absolute', right: '0'}}>
200204
<CloseIcon/>
201205
</IconButton>
202206
: '' }
@@ -228,8 +232,8 @@ const Project = ({
228232
{recentComments}
229233
</div>
230234
<div className = 'commentInput'>
231-
<input type="text" placeholder="Add Comment" onChange={ handleChange }></input>
232-
<AddCommentIcon className='commentBtn' fontSize='Large' onClick={ handleComment } style={{position: 'absolute', right: '0', top: '10px'}}/>
235+
<input type="text" placeholder="Add Comment" className="commentField" onChange={ handleChange }></input>
236+
<AddCommentIcon className='commentBtn' fontSize='Large' onClick={ handleComment } style={{position: 'absolute', right: '8', top: '13'}}/>
233237
</div>
234238
{modal}
235239
</div>

app/src/Dashboard/styles.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,20 @@ $button-blue: #24BCFF; */
9696
}
9797

9898
.header {
99-
background-color: #0CBABA;
99+
background-color: #186BB4;
100100
color: rgba(255, 255, 255, 0.897);
101-
opacity: 0.6;
102101
width: 100%;
103102
position: relative;
104103
}
105104

105+
.commentField {
106+
border: 1px solid #f0f0f0;
107+
padding-left: 2%;
108+
}
106109

110+
h1 {
111+
text-align: center;
112+
}
107113
/* .projectContainer {
108114
display: flex;
109115
flex-direction: row;

app/src/containers/RightContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ const RightContainer = ({isThemeLight}): JSX.Element => {
261261
<ListItem
262262
key={'not delete'}
263263
button
264-
onClick={closeModal}
264+
onClick={closeModal}ƒ
265265
style={{
266266
border: '1px solid #3f51b5',
267267
marginBottom: '2%',

server/graphQL/resolvers/mutation.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ const Project = {
133133
targetProject.comments.push(newCommentDoc._id);
134134
// updating the target Projects document in the database
135135
const updatedProj = await Projects.findOneAndUpdate(filter, targetProject, options);
136-
console.log('username => ', username)
137-
console.log('projId ===> ', projId)
138-
console.log('comment ==> ', comment);
139136
if (updatedProj) {
140137
return ({
141138
name: updatedProj.name,

0 commit comments

Comments
 (0)