diff --git a/client-html/src/js/common/components/layout/sidebar-with-search/SidebarWithSearch.tsx b/client-html/src/js/common/components/layout/sidebar-with-search/SidebarWithSearch.tsx index 60426ea889b..df27c48534f 100644 --- a/client-html/src/js/common/components/layout/sidebar-with-search/SidebarWithSearch.tsx +++ b/client-html/src/js/common/components/layout/sidebar-with-search/SidebarWithSearch.tsx @@ -83,7 +83,7 @@ export const SidebarWithSearch = (props: Props) => { >
- +
{!noSearch && } {Boolean(filters.length) && ( diff --git a/client-html/src/js/common/components/layout/swipeable-sidebar/SwipeableSidebar.tsx b/client-html/src/js/common/components/layout/swipeable-sidebar/SwipeableSidebar.tsx index 2ab542b2363..3575be3c13a 100644 --- a/client-html/src/js/common/components/layout/swipeable-sidebar/SwipeableSidebar.tsx +++ b/client-html/src/js/common/components/layout/swipeable-sidebar/SwipeableSidebar.tsx @@ -7,8 +7,7 @@ */ import { PreferenceEnum, SearchQuery } from "@api/model"; -import { Backdrop, Divider } from "@mui/material"; -import Collapse from "@mui/material/Collapse"; +import { Backdrop, Collapse, Divider } from "@mui/material"; import { darken } from "@mui/material/styles"; import SwipeableDrawer from "@mui/material/SwipeableDrawer"; import Typography from "@mui/material/Typography"; @@ -115,7 +114,6 @@ const styles = (theme: AppTheme) => }); interface Props { - form: string; resetEditView: any; classes: any; opened: boolean; @@ -150,7 +148,6 @@ const sortItems = (a, b) => { const SwipeableSidebar: React.FC = props => { const { - form, dispatch, classes, opened, @@ -427,7 +424,7 @@ const SwipeableSidebar: React.FC = props => { >
- +
void; } const HamburgerMenu = React.memo(props => { - const { opened, toggleSwipeableDrawer } = props; + const { opened, liteBackground, toggleSwipeableDrawer } = props; return (
@@ -36,13 +37,7 @@ const HamburgerMenu = React.memo(props => { {opened ? : } - {/* */} - - +
); }); @@ -55,4 +50,4 @@ const mapStateToDispatch = (dispatch: Dispatch, props: Props) => ({ toggleSwipeableDrawer: () => dispatch(toggleSwipeableDrawer(props.variant)) }); -export default connect(mapStateToProps, mapStateToDispatch)(HamburgerMenu); +export default connect(mapStateToProps, mapStateToDispatch)(HamburgerMenu); diff --git a/client-html/src/js/containers/preferences/containers/tutor-roles/components/PayRateItem.tsx b/client-html/src/js/containers/preferences/containers/tutor-roles/components/PayRateItem.tsx index be6574af724..758d05bdfeb 100644 --- a/client-html/src/js/containers/preferences/containers/tutor-roles/components/PayRateItem.tsx +++ b/client-html/src/js/containers/preferences/containers/tutor-roles/components/PayRateItem.tsx @@ -10,13 +10,8 @@ import { ClassCostRepetitionType } from "@api/model"; import DeleteIcon from "@mui/icons-material/Delete"; import { Card, Grid, IconButton } from "@mui/material"; import Tooltip from "@mui/material/Tooltip"; -import { - formatFieldPercent, - mapSelectItems, - parseFieldPercent, - preventNegativeOrLogEnter, - YYYY_MM_DD_MINUSED -} from "ish-ui"; +import { Decimal } from "decimal.js-light"; +import { decimalMul, mapSelectItems, YYYY_MM_DD_MINUSED } from "ish-ui"; import React from "react"; import FormField from "../../../../../common/components/form/formFields/FormField"; import { valiadateSelectItemAvailable } from "../../../../../common/utils/validation"; @@ -27,8 +22,12 @@ const validateRepetition = val => valiadateSelectItemAvailable(val, repetitionTy const validatePercentage = value => (!value && value !== 0 ? "Field is mandatory" : undefined); +const parseFieldPercent = val => val && val > 0 ? new Decimal(val).div(100).toDecimalPlaces(4).toNumber() : 0; + +const formatFieldPercent = val => decimalMul(val, 100); + const PayRateItem = props => { - const {fields, onDelete} = props; + const { fields, onDelete } = props; return fields.map((item, index) => ( @@ -68,9 +67,7 @@ const PayRateItem = props => { step="0.01" format={formatFieldPercent} parse={parseFieldPercent} - onKeyPress={preventNegativeOrLogEnter} validate={validatePercentage} - debounced={false} />