Skip to content

Commit

Permalink
feat(page-adder): conditional classname
Browse files Browse the repository at this point in the history
  • Loading branch information
sercanscott committed Oct 2, 2021
1 parent 3a14433 commit bbb5c8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/Builder/PageAdder.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import PropTypes from 'prop-types';
import { func, number, string } from 'prop-types';
import classNames from 'classnames';
import { scrollToTarget } from '../../utils/functions';
import * as icons from '../../utils/icons';
import { useTranslatedTexts } from '../../utils/hooks';

const PageAdder = ({
additionalClass,
onPageAdd,
pageCount,
}) => {
Expand All @@ -16,7 +18,7 @@ const PageAdder = ({
const { ADD_NEW_PAGE } = useTranslatedTexts();
return (
<button
className="pageAdder forOptions"
className={classNames('pageAdder', additionalClass)}
onClick={onPageAddClick}
type="button"
>
Expand All @@ -27,11 +29,13 @@ const PageAdder = ({
};

PageAdder.propTypes = {
onPageAdd: PropTypes.func,
pageCount: PropTypes.number,
additionalClass: string,
onPageAdd: func,
pageCount: number,
};

PageAdder.defaultProps = {
additionalClass: '',
onPageAdd: () => {},
pageCount: 1,
};
Expand Down
1 change: 1 addition & 0 deletions src/components/Panels/SlidesPanel/ListWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const ListWrapper = ({
</ResponsiveContainer>
<div className="jfReport-pane-footer">
<PageAdder
additionalClass="forOptions"
onPageAdd={onPageAdd}
pageCount={pageCount}
/>
Expand Down

0 comments on commit bbb5c8a

Please sign in to comment.