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

Edit Modal Message, add fix to CourseCheckBox #287

Merged
merged 5 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
18 changes: 14 additions & 4 deletions components/notifications/NewSubscriptionsLimitModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { ReactElement } from 'react';
import Modal from '../Modal';
import X from '../icons/X.svg';
import Boston from '../icons/boston.svg';
import CryingHusky3 from '../icons/crying-husky-3.svg';

interface NewSubscriptionsLimitModalProps {
visible: boolean;
Expand All @@ -24,13 +25,22 @@ export default function NewSubscriptionsLimitModal({
<X />
</button>
</div>
<Boston />
<span className="phone-modal__header">Notifications are up!</span>
<CryingHusky3 />
<span className="phone-modal__header">Notification Issues</span>

<span className="phone-modal__label">
We{`'`}re limiting users to 12 subscriptions at a time to keep
SearchNEU running for our growing NEU community.
We have identified issues with unsubscribing from notifications.
</span>
<span className="phone-modal__label">
Additionally, we have not been been displaying professor names as
Banner recently changed how it shows professor data.
</span>
<br />
<span className="phone-modal__label">
We are very sorry about the inconvenience these issues cause, and
are working to deploy fixes ASAP. Thank you!
</span>
<br />
</div>
</div>
</Modal>
Expand Down
40 changes: 29 additions & 11 deletions components/panels/CourseCheckBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ export default function CourseCheckBox({
<div className="signUpSwitch toggle">
<div className="notifSwitch">
<input
disabled={notificationsLimitReached()}
//disabled={notificationsLimitReached()}
disabled={checked ? false : notificationsLimitReached()}
checked={checked}
onChange={onCheckboxClick}
className="react-switch-checkbox"
Expand All @@ -94,26 +95,43 @@ export default function CourseCheckBox({
/>
<label
//className={`react-switch-label ${NOTIFICATIONS_ARE_DISABLED && 'disabledButton'}`}
className={`react-switch-label ${notificationsLimitReached()}`}
className={`react-switch-label ${
//notificationsLimitReached()
!checked && notificationsLimitReached() && 'disabledButton'
}`}
style={{
marginTop: '0px',
cursor: `${
notificationsLimitReached() ? 'not-allowed' : 'inherit'
//notificationsLimitReached() ? 'not-allowed' : 'inherit'
!checked && notificationsLimitReached()
? 'not-allowed'
: 'inherit'
}`,
}}
htmlFor={notifSwitchId}
>
<span className="react-switch-button" />
</label>
</div>
<Tooltip
text={
checked
? 'Unsubscribe from notifications for this course.'
: 'Subscribe to notifications for this course'
}
direction={TooltipDirection.Up}
/>
{checked ||
(!notificationsLimitReached() && (
<Tooltip
text={
!userInfo
? 'Sign in to subscribe for notifications.'
: checked
? 'Unsubscribe from notifications for this section.'
: 'Subscribe to notifications for this section'
}
direction={TooltipDirection.Up}
/>
))}
{!checked && notificationsLimitReached() && (
<Tooltip
text="Notification limit reached - unsubscribe to add more."
direction={TooltipDirection.Up}
/>
)}
</div>
<SignUpModal
visible={showModal}
Expand Down
Loading