Skip to content

Commit

Permalink
fix: layout responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
ihor-romaniuk committed Nov 23, 2023
1 parent fc80700 commit 84e9c13
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const AnswerOption = ({
return (
<Form.Control
as="textarea"
className="answer-option-textarea text-gray-500 small"
className="answer-option-textarea text-gray-500 small text-break"
autoResize
rows={1}
value={answer.title}
Expand All @@ -68,7 +68,7 @@ export const AnswerOption = ({
<div>
<Form.Control
as="textarea"
className="answer-option-textarea text-gray-500 small"
className="answer-option-textarea text-gray-500 small text-break"
autoResize
rows={1}
value={answer.title}
Expand All @@ -87,7 +87,7 @@ export const AnswerOption = ({
<Collapsible.Advanced
open={isFeedbackVisible}
onToggle={toggleFeedback}
className="answer-option d-flex flex-row justify-content-between flex-nowrap pb-2 pt-2"
className="answer-option d-flex flex-row justify-content-between flex-nowrap pb-2 pt-2 text-break"
>
<div className="mr-1 d-flex">
<Checker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`AnswerOption render snapshot: renders correct option with feedback 1`] = `
<Advanced
className="answer-option d-flex flex-row justify-content-between flex-nowrap pb-2 pt-2"
className="answer-option d-flex flex-row justify-content-between flex-nowrap pb-2 pt-2 text-break"
onToggle={[Function]}
open={false}
>
Expand Down Expand Up @@ -78,7 +78,7 @@ exports[`AnswerOption render snapshot: renders correct option with feedback 1`]

exports[`AnswerOption render snapshot: renders correct option with numeric input problem 1`] = `
<Advanced
className="answer-option d-flex flex-row justify-content-between flex-nowrap pb-2 pt-2"
className="answer-option d-flex flex-row justify-content-between flex-nowrap pb-2 pt-2 text-break"
onToggle={[Function]}
open={false}
>
Expand All @@ -105,7 +105,7 @@ exports[`AnswerOption render snapshot: renders correct option with numeric input
<Form.Control
as="textarea"
autoResize={true}
className="answer-option-textarea text-gray-500 small"
className="answer-option-textarea text-gray-500 small text-break"
onChange={[Function]}
placeholder="Enter an answer"
rows={1}
Expand Down Expand Up @@ -155,7 +155,7 @@ exports[`AnswerOption render snapshot: renders correct option with numeric input

exports[`AnswerOption render snapshot: renders correct option with numeric input problem and answer range 1`] = `
<Advanced
className="answer-option d-flex flex-row justify-content-between flex-nowrap pb-2 pt-2"
className="answer-option d-flex flex-row justify-content-between flex-nowrap pb-2 pt-2 text-break"
onToggle={[Function]}
open={false}
>
Expand Down Expand Up @@ -185,7 +185,7 @@ exports[`AnswerOption render snapshot: renders correct option with numeric input
<Form.Control
as="textarea"
autoResize={true}
className="answer-option-textarea text-gray-500 small"
className="answer-option-textarea text-gray-500 small text-break"
onChange={[Function]}
placeholder="Enter an answer range"
rows={1}
Expand Down Expand Up @@ -247,7 +247,7 @@ exports[`AnswerOption render snapshot: renders correct option with numeric input

exports[`AnswerOption render snapshot: renders correct option with selected unselected feedback 1`] = `
<Advanced
className="answer-option d-flex flex-row justify-content-between flex-nowrap pb-2 pt-2"
className="answer-option d-flex flex-row justify-content-between flex-nowrap pb-2 pt-2 text-break"
onToggle={[Function]}
open={false}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`SettingsWidget snapshot snapshot: renders Settings widget for Advanced Problem with correct widgets 1`] = `
<div
className="settingsWidget ml-4"
className="settingsWidget ml-md-4"
>
<div
className="mb-3"
Expand Down Expand Up @@ -83,7 +83,7 @@ exports[`SettingsWidget snapshot snapshot: renders Settings widget for Advanced

exports[`SettingsWidget snapshot snapshot: renders Settings widget page 1`] = `
<div
className="settingsWidget ml-4"
className="settingsWidget ml-md-4"
>
<div
className="mb-3"
Expand Down Expand Up @@ -164,7 +164,7 @@ exports[`SettingsWidget snapshot snapshot: renders Settings widget page 1`] = `

exports[`SettingsWidget snapshot snapshot: renders Settings widget page advanced settings visible 1`] = `
<div
className="settingsWidget ml-4"
className="settingsWidget ml-md-4"
>
<div
className="mb-3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const SettingsWidget = ({
};

return (
<div className="settingsWidget ml-4">
<div className="settingsWidget ml-md-4">
<div className="mb-3">
<TypeCard
answers={answers}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
}

.settingsWidget {
margin-top: 40px;
@media (min-width: 768px) {
margin-top: 40px;
}
.pgn__form-text {
font-size: small;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ exports[`EditorProblemView component renders raw editor 1`] = `
/>
</Component>
<div
className="editProblemView d-flex flex-row flex-nowrap justify-content-end"
className="editProblemView d-flex flex-row flex-wrap justify-content-end"
>
<Container
className="advancedEditorTopMargin p-0"
Expand All @@ -59,7 +59,7 @@ exports[`EditorProblemView component renders raw editor 1`] = `
/>
</Container>
<span
className="editProblemView-settingsColumn"
className="editProblemView-settingsColumn mb-3"
>
<injectIntl(ShimmedIntlComponent)
problemType="advanced"
Expand Down Expand Up @@ -118,10 +118,10 @@ exports[`EditorProblemView component renders simple view 1`] = `
</div>
</Component>
<div
className="editProblemView d-flex flex-row flex-nowrap justify-content-end"
className="editProblemView d-flex flex-row flex-wrap justify-content-end"
>
<span
className="flex-grow-1 mb-5"
className="editProblemView-mainColumn flex-grow-1 mb-3 mb-md-5"
>
<injectIntl(ShimmedIntlComponent) />
<injectIntl(ShimmedIntlComponent) />
Expand All @@ -130,7 +130,7 @@ exports[`EditorProblemView component renders simple view 1`] = `
/>
</span>
<span
className="editProblemView-settingsColumn"
className="editProblemView-settingsColumn mb-3"
>
<injectIntl(ShimmedIntlComponent)
problemType="multiplechoiceresponse"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,19 @@ export const EditProblemView = ({
</>
)}
</AlertModal>
<div className="editProblemView d-flex flex-row flex-nowrap justify-content-end">
<div className="editProblemView d-flex flex-row flex-wrap justify-content-end">
{isAdvancedProblemType ? (
<Container fluid className="advancedEditorTopMargin p-0">
<RawEditor editorRef={editorRef} lang="xml" content={problemState.rawOLX} />
</Container>
) : (
<span className="flex-grow-1 mb-5">
<span className="editProblemView-mainColumn flex-grow-1 mb-3 mb-md-5">
<QuestionWidget />
<ExplanationWidget />
<AnswerWidget problemType={problemType} />
</span>
)}
<span className="editProblemView-settingsColumn">
<span className="editProblemView-settingsColumn mb-3">
<SettingsWidget problemType={problemType} />
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
.selectTypeContainer {
max-width: 100%;
}

.editProblemView {
.editProblemView-mainColumn {
max-width: calc(100% - 345px);

@media (max-width: 767px) {
max-width: 100%;
}
}
.editProblemView-settingsColumn {
width: 320px;
flex-grow: 0;
flex-shrink: 0;
@media (max-width: 767px) {
width: 100%;
}
}
.advancedEditorTopMargin {
margin-top: 40px;
}
.answer-option .mce-content-body:before {
@media (max-width: 767px) {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 90%;
}
}
}

.tinyMceWidget {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`SelectTypeModal snapshot 1`] = `
className="justify-content-center"
>
<Stack
className="flex-wrap mb-6"
className="selectTypeContainer flex-wrap mb-6"
direction="horizontal"
gap={4}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const AdvanceTypeSelect = ({
if (data.status !== '') {
return (
<ActionRow className="border-primary-100 border-bottom m-0 py-3 w-100">
<Form.Radio id={type} value={type}>
<Form.Radio id={type} value={type} controlClassName="flex-shrink-0">
{intl.formatMessage(messages.advanceProblemTypeLabel, { problemType: data.title })}
</Form.Radio>
<ActionRow.Spacer />
Expand All @@ -67,7 +67,7 @@ export const AdvanceTypeSelect = ({
}
return (
<ActionRow className="border-primary-100 border-bottom m-0 py-3 w-100">
<Form.Radio id={type} value={type}>
<Form.Radio id={type} value={type} controlClassName="flex-shrink-0">
{intl.formatMessage(messages.advanceProblemTypeLabel, { problemType: data.title })}
</Form.Radio>
<ActionRow.Spacer />
Expand Down
Loading

0 comments on commit 84e9c13

Please sign in to comment.