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

fix: layout responsive #422

Closed
Closed
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
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
Loading