Skip to content

Commit fce1af9

Browse files
committed
make projectContainer scrollable
1 parent 849a027 commit fce1af9

File tree

2 files changed

+52
-65
lines changed

2 files changed

+52
-65
lines changed

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,17 +194,18 @@ 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
<h2>Project: { name }</h2>
205205
<h3>Author: { username }</h3>
206206
<h3>Likes: { likes }</h3>
207207
</div>
208+
208209
<div className = "icons">
209210
<IconButton tooltip="Like Template" style={noPointer} onClick = { handleLike }>
210211
{clicked ? <StarIcon fontSize='Large' style={{color:'#FFD700'}}/> : <StarBorderIcon fontSize='Large' style={{color:'#FFD700'}}/>}
@@ -213,29 +214,22 @@ const Project = ({
213214
<IconButton tooltip ="Download Template" style={noPointer} onClick={ handleDownload }>
214215
<GetAppIcon fontSize="large" className="download"/>
215216
</IconButton>
216-
: '' }
217+
: '' }
217218
{ currUsername === username ?
218219
<IconButton tooltip ="Publish Template" style={noPointer} onClick={ handlePublish }>
219220
<PublishIcon fontSize="large"/>
220221
</IconButton>
221222
: '' }
222223
</div>
223224
</div>
224-
<hr/>
225-
{ published ?
226-
<div className = "commentArea">
225+
<div className = "commentContainer">
227226
{recentComments}
228-
<br/>
229-
<div className = 'comments'>
230-
<span>
231-
<input type="text" placeholder="Add Comment" onChange={ handleChange } className = "commentBox"></input>
232-
<AddCommentIcon fontSize='Large' onClick={ handleComment } style={{top: '22%', right: '5%', position: 'absolute', paddingTop: '2%', paddingBottom:
233-
'2%'}}/>
234-
</span>
235-
</div>
236227
</div>
237-
: '' }
238-
{modal}
228+
<div className = 'commentInput'>
229+
<input type="text" placeholder="Add Comment" onChange={ handleChange }></input>
230+
<AddCommentIcon className='commentBtn' fontSize='Large' onClick={ handleComment } style={{position: 'absolute', right: '0', top: '10px'}}/>
231+
</div>
232+
{modal}
239233
</div>
240234
);
241235
};

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 , .projectContainer{
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.7;
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+
} */

0 commit comments

Comments
 (0)