Commit 95b55bcd authored by Alexey Beloglazov's avatar Alexey Beloglazov Committed by Ev Maslovskiy
Browse files

Issue #3312855: Placement of Submit button for lesson questions is off

parent 624df7f2
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased changes
- #3313429: Incorrect behavior for cases when a user didn't add answer for question and submitted the form.
- #3312857: Short answer question in quiz looks odd.
- #3312855: Placement of Submit button for lesson questions is off.

## [2.9.1]
- Get rid of "flatMap" in js code to provide better compatibility with old browsers.
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+3 −3
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ const ContentNavigation = ({
  prevLesson,
  currentIndex,
  isEnabled,
  ignorePaddings,
  lessonGridMode,
  hideButtonsLabelsOnMobile,
}) => {
  const history = useHistory();
@@ -76,7 +76,7 @@ const ContentNavigation = ({
        };

        return (
          <LessonGrid ignorePaddings={ignorePaddings}>
          <LessonGrid mode={lessonGridMode}>
            <ButtonWrapper>
              {prevLesson && noPrevLesson && !isFirstSection && (
                <Button
@@ -190,7 +190,7 @@ ContentNavigation.propTypes = {
  prevLesson: PropTypes.shape(),
  currentIndex: PropTypes.number,
  isEnabled: PropTypes.bool,
  ignorePaddings: PropTypes.bool,
  lessonGridMode: PropTypes.string,
  hideButtonsLabelsOnMobile: PropTypes.bool,
};

+7 −10
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ import Box from '@material-ui/core/Box';
import makeStyles from '@material-ui/core/styles/makeStyles';

const useStyles = makeStyles((theme) => ({
  innerDefault: {
  default: {
    paddingLeft: theme.spacing(2),
    paddingRight: theme.spacing(2),
    [theme.breakpoints.up('sm')]: {
@@ -19,30 +19,27 @@ const useStyles = makeStyles((theme) => ({
      marginRight: 'auto',
    },
  },
  innerIgnorePaddings: {
  navigation: {
    marginRight: theme.spacing(4),
    [theme.breakpoints.down('md')]: {
      marginRight: theme.spacing(2),
    },
  },
  button: {},
}));

const LessonGrid = ({ children, ignorePaddings }) => {
const LessonGrid = ({ children, mode }) => {
  const classes = useStyles();
  return (
    <Box className={!ignorePaddings ? classes.innerDefault : classes.innerIgnorePaddings}>
      {children}
    </Box>
  );
  return <Box className={classes[mode]}>{children}</Box>;
};

LessonGrid.propTypes = {
  children: PropTypes.node,
  ignorePaddings: PropTypes.bool,
  mode: PropTypes.oneOf(['default', 'navigation', 'button']),
};

LessonGrid.defaultProps = {
  ignorePaddings: false,
  mode: 'default',
};

export default LessonGrid;
Loading