Skip to content

Commit 3305d87

Browse files
Merge pull request #201 from makeopensource/redesigned-homepage
#25 Redesigned homepage
2 parents 2847c8f + d65f96a commit 3305d87

14 files changed

Lines changed: 109 additions & 69 deletions

devU-client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"build-local": "cross-env NODE_ENV=local webpack --mode=production",
1111
"format": "prettier --write \"src/**/*.{ts,tsx,json,md}\"",
1212
"pre-commit": "lint-staged",
13-
"dev-backend": "docker compose -f ../compose.yml --profile dev-client up -d",
14-
"dev-backend-stop": "docker compose -f ../compose.yml --profile dev-client stop"
13+
"dev-backend": "docker compose -f ../docker-compose.yml --profile dev-client up -d",
14+
"dev-backend-stop": "docker compose -f ../docker-compose.yml --profile dev-client stop"
1515
},
1616
"lint-staged": {
1717
"./**/*.{js,ts,json,md}": [

devU-client/src/assets/global.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
button.btnPrimary {
3434
@extend .btn;
3535
background-color: var(--primary);
36+
border: 3px solid var(--primary);
3637
color: #fff; // primary button always white text
3738
}
3839

@@ -148,6 +149,8 @@
148149
--btn-secondary-background: var(--purple-darker);
149150
--btn-secondary-text: #FFF;
150151

152+
--btn-text-color: var(--purple-lighter)
153+
151154
--btn-delete-border: var(--red-lighter);
152155
--btn-delete-background: var(--red);
153156
--btn-delete-text: #FFF;

devU-client/src/assets/variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ $medium: 1000px;
6666
$small: 600px;
6767
$extreme: 780px;
6868

69-
$pagePadding: 50px;
69+
$pagePadding: 100px;
7070

7171
@mixin ellipsis {
7272
overflow: hidden;

devU-client/src/components/listItems/simpleAssignmentListItem.scss

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,43 @@
11
@import 'variables';
22

33
.title {
4-
padding: 10px;
54
display: flex;
6-
flex-direction: row;
7-
border-radius: 0.6rem;
5+
flex-direction: column;
86
justify-content: space-between;
97
transition: background-color 0.2s linear;
108
// color:$primary;
9+
border-bottom: 1px solid #ddd;
1110
color: $text-color;
11+
padding: 10px;
1212
}
1313

1414
.meta {
15-
display: flex;
1615
text-decoration: none;
17-
gap: 1rem;
18-
font-size:12px;
19-
font-weight: 600;
16+
display: flex;
17+
flex-direction: row;
18+
font-size:11px;
19+
flex-wrap: wrap;
20+
color: $text-color-secondary;
21+
font-family: monospace;
22+
font-weight: 500;
2023
}
2124

25+
2226
.subText {
23-
font-size: 12px;
24-
font-weight: 600;
27+
font-size: 18px;
28+
font-weight: 500;
2529
display: grid;
2630
justify-content: space-between;
2731
gap: 1.5rem;
2832
width: 100%;
33+
margin-bottom: 8px;
34+
line-height: 100%
2935
}
3036

3137
.tag {
3238
display: flex;
3339
min-width: 8px;
3440
background-color: $primary;
35-
margin-top: 10px;
3641
}
3742

3843
.container {

devU-client/src/components/listItems/simpleAssignmentListItem.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import ListItemWrapper from 'components/shared/layouts/listItemWrapper'
3-
import {prettyPrintDate} from 'utils/date.utils'
3+
import {wordPrintDate} from 'utils/date.utils'
44
import styles from './simpleAssignmentListItem.scss'
55
import {Assignment} from 'devu-shared-modules'
66

@@ -13,8 +13,11 @@ const SimpleAssignmentListItem = ({assignment}: Props) => (
1313
<ListItemWrapper to={`/course/${assignment.courseId}/assignment/${assignment.id}`} tag={assignment.name}
1414
className={styles.title} tagStyle={styles.tag} containerStyle={styles.container}>
1515
<div className={styles.subText}>{assignment.name}</div>
16-
<div className={styles.subText}>{assignment.categoryName}</div>
17-
<div className={styles.meta}>Due At: {prettyPrintDate(assignment.dueDate)}</div>
16+
<div className={styles.meta}>
17+
<span style={{fontWeight:'700'}}>Due:&nbsp;</span>{wordPrintDate(assignment.dueDate)} | &nbsp;
18+
<span style={{fontWeight:'700'}}>End:&nbsp;</span>{wordPrintDate(assignment.endDate)}
19+
</div>
20+
1821

1922
</ListItemWrapper>
2023
)

devU-client/src/components/listItems/userCourseListItem.scss

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
font-size: 1.2rem;
55
font-weight: 600;
66
margin: 0;
7-
padding: 30px;
7+
padding: 15px 0;
88
/* Add padding to the text inside the name block */
99
background: $primary;
1010
width: 100%;
1111
text-align: center;
1212
color: #FFF;
13-
border-radius: 20px 20px 0 0;
13+
border-radius: 10px 10px 0 0;
1414
box-sizing: border-box;
1515
text-overflow: ellipsis;
1616
overflow-wrap: break-word;
@@ -23,31 +23,34 @@
2323
text-align: center;
2424
flex-grow: 1;
2525
font-size: 12px;
26-
font-weight: 600;
27-
border-radius: 5px;
28-
padding: 30px;
26+
font-weight: 500;
27+
padding: 15px;
28+
font-style: italic;
2929
flex-wrap: wrap;
3030
// color: $primary;
3131
color: $text-color;
3232
text-overflow: ellipsis;
3333
overflow-wrap: break-word;
34+
border-bottom: 1px solid #ddd;
35+
3436
}
3537

3638
.Buttons {
3739
display: flex;
38-
justify-content: space-around;
40+
justify-content: center;
3941
margin-top: auto;
40-
padding: 10px;
42+
padding: 15px;
43+
gap: 20px;
4144
}
4245

43-
.gradebook_button,
44-
.coursepage_button {
46+
.sub_button {
4547
border: 0;
46-
color: $text-color;
48+
color: $primary;
4749
background: none;
4850
font-weight: 600;
49-
margin-left: 15px;
51+
margin: 0 10px;
5052
cursor: pointer;
53+
font-size: 16px;
5154
}
5255

5356
.tag {
@@ -86,10 +89,11 @@
8689

8790
.container {
8891
text-decoration: none;
89-
90-
border-radius: 0.6rem;
91-
margin-bottom: 1rem;
92+
border-radius: 15px;
93+
border: solid 3px $primary;
94+
border-color: $primary;
9295
color: $text-color;
96+
background:none;
9397

9498
}
9599

devU-client/src/components/listItems/userCourseListItem.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react'
22
import { Assignment, Course } from 'devu-shared-modules'
33
import { useHistory } from "react-router-dom";
44
import ListItemWrapper from 'components/shared/layouts/listItemWrapper'
5+
import FaIcon from 'components/shared/icons/faIcon'
56

67
//import {prettyPrintDate} from 'utils/date.utils'
78

@@ -23,20 +24,23 @@ const UserCourseListItem = ({ course, assignments, past = false, instructor = fa
2324
return (
2425
<ListItemWrapper to={null} tag={course.number} containerStyle={styles.container}>
2526

26-
<div className={styles.name}>{instructor ? (course.name + " " + course.number + " (" + course.semester + ")" + " Instructor") : course.name.toUpperCase() + " " + course.number + " " + "(" + course.semester + ")"}</div>
27+
<div className={styles.name}>{instructor ? (course.number + ": " + course.name + " "): course.number + ": " + course.name + " "}
28+
{instructor === true && <FaIcon icon='chalkboardUser'/>}
29+
30+
</div>
2731
<div className={styles.subText}>
2832
{assignments && assignments.length > 0 ? (assignments.map((assignment) => (
2933
<SimpleAssignmentListItem assignment={assignment} key={assignment.id} />
30-
))) : ((past) ? <div></div> : <div className={styles.No_assignments}>No Assignments Due Yet</div>)}
34+
))) : past && <div></div> }
3135
<div className={styles.Buttons}>
32-
<button className={styles.gradebook_button} onClick={(e) => {
33-
e.stopPropagation();
34-
history.push(`/course/${course.id}/gradebook`);
35-
}}>Gradebook</button>
36-
<button className={styles.coursepage_button} onClick={(e) => {
36+
<button className={styles.sub_button} onClick={(e) => {
3737
e.stopPropagation();
3838
history.push(`/course/${course.id}`);
39-
}}>Coursepage</button>
39+
}}>COURSE PAGE</button>
40+
<button className={styles.sub_button} onClick={(e) => {
41+
e.stopPropagation();
42+
history.push(`/course/${course.id}/gradebook`);
43+
}}>GRADEBOOK</button>
4044
</div>
4145
</div>
4246

devU-client/src/components/misc/globalToolbar.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ $font-size: 16px;
2929
font-size: 32px;
3030
text-decoration: none;
3131
color: #FFF;
32-
font-weight: 500;
32+
font-weight: 700;
33+
height: 51px;
3334
}
3435

3536
.bar {

devU-client/src/components/pages/homePage/homePage.scss

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// margin-left: 20px;
88
// font-size: 30px;
99
// font-weight: 550;
10-
margin-bottom: 30px;
10+
margin: 10px 0;
1111
}
1212

1313
// h1 {
@@ -19,16 +19,18 @@
1919
// }
2020

2121

22-
// .no_courses {
23-
// margin-left: 20px;
24-
// }
22+
.no_courses {
23+
font-style: italic;
24+
margin-bottom: 20px;
25+
}
2526

2627

2728

2829
.coursesContainer {
2930
display: flex;
3031
flex-direction: row;
3132
gap: 20px;
33+
margin: 0;
3234
// margin: 20px;
3335
}
3436

@@ -39,11 +41,8 @@
3941
align-items: stretch;
4042
width: 400px;
4143
padding: 0;
42-
background-color: $list-item-background;
43-
border-radius: 20px;
44-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
4544
overflow: hidden;
46-
margin-bottom: 20px;
45+
margin-bottom: 10px;
4746
}
4847

4948
// .create_course {
@@ -56,18 +55,26 @@
5655
// transition: background-color 0.3s ease;
5756
// margin: 20px
5857
// }
59-
58+
.courses_title{
59+
margin: 0;
60+
width: fit-content;
61+
align-self: center;
62+
grid-column-start: 2;
63+
}
6064
.header {
6165
color: $text-color;
62-
display: block;
63-
align-items: center;
66+
display: grid;
67+
grid-template-columns: 1fr 1fr 1fr;
68+
justify-items: center;
69+
padding: 20px;
6470
}
65-
66-
#createCourseBtn {
67-
display: block;
71+
.buttonContainer{
72+
display: flex;
73+
gap: 20px;
6874
margin-left: auto;
6975
}
7076

77+
7178
// .courses_heading::after {
7279
// content: '';
7380
// display: block;

devU-client/src/components/pages/homePage/homePage.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,22 @@ const HomePage = () => {
7878
<PageWrapper>
7979
<div className={styles.header}>
8080
{/* <div className={styles.smallLine}></div> */}
81-
<h1 className={styles.courses_title}>Courses</h1>
82-
<button className='btnSecondary' id='createCoursBtn' onClick={() => {
83-
history.push(`/addCoursesForm`)
84-
}}>Create Course
85-
</button>
81+
<h1 className={styles.courses_title}>DevU Home</h1>
82+
<div className={styles.buttonContainer}>
83+
<button className='btnSecondary' onClick={() => {
84+
history.push(`/addCoursesForm`)
85+
}}>create course
86+
</button>
87+
<button className='btnPrimary' onClick={() => {
88+
history.push(`/courses`)
89+
}}>join course
90+
</button>
91+
</div>
8692
{/* <div className={styles.largeLine}></div> */}
8793
</div>
8894
{/* <div className={styles.header}> */}
8995
{/* <div className={styles.smallLine}></div> */}
90-
<h2 className={styles.courses_heading}>Current</h2>
96+
<h2 className={styles.courses_heading}>Current Courses</h2>
9197
{/* <div className={styles.largeLine}></div> */}
9298
{/* </div> */}
9399
<div className={styles.coursesContainer}>
@@ -98,21 +104,19 @@ const HomePage = () => {
98104
instructor={true} />
99105
</div>
100106
))}
101-
</div>
102-
<div className={styles.coursesContainer}>
107+
103108
{enrollCourses && enrollCourses.map((course) => (
104109
<div className={styles.courseCard}
105110
key={course.id}
106111
onClick={() => handleCourseClick(course.id)} style={{ cursor: 'pointer' }}>
107-
108112
<UserCourseListItem course={course} assignments={assignments.get(course)} key={course.id} />
109113
</div>
110114
))}
111-
{enrollCourses.length === 0 && instructorCourses.length == 0 && <h4 className={styles.no_courses}>You do not have current enrollment yet</h4>}
115+
{enrollCourses.length === 0 && instructorCourses.length == 0 && <div className={styles.no_courses}>You do not have current enrollment yet</div>}
112116
</div>
113117
{/* <div className={styles.header}> */}
114118
{/* <div className={styles.smallLine}></div> */}
115-
<h2 className={styles.courses_heading}>Completed</h2>
119+
<h2 className={styles.courses_heading}>Completed Courses</h2>
116120
{/* <div className={styles.largeLine}></div> */}
117121
{/* </div> */}
118122
<div className={styles.coursesContainer}>
@@ -127,12 +131,12 @@ const HomePage = () => {
127131
/>
128132
</div>
129133
))}
130-
{pastCourses.length === 0 && <h4 className={styles.no_courses}>No completed courses</h4>}
134+
{pastCourses.length === 0 && <div className={styles.no_courses}>No completed courses</div>}
131135
</div>
132136

133137
{/* <div className={styles.header}> */}
134138
{/* <div className={styles.smallLine}></div> */}
135-
<h2 className={styles.courses_heading}>Upcoming</h2>
139+
<h2 className={styles.courses_heading}>Upcoming Courses</h2>
136140
{/* <div className={styles.largeLine}></div> */}
137141
{/* </div> */}
138142

@@ -144,7 +148,7 @@ const HomePage = () => {
144148
</div>
145149
))}
146150

147-
{upcomingCourses.length === 0 && <h4 className={styles.no_courses}>No upcoming Courses</h4>}
151+
{upcomingCourses.length === 0 && <div className={styles.no_courses}>No upcoming courses</div>}
148152
</div>
149153

150154

0 commit comments

Comments
 (0)