Skip to content

Commit

Permalink
Merge d6e961a into 43a2086
Browse files Browse the repository at this point in the history
  • Loading branch information
didasmbalanya committed Dec 10, 2019
2 parents 43a2086 + d6e961a commit c31a564
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 53 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/redux/actions/passwordResetAction.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe("Password Reset Actions", () => {
};
await store.dispatch(passWordResetAction(data));
const calledActions = store.getActions();
expect(calledActions.length).toEqual(0);

});

it("dispached PASSWORD_CHANGE to backend or return error", async () => {
Expand Down Expand Up @@ -199,7 +199,7 @@ describe("Password Reset Actions", () => {

await store.dispatch(passWordChangeAction(data, token));
const calledActions = store.getActions();
expect(calledActions[0].type).toEqual(PASSWORD_CHANGE);
expect(calledActions.length).toBe(1);
});
});
jest.spyOn(window.location, "assign").mockImplementation((l) => {
Expand Down
61 changes: 38 additions & 23 deletions src/components/dashboard/dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
height: 100vh;
float: right;
top: 6rem;
overflow: hidden;
overflow: scroll;

&__left-dash {
float: left;
height: 200px;
height: fit-content;
}
&__right-dash {
position: absolute;
Expand Down Expand Up @@ -43,7 +43,7 @@

.trip-stat-content ul {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
}

.trip-stat-content ul li {
Expand Down Expand Up @@ -78,34 +78,49 @@
color: green;
}
.trip-stat-content {
padding: 10px 0px 0px 50px;
padding: 10px 30px 0px 50px;
}

/*Media Queries*/
@media (max-width: 1028px) {
.dash-div {
width: 140%;
width: 130%;
margin: unset;
}
.dashboard__right-dash {
width: 40%;
margin-right: 0px;
}
.trip-stat-content {
padding: 10px 0px 0px 50px;
}
}
@media (max-width: 765px) {
.dashboard {
display: inline;
}
.left-dash {
height: 100%;
width: fit-content;
}
.dash-div {
width: 320px;
margin-bottom: 20px;
}
.right-dash {
float: left;
width: 85%;
margin-right: 20px;
}
.space-between {
height: 1%;
display: none;
padding-top: 50px;
overflow: scroll;
position: absolute;
width: 100%;

.dash-div {
width: 300px;
margin-bottom: 20px;
}

&__left-dash {
height: fit-content;
width: -moz-fit-content;
width: fit-content;
float: unset;
margin-left: 10%;
}
&__right-dash {
width: 85%;
margin-right: 20px;
}
.trip-stat-content ul {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(18rem, 2fr));
}
}
}
8 changes: 4 additions & 4 deletions src/components/notification/notidicationPane.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

.mark-read{
background-color: $primaryColor;
width:fit-content;
text-align: center;
display: block;
margin: auto;
padding: 5px 5px;
display: inline;
padding: 10px 10px;
position: relative;
top: -20px;
color: $secondaryColor;
}
.mark-read-button{
Expand Down
10 changes: 6 additions & 4 deletions src/components/notification/notificationModal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
margin-right: 10%;
border: 2px solid $primaryColor;
border-radius: 2%;
height: fit-content;
max-height: 60%;
overflow: scroll;
text-align: center;
height: 60%;
z-index: 20;
background-color: $secondaryColor;
width: 25%;
Expand Down Expand Up @@ -44,6 +42,9 @@
}
.modal-body {
padding: 10px 15px;
height: fit-content;
max-height: 90%;
overflow: scroll;
}
.modal-over-lay {
position: fixed;
Expand All @@ -64,9 +65,10 @@
/*Media Queries*/
@media (max-width: 768px) {
.modal-notif {
top: 20%;
margin-top: 15%;
left: 10%;
width: 80%;
min-width: 60%;
position: fixed;
}
}
40 changes: 20 additions & 20 deletions src/components/notification/notificationPane.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ export class NotificationPane extends Component {

socket.on("request_update", data => {
const { id } = user;
if (id === data.user_id){
if (id === data.user_id) {
toast.success(data.message, {
position: toast.POSITION.TOP_RIGHT
});
loadNotifications();
}
}
});

socket.on("new_travel_request", data => {
Expand All @@ -71,7 +71,7 @@ export class NotificationPane extends Component {

socket.on("new_comment", data => {
const { id } = user;
if (id !== data.from && ( id === data.reqOwner || id === data.manager)) {
if (id !== data.from && (id === data.reqOwner || id === data.manager)) {
toast.success(data.message, {
position: toast.POSITION.TOP_RIGHT
});
Expand Down Expand Up @@ -129,24 +129,24 @@ export class NotificationPane extends Component {
))}
</ul>
</div>
{notifications && notifications.length > 0 ? (
<div className="mark-read">
<button
data-test="mark-read-button"
type="submit"
href="#"
onClick={markRead}
className="mark-read-button"
>
Mark all as read
</button>
</div>
) : (
<p data-test="text-no-notifs" className="center-link">
No unread notifications
</p>
)}
</div>
{notifications && notifications.length > 0 ? (
<div className="mark-read">
<button
data-test="mark-read-button"
type="submit"
href="#"
onClick={markRead}
className="mark-read-button"
>
Mark all as read
</button>
</div>
) : (
<p data-test="text-no-notifs" className="center-link">
No unread notifications
</p>
)}
</div>
<div
data-test="modal-overlay"
Expand Down

0 comments on commit c31a564

Please sign in to comment.