Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI updates/ Launch Lessons page #12647

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/quill-cdn/assets/images/icons/xs/arrow-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/quill-cdn/assets/images/icons/xs/pencil.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/quill-cdn/assets/images/icons/xs/tool-connect.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/quill-cdn/assets/images/icons/xs/tool-lessons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
189 changes: 140 additions & 49 deletions services/QuillLMS/app/assets/stylesheets/pages/my_lessons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,30 @@
section:last-of-type {
padding-bottom: 5px;
}
.my-lessons-header {
margin-top: 30px;
margin-bottom: 30px;
h1 {
font-weight: 600;
font-size: 30px;
margin-bottom: 10px;
}
p {
margin: 7px 0px;
font-size: 16px;
}
span {
font-weight: 600;
.top-section {
display: flex;
margin: 32px 0px;
.my-lessons-header {
h1 {
@include display-xl;
margin-bottom: 10px;
}
p {
margin: 7px 0px;
@include text-s;
}
span {
font-weight: 600;
}
a {
color: #027360;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could substitute this for a color variable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch! with the refactoring, I was in a bit of autopilot for some parts of copy and pasting 😅

text-decoration: underline;
}
}
a {
color: #027360;
font-weight: 600;
text-decoration: underline;
.dropdown-container {
min-width: 190px;
}
}
#launch-lesson {
height: 40px;
color: white;
font-size: 14px;
font-weight: bold;
width: 145px;
border-radius: 3px;
background-color: #00c2a2;
display: flex;
align-items: center;
justify-content: center;
}
.lesson-completed {
margin-right: 8px;
color: #82bf3c;
font-weight: 600;
width: 160px;
}
.resume-lesson {
width: 145px;
height: 40px;
border-radius: 3px;
background-color: $quill-white;
border: solid 1px #00c2a2;
font-weight: bold;
color: #00c2a2 !important;
margin-right: 30px;
display: flex;
justify-content: center;
align-items: center;
}
.customized-editions-tag {
width: 90px;
height: 23px;
Expand All @@ -71,6 +43,125 @@
display: none;
}
}
.lesson-unit-container {
border-radius: 8px;
border: 1px solid $quill-grey-15 !important;
padding: 32px !important;
margin-bottom: 32px;
.unit-header-container {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 24px;
.unit-name {
@include display-l;
}
.assigned-student-info {
display: flex;
color: $quill-grey-90;
@include text-s;
.locked-info {
display: flex;
border-right: 1px solid $quill-grey-15;
padding-right: 16px;
img {
margin-right: 4px;
}
}
.assigned-to {
display: flex;
@include text-s;
color: $quill-grey-50;
span:first-of-type {
margin: 0px 2px;
}
span:last-of-type {
margin-left: 2px;
}
span {
font-weight: 700;
}
}
}
.assigned-student-info:has(.locked-info) {
.assigned-to {
padding-left: 16px;
}
}
}
.lesson-activities-table {
.data-table-headers .data-table-header {
&.lesson-activity-header, &.launch-lesson-header {
span {
margin-left: 8px;
}
}
}
.data-table-body .data-table-row .data-table-row-section {
.customize-link, .download-link {
margin-left: 22px;
}
&.launch-lesson, &.lesson-activity {
a, .activity-cell-container {
margin-left: 8px;
}
}
}
.activity-cell-container {
display: flex;
justify-content: space-between;
width: 100%;
.data-table-chip {
max-width: 480px;
width: max-content;
p {
text-overflow: unset;
white-space: break-spaces;
text-align: left;
}
}
.lesson-complete {
display: flex;
align-items: center;
p {
color: $quill-green-vibrant;
font-size: 13px;
font-weight: 700;
margin-right: 8px;
}
}
}
a {
color: $quill-white;
}
}
}
.empty-lessons-content {
display: flex;
align-items: center;
flex-direction: column;
padding: 128px 0px;

h2 {
font-size: 20px;
font-weight: 700;
line-height: normal;
}

p {
margin-top: 8px;
font-size: 14px;
font-weight: 400;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be replaced with @include text-s.

line-height: normal;
color: $quill-grey-50;
}
.buttons {
margin-top: 24px;
.quill-button:first-of-type {
margin-right: 8px;
}
}
}
}

.empty-lessons {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
.feedback-note {
border-top: solid 1px #c0c0c0;
padding-top: 20px;
color: $quill-grey-50;
a {
color: #027360;
font-weight: 600;
text-decoration: underline;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ interface DataTableChipProps {
src: string
},
label: string,
link?: string
link?: string,
onClick?: (e: any) => void
}

export const DataTableChip = ({ color, icon, label, link }: DataTableChipProps) => {
export const DataTableChip = ({ color, icon, label, link, onClick }: DataTableChipProps) => {
if(link) {
return(
<a className={`data-table-chip ${color} focus-on-light`} href={link}>
Expand All @@ -19,6 +20,14 @@ export const DataTableChip = ({ color, icon, label, link }: DataTableChipProps)
</a>
)
}
if (onClick) {
return (
<button className={`data-table-chip ${color} focus-on-light`} onClick={onClick}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably need a button type declaration here for the linter, right?

{icon && <img alt={icon.alt} src={icon.src} />}
<p>{label}</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a span is the more appropriate semantic element here -- I've been getting a lot of console errors about nesting block elements inside inline elements, which I think is technically not allowed under the HTML5 specification. There are some cases where it's tricky to avoid (like nesting elements in tables), but I think we should try where we can.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok! I'll make that change. Thank you for the context

</button>
)
}
return (
<div className={`data-table-chip ${color}`}>
{icon && <img alt={icon.alt} src={icon.src} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,20 +187,26 @@ export default class ClassroomLessons extends React.Component {
}

renderEmptyState() {
const assignLessonsLink = <a className="bg-quillgreen text-white" href="/assign/activity-library?activityClassificationFilters[]=lessons" target="_blank">Assign Lessons</a> // eslint-disable-line react/jsx-no-target-blank
const learnMoreLink = <a className="bg-white text-quillgreen" href="/tools/lessons" target="_blank">Learn More</a> // eslint-disable-line react/jsx-no-target-blank
const assignLessonsLink = <a className="quill-button medium contained green focus-on-light" href="/assign/activity-library?activityClassificationFilters[]=lessons" rel="noopener noreferrer" target="_blank">Assign Lessons</a>
const learnMoreLink = <a className="quill-button medium outlined green focus-on-light" href="/tools/lessons" rel="noopener noreferrer" target="_blank">Learn More</a>
return (
<div className="empty-lessons manage-units gray-background-accommodate-footer">
<div className="content">
<h1>You have no lessons assigned!</h1>
<p>In order to launch a lesson, you need to assign a lesson to one of your classes.</p>
<p>With Quill Lessons, teachers can use Quill to lead whole-class lessons and to see and display student responses in real-time.</p>
<div className="buttons">
{assignLessonsLink}
{learnMoreLink}
<div className="gray-background-accommodate-footer">
<div className="container my-lessons manage-units">
<div className="top-section">
<div className="my-lessons-header">
<h1>Launch Lessons</h1>
</div>
</div>
<div className="empty-lessons-content">
<h2>You have no lessons assigned</h2>
<p>In order to launch a lesson, you need to assign a lesson to one of your classes.</p>
<p>With Quill Lessons, teachers can use Quill to lead whole-class lessons and to see and display student responses in real-time.</p>
<div className="buttons">
{assignLessonsLink}
{learnMoreLink}
</div>
</div>
</div>
<img alt="cartoon of a teacher gesturing at a projector screen showing Quill Lessons content" src={`${process.env.CDN_URL}/images/illustrations/empty_state_illustration_lessons.svg`} />
</div>
);
}
Expand Down Expand Up @@ -235,12 +241,15 @@ export default class ClassroomLessons extends React.Component {
return (
<div className="gray-background-accommodate-footer" id="lesson_planner">
<div className="container my-lessons manage-units">
{this.renderHeader()}
<ItemDropdown
callback={this.switchClassrooms}
items={classrooms}
selectedItem={classrooms.find(classy => classy.id === selectedClassroomId)}
/>
<div className="top-section">
{this.renderHeader()}
<ItemDropdown
callback={this.switchClassrooms}
className="bordered medium"
items={classrooms}
selectedItem={classrooms.find(classy => classy.id === selectedClassroomId)}
/>
</div>
<Units
data={this.parseUnits(lessons)}
lesson
Expand Down
Loading
Loading