Skip to content

Commit

Permalink
feat: ora mobile responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
vladislavkeblysh committed Jun 12, 2024
1 parent c644da3 commit faba588
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`Info Popover Component snapshot 1`] = `
</Popover.Content>
</Popover>
}
placement="right-end"
placement="left-end"
trigger="focus"
>
<IconButton
Expand Down
2 changes: 1 addition & 1 deletion src/components/InfoPopover/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import messages from './messages';
export const InfoPopover = ({ onClick, children, intl }) => (
<OverlayTrigger
trigger="focus"
placement="right-end"
placement="left-end"
flip
overlay={(
<Popover id="info-popover" className="overlay-help-popover">
Expand Down
10 changes: 10 additions & 0 deletions src/containers/ListView/ListView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,14 @@ span.pgn__icon.breadcrumb-arrow {
margin-bottom: 0;
}
}

@include media-breakpoint-down(xs) {
.badge {
white-space: normal;
}

.pgn__table-actions > div:first-of-type {
z-index: $zindex-modal !important;
}
}
}
8 changes: 7 additions & 1 deletion src/containers/ReviewActions/ReviewActions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@
.review-actions-username {
padding-bottom: map-get($spacers, 3);
}
}
}

@include media-breakpoint-down(xs) {
.overlay-help-popover {
max-width: calc(100% - 60px) !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports[`ReviewActions component component snapshot: do not show rubric 1`] = `
status="grading-status"
/>
<span
className="small"
className="small text-nowrap"
>
<FormattedMessage
defaultMessage="Score: {pointsEarned}/{pointsPossible}"
Expand Down Expand Up @@ -71,7 +71,7 @@ exports[`ReviewActions component component snapshot: loading 1`] = `
status="grading-status"
/>
<span
className="small"
className="small text-nowrap"
>
<FormattedMessage
defaultMessage="Score: {pointsEarned}/{pointsPossible}"
Expand Down Expand Up @@ -113,7 +113,7 @@ exports[`ReviewActions component component snapshot: show rubric, no score 1`] =
status="grading-status"
/>
<span
className="small"
className="small text-nowrap"
/>
</span>
<div
Expand Down
2 changes: 1 addition & 1 deletion src/containers/ReviewActions/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const ReviewActions = ({
{ gradingStatus && (
<StatusBadge className="review-actions-status mr-3" status={gradingStatus} />
)}
<span className="small">
<span className="small text-nowrap">
{pointsPossible && (
<FormattedMessage
{...messages.pointsDisplay}
Expand Down
71 changes: 3 additions & 68 deletions src/containers/ReviewModal/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -1,72 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ReviewModal component component snapshots closed 1`] = `
<FullscreenModal
beforeBodyNode={
<React.Fragment>
<ReviewActions />
<DemoWarning />
</React.Fragment>
}
className="review-modal"
isOpen={false}
modalBodyClassName="review-modal-body"
onClose={[MockFunction hooks.onClose]}
title="test-ora-name"
>
<CloseReviewConfirmModal
prop="hooks.closeConfirmModalProps"
/>
</FullscreenModal>
`;
exports[`ReviewModal component component snapshots closed 1`] = `undefined`;

exports[`ReviewModal component component snapshots loading 1`] = `
<FullscreenModal
beforeBodyNode={
<React.Fragment>
<ReviewActions />
<DemoWarning />
</React.Fragment>
}
className="review-modal"
isOpen={true}
modalBodyClassName="review-modal-body"
onClose={[MockFunction hooks.onClose]}
title="test-ora-name"
>
<ReviewContent />
<LoadingMessage
message={
Object {
"defaultMessage": "Loading response",
"description": "loading text for submission response review screen",
"id": "ora-grading.ReviewModal.loadingResponse",
}
}
/>
<CloseReviewConfirmModal
prop="hooks.closeConfirmModalProps"
/>
</FullscreenModal>
`;
exports[`ReviewModal component component snapshots loading 1`] = `undefined`;

exports[`ReviewModal component component snapshots success 1`] = `
<FullscreenModal
beforeBodyNode={
<React.Fragment>
<ReviewActions />
<DemoWarning />
</React.Fragment>
}
className="review-modal"
isOpen={true}
modalBodyClassName="review-modal-body"
onClose={[MockFunction hooks.onClose]}
title="test-ora-name"
>
<ReviewContent />
<CloseReviewConfirmModal
prop="hooks.closeConfirmModalProps"
/>
</FullscreenModal>
`;
exports[`ReviewModal component component snapshots success 1`] = `undefined`;
7 changes: 5 additions & 2 deletions src/containers/ReviewModal/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { useDispatch } from 'react-redux';

import { FullscreenModal } from '@edx/paragon';
import { FullscreenModal, Truncate, useMediaQuery } from '@edx/paragon';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';

import LoadingMessage from 'components/LoadingMessage';
Expand All @@ -27,9 +27,12 @@ export const ReviewModal = ({ intl }) => {
isOpen,
closeConfirmModalProps,
} = hooks.rendererHooks({ dispatch, intl });

const isMobile = useMediaQuery({ query: '(max-width: 575.98px)' });

return (
<FullscreenModal
title={title}
title={isMobile ? <Truncate lines={3}>{title}</Truncate> : title}
isOpen={isOpen}
beforeBodyNode={(
<>
Expand Down

0 comments on commit faba588

Please sign in to comment.