Skip to content

Commit 370d542

Browse files
AnthonytorreroAnthonytorrero
authored andcommitted
after merging khuong's code
2 parents b4e439b + fce1af9 commit 370d542

File tree

4 files changed

+65
-66
lines changed

4 files changed

+65
-66
lines changed

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM node:10.1
2+
WORKDIR /usr/src/app
3+
COPY . /usr/src/app
4+
RUN npm install
5+
RUN npm run prod-build
6+
EXPOSE 5000
7+
CMD npm run server

app/src/Dashboard/Project.tsx

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,16 @@ const Project = ({
144144
// If user clears their workspace, then their components are removed from state and the modal is closed
145145
const clearWorkspace = () => {
146146
//Deletes project from the database
147-
const handleDelete = (e) => {
148-
e.preventDefault();
149-
const myVar = {
150-
variables:
151-
{
152-
projId: id,
153-
},
154-
};
155-
deleteProject(myVar);
156-
}
147+
const handleDelete = (e) => {
148+
e.preventDefault();
149+
const myVar = {
150+
variables:
151+
{
152+
projId: id,
153+
},
154+
};
155+
deleteProject(myVar);
156+
}
157157

158158
// Set modal options
159159
const children = (
@@ -194,19 +194,20 @@ const Project = ({
194194

195195
return (
196196
<div className = 'project'>
197+
<div className = 'header'>
197198
{ currUsername === username ?
198-
<IconButton tooltip = "Delete Project" onClick={ clearWorkspace } style={{position: 'absolute', right: '0', padding: '0'}}>
199+
<IconButton tooltip = "Delete Project" onClick={ clearWorkspace } style={{position: 'absolute', right: '0'}}>
199200
<CloseIcon/>
200201
</IconButton>
201-
: '' }
202-
<div className = 'header'>
202+
: '' }
203203
<div className = 'projectInfo'>
204204
<b>
205205
<h2>Project: { name }</h2>
206206
<h3>Author: { username }</h3>
207207
<h3>Likes: { likes }</h3>
208208
</b>
209209
</div>
210+
210211
<div className = "icons">
211212
<IconButton tooltip="Like Template" style={noPointer} onClick = { handleLike }>
212213
{clicked ? <StarIcon fontSize='Large' style={{color:'#FFD700'}}/> : <StarBorderIcon fontSize='Large' style={{color:'#FFD700'}}/>}
@@ -215,29 +216,22 @@ const Project = ({
215216
<IconButton tooltip ="Download Template" style={noPointer} onClick={ handleDownload }>
216217
<GetAppIcon fontSize="large" className="download"/>
217218
</IconButton>
218-
: '' }
219+
: '' }
219220
{ currUsername === username ?
220221
<IconButton tooltip ="Publish Template" style={noPointer} onClick={ handlePublish }>
221222
<PublishIcon fontSize="large"/>
222223
</IconButton>
223224
: '' }
224225
</div>
225226
</div>
226-
<hr/>
227-
{ published ?
228-
<div className = "commentArea">
227+
<div className = "commentContainer">
229228
{recentComments}
230-
<br/>
231-
<div className = 'comments'>
232-
<span>
233-
<input type="text" placeholder="Add Comment" onChange={ handleChange } className = "commentBox"></input>
234-
<AddCommentIcon fontSize='Large' onClick={ handleComment } style={{top: '22%', right: '5%', position: 'absolute', paddingTop: '2%', paddingBottom:
235-
'2%'}}/>
236-
</span>
237-
</div>
238229
</div>
239-
: '' }
240-
{modal}
230+
<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'}}/>
233+
</div>
234+
{modal}
241235
</div>
242236
);
243237
};

app/src/Dashboard/styles.css

Lines changed: 31 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,57 +21,49 @@ $button-blue: #24BCFF; */
2121
align-items: center;
2222
height: 40vh;
2323
/* justify-content: min; */
24-
width: 25%;
25-
overflow: scroll;
24+
width: 30%;
25+
/* overflow: scroll; */
2626
}
2727

28-
/* .dashboardContainer {
29-
display: grid;
30-
grid-template: auto / repeat(2, 1fr);
31-
} */
3228

3329
.dashboardContainer {
34-
overflow: scroll;
30+
/* overflow: scroll; */
31+
height: 100%;
3532
}
3633

37-
.formContainer {
34+
.projectContainer{
3835
display: flex;
3936
flex-flow: row wrap;
40-
overflow: scroll;
37+
height: 600px;
38+
overflow-y: scroll;
4139
}
4240

4341
.project {
44-
position: relative;
42+
display: flex;
43+
flex-direction: column;
44+
align-items: stretch;
45+
height: 500px;
46+
width: 400px;
47+
justify-content: space-between;
4548
}
4649

4750
.projectInfo {
4851
text-align: center;
4952
}
5053

51-
.commentArea {
52-
/* position: absolute; */
53-
bottom: 0;
54-
display: inline-block;
55-
width: 100%;
56-
height: 100%;
54+
.commentContainer {
5755
text-align: center;
58-
/* height: 25%; */
59-
overflow: scroll;
60-
overflow-x: hidden;
56+
height: 400px;
57+
overflow-y: scroll;
6158
}
6259

63-
.commentBox {
64-
padding: 5%;
65-
width: 100%;
66-
border: 1px solid transparent;
67-
/* vertical-align: middle; */
68-
}
60+
6961

7062
.commentButton{
7163
/* float: right; */
72-
top: 22%;
64+
/* top: 22%;
7365
right: 5%;
74-
position: absolute;
66+
position: absolute; */
7567
padding-top: 2%;
7668
padding-bottom: 2%;
7769
}
@@ -84,11 +76,16 @@ $button-blue: #24BCFF; */
8476
text-align: center;
8577
}
8678

87-
.comments {
88-
position: absolute;
89-
bottom: 0;
79+
.commentInput {
80+
display: flex;
81+
height: 100px;
9082
width: 100%;
9183
border: 1px solid #f0f0f0;
84+
position: relative;
85+
}
86+
87+
.commentInput > * {
88+
flex: auto;
9289
}
9390

9491
.icons {
@@ -103,18 +100,14 @@ $button-blue: #24BCFF; */
103100
color: rgba(255, 255, 255, 0.897);
104101
opacity: 0.6;
105102
width: 100%;
103+
position: relative;
106104
}
107-
/* .formContainer {
108-
display: flex;
109-
flex-direction: row;
110-
width: 100%;
111-
height: 100%;
112-
}
113105

114-
.projectContainer {
106+
107+
/* .projectContainer {
115108
display: flex;
116109
flex-direction: row;
117110
align-items: center;
118111
justify-content: center;
119112
width: 100%;
120-
} */
113+
} */

server/server.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ const { ApolloServer } = require('apollo-server-express');
22
const express = require('express');
33
const cookieParser = require('cookie-parser');
44

5+
const path = require('path');
56
const cors = require('cors');
6-
const { Book, TitleOutlined } = require('@material-ui/icons');
77
const userController = require('./controllers/userController');
88
const cookieController = require('./controllers/cookieController');
99
const sessionController = require('./controllers/sessionController');
@@ -79,6 +79,11 @@ const server = new ApolloServer({ typeDefs, resolvers });
7979
server.applyMiddleware({ app });
8080
/** ****************************************************************** */
8181

82+
// app.use(express.static(path.resolve(__dirname, '../app/dist')));
83+
84+
app.get('/', (req, res) => {
85+
return res.status(200).sendFile(path.resolve(__dirname, '../app/dist/index-prod.html'));
86+
});
8287

8388
app.post(
8489
'/signup',

0 commit comments

Comments
 (0)