Skip to content

Commit

Permalink
Bug batch 4 fixed break time <5 issue, email template, and both option (
Browse files Browse the repository at this point in the history
#78)

* bug 1 - only breaks w/ 5+ diff and bug 3 - taking out the both option only junior/senior

* Fixed email for new user acc creation

* removed console statements

---------

Co-authored-by: subinqkim <[email protected]>
Co-authored-by: michellelin1 <[email protected]>
  • Loading branch information
3 people authored Apr 16, 2024
1 parent 28e6654 commit af4c204
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/Authentication/SignUp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const SignUp = () => {
await registerWithEmailAndPassword(email, password, USER_ROLE, navigate, '/awaitConfirmation', firstName, lastName);

// send email to Debbie
const subject = "placeholder";
const subject = "New User Created Account";
const newEmail = email;
await sendEmail(subject, newEmail, emailtemplate);

Expand Down
1 change: 0 additions & 1 deletion src/components/Catalog/SearchFilter/filterOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const seasonOptions = [
const yearOptions = [
{ value: 'junior', name: 'Junior' },
{ value: 'senior', name: 'Senior' },
{ value: 'both', name: 'Both' },
];
const subjectOptions = [
{ value: 'life skills', name: 'Life Skills' },
Expand Down
8 changes: 5 additions & 3 deletions src/components/EmailTemplates/emailtemplate.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
//import React from 'react';
import { Email, Item, Span, A } from 'react-html-email';
import { Email, Item, Span } from 'react-html-email';

const emailTemplate = ({newEmail}) => (
<Email title="New User Account Approval">
<Item align="center">
<Span fontSize={20}>
Hello Debbie,
A user with the email {newEmail} has created an account and is waiting for your approval.
<A href="https://github.com/chromakode/react-html-email">react-html-email</A>.

A user with the email {newEmail} has created an account and is waiting for your approval.

Thank you.
</Span>
</Item>
</Email>
Expand Down
13 changes: 12 additions & 1 deletion src/components/Events/Events.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@ const Events = ({ eventData }) => {
eventDataWithBreaks.push(currentEvent);
const currEnd = currentEvent.endTime.split(':').slice(0,2).join(":");
const nextStart = nextEvent.startTime.split(':').slice(0,2).join(":");
if (currEnd < nextStart) {

const endHour = currEnd.split(':')[0]
const endMin = currEnd.split(':')[1]
const convertTimeToMin = (hour, min) => {
return parseInt(hour) * 60 + parseInt(min);
};
const startHour = nextStart.split(':')[0]
const startMin = nextStart.split(':')[1]

const timeDiff = convertTimeToMin(startHour, startMin) - convertTimeToMin(endHour, endMin);
if (currEnd < nextStart && timeDiff >= 5) {
console.log("break");
eventDataWithBreaks.push({
id: maxId,
startTime: currentEvent.endTime,
Expand Down

0 comments on commit af4c204

Please sign in to comment.