Skip to content

Commit a9398d1

Browse files
Point Log (#58)
1 parent 9c2b495 commit a9398d1

File tree

8 files changed

+421
-62
lines changed

8 files changed

+421
-62
lines changed

graphql.schema.json

Lines changed: 180 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,69 +10,85 @@
1010
"types": [
1111
{
1212
"kind": "OBJECT",
13-
"name": "Answer",
13+
"name": "Activity",
1414
"description": null,
1515
"fields": [
1616
{
17-
"name": "questionId",
17+
"name": "studentId",
1818
"description": null,
1919
"args": [],
2020
"type": {
21-
"kind": "SCALAR",
22-
"name": "String",
23-
"ofType": null
21+
"kind": "NON_NULL",
22+
"name": null,
23+
"ofType": {
24+
"kind": "SCALAR",
25+
"name": "String",
26+
"ofType": null
27+
}
2428
},
2529
"isDeprecated": false,
2630
"deprecationReason": null
2731
},
2832
{
29-
"name": "pointsAwarded",
33+
"name": "course",
3034
"description": null,
3135
"args": [],
3236
"type": {
33-
"kind": "SCALAR",
34-
"name": "Int",
35-
"ofType": null
37+
"kind": "NON_NULL",
38+
"name": null,
39+
"ofType": {
40+
"kind": "SCALAR",
41+
"name": "String",
42+
"ofType": null
43+
}
3644
},
3745
"isDeprecated": false,
3846
"deprecationReason": null
3947
},
4048
{
41-
"name": "answer",
42-
"description": "Either the id of the chosen answer id or the provided free response",
49+
"name": "note",
50+
"description": null,
4351
"args": [],
4452
"type": {
45-
"kind": "SCALAR",
46-
"name": "String",
47-
"ofType": null
53+
"kind": "NON_NULL",
54+
"name": null,
55+
"ofType": {
56+
"kind": "SCALAR",
57+
"name": "String",
58+
"ofType": null
59+
}
4860
},
4961
"isDeprecated": false,
5062
"deprecationReason": null
5163
},
5264
{
53-
"name": "graded",
65+
"name": "activityDate",
5466
"description": null,
5567
"args": [],
5668
"type": {
5769
"kind": "NON_NULL",
5870
"name": null,
5971
"ofType": {
6072
"kind": "SCALAR",
61-
"name": "Boolean",
73+
"name": "Date",
6274
"ofType": null
6375
}
6476
},
6577
"isDeprecated": false,
6678
"deprecationReason": null
6779
},
6880
{
69-
"name": "teacherComment",
81+
"name": "pointChange",
7082
"description": null,
7183
"args": [],
7284
"type": {
73-
"kind": "SCALAR",
74-
"name": "String",
75-
"ofType": null
85+
"kind": "NON_NULL",
86+
"name": null,
87+
"ofType": {
88+
"kind": "SCALAR",
89+
"name": "Int",
90+
"ofType": null
91+
}
7692
},
7793
"isDeprecated": false,
7894
"deprecationReason": null
@@ -103,6 +119,81 @@
103119
"enumValues": null,
104120
"possibleTypes": null
105121
},
122+
{
123+
"kind": "OBJECT",
124+
"name": "Answer",
125+
"description": null,
126+
"fields": [
127+
{
128+
"name": "questionId",
129+
"description": null,
130+
"args": [],
131+
"type": {
132+
"kind": "SCALAR",
133+
"name": "String",
134+
"ofType": null
135+
},
136+
"isDeprecated": false,
137+
"deprecationReason": null
138+
},
139+
{
140+
"name": "pointsAwarded",
141+
"description": null,
142+
"args": [],
143+
"type": {
144+
"kind": "SCALAR",
145+
"name": "Int",
146+
"ofType": null
147+
},
148+
"isDeprecated": false,
149+
"deprecationReason": null
150+
},
151+
{
152+
"name": "answer",
153+
"description": "Either the id of the chosen answer id or the provided free response",
154+
"args": [],
155+
"type": {
156+
"kind": "SCALAR",
157+
"name": "String",
158+
"ofType": null
159+
},
160+
"isDeprecated": false,
161+
"deprecationReason": null
162+
},
163+
{
164+
"name": "graded",
165+
"description": null,
166+
"args": [],
167+
"type": {
168+
"kind": "NON_NULL",
169+
"name": null,
170+
"ofType": {
171+
"kind": "SCALAR",
172+
"name": "Boolean",
173+
"ofType": null
174+
}
175+
},
176+
"isDeprecated": false,
177+
"deprecationReason": null
178+
},
179+
{
180+
"name": "teacherComment",
181+
"description": null,
182+
"args": [],
183+
"type": {
184+
"kind": "SCALAR",
185+
"name": "String",
186+
"ofType": null
187+
},
188+
"isDeprecated": false,
189+
"deprecationReason": null
190+
}
191+
],
192+
"inputFields": null,
193+
"interfaces": [],
194+
"enumValues": null,
195+
"possibleTypes": null
196+
},
106197
{
107198
"kind": "SCALAR",
108199
"name": "Boolean",
@@ -6471,6 +6562,75 @@
64716562
"isDeprecated": false,
64726563
"deprecationReason": null
64736564
},
6565+
{
6566+
"name": "recentActivity",
6567+
"description": null,
6568+
"args": [
6569+
{
6570+
"name": "course",
6571+
"description": null,
6572+
"type": {
6573+
"kind": "NON_NULL",
6574+
"name": null,
6575+
"ofType": {
6576+
"kind": "SCALAR",
6577+
"name": "String",
6578+
"ofType": null
6579+
}
6580+
},
6581+
"defaultValue": null,
6582+
"isDeprecated": false,
6583+
"deprecationReason": null
6584+
},
6585+
{
6586+
"name": "student",
6587+
"description": null,
6588+
"type": {
6589+
"kind": "SCALAR",
6590+
"name": "String",
6591+
"ofType": null
6592+
},
6593+
"defaultValue": null,
6594+
"isDeprecated": false,
6595+
"deprecationReason": null
6596+
},
6597+
{
6598+
"name": "fetch",
6599+
"description": null,
6600+
"type": {
6601+
"kind": "NON_NULL",
6602+
"name": null,
6603+
"ofType": {
6604+
"kind": "SCALAR",
6605+
"name": "Int",
6606+
"ofType": null
6607+
}
6608+
},
6609+
"defaultValue": null,
6610+
"isDeprecated": false,
6611+
"deprecationReason": null
6612+
}
6613+
],
6614+
"type": {
6615+
"kind": "NON_NULL",
6616+
"name": null,
6617+
"ofType": {
6618+
"kind": "LIST",
6619+
"name": null,
6620+
"ofType": {
6621+
"kind": "NON_NULL",
6622+
"name": null,
6623+
"ofType": {
6624+
"kind": "OBJECT",
6625+
"name": "Activity",
6626+
"ofType": null
6627+
}
6628+
}
6629+
}
6630+
},
6631+
"isDeprecated": false,
6632+
"deprecationReason": null
6633+
},
64746634
{
64756635
"name": "unfulfilledPurchases",
64766636
"description": null,

src/Components/MarketHome/ListingCard.scss

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,29 @@
22
margin-left: 18px;
33
}
44

5+
.student-activity {
6+
margin: 15px;
7+
.student-activity-note {
8+
font-weight: 600;
9+
}
10+
.student-activity-date {
11+
font-weight: 650;
12+
}
13+
14+
.student-activity-point-change {
15+
font-size: 22px;
16+
}
17+
}
18+
519
.student-market-home {
620
background-color: #e3f2fd !important;
721
.student-welcome {
8-
margin-left: 0.6em;
22+
margin-top: .6em;
23+
margin-left: 1em;
924
color: #4274f3;
1025
display: flex;
1126
justify-content: left;
12-
width: 75%;
27+
width: 100%;
1328
}
1429

1530
.student-listing-header {
@@ -31,7 +46,7 @@
3146
}
3247

3348
.student-balance {
34-
font-size: 5em;
49+
font-size: 4em;
3550
font-weight: bolder;
3651
}
3752

@@ -51,7 +66,7 @@
5166
border-radius: 12px;
5267
overflow: auto;
5368
background: #4274f3;
54-
min-height: 11em;
69+
min-height: 9em;
5570
height: auto;
5671
position: relative;
5772
color: white;
@@ -92,7 +107,7 @@
92107
}
93108

94109
.purchase-popup {
95-
display: inline-block
110+
display: inline-block;
96111
}
97112

98113
.listing-card {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { ActivityInfoFragment } from '../../../__generated__/types';
2+
3+
type Props = {
4+
activity: ActivityInfoFragment;
5+
};
6+
7+
export function ActivityCard({ activity }: Props) {
8+
const date = new Date(activity.activityDate);
9+
const dateString = `${date.getDate()} ${date.getMonth()}, ${date.getDay()}`;
10+
11+
return (
12+
<div className="student-activity">
13+
<div>{dateString}</div>
14+
<div>{activity.note}</div>
15+
<div>{activity.pointChange}</div>
16+
</div>
17+
);
18+
}

0 commit comments

Comments
 (0)