Просмотр исходного кода

success to use props "dropdownItemSize"

kaori 5 лет назад
Родитель
Сommit
f2321817b8

+ 10 - 1
src/client/js/components/Admin/Customize/CustomizeFunctionSetting.jsx

@@ -115,7 +115,16 @@ class CustomizeFunctionSetting extends React.Component {
               </div>
               </div>
             </div>
             </div>
 
 
-            <PagingSizeUncontrolledDropdown />
+            <PagingSizeUncontrolledDropdown
+              // toggleLabel={pageLimitation}
+              dropdownItemSize={[10, 20, 50, 100]}
+              // dropdownItemOnClickHandler={adminCustomizeContainer.switchPageListLimitationL.bind(adminCustomizeContainer)}
+            />
+            <PagingSizeUncontrolledDropdown
+              // toggleLabel={pageLimitation}
+              dropdownItemSize={[5, 10, 20, 50, 100]}
+              // dropdownItemOnClickHandler={adminCustomizeContainer.switchPageListLimitationL.bind(adminCustomizeContainer)}
+            />
 
 
             {/* {Object.entries(dropdownGroupMapping).map(([key, value]) => {
             {/* {Object.entries(dropdownGroupMapping).map(([key, value]) => {
               return (
               return (

+ 3 - 1
src/client/js/components/Admin/Customize/PagingSizeUncontrolledDropdown.jsx

@@ -56,7 +56,7 @@ const PagingSizeUncontrolledDropdown = (props) => {
                   <span className="float-left">{value.pageLimitation}</span>
                   <span className="float-left">{value.pageLimitation}</span>
                 </DropdownToggle>
                 </DropdownToggle>
                 <DropdownMenu className="dropdown-menu" role="menu">
                 <DropdownMenu className="dropdown-menu" role="menu">
-                  {value.dropdownMenu.map((num) => {
+                  {props.dropdownItemSize.map((num) => {
                     return (
                     return (
                       <DropdownItem key={num} role="presentation" onClick={() => { value.switchPageListLimitation(num) }}>
                       <DropdownItem key={num} role="presentation" onClick={() => { value.switchPageListLimitation(num) }}>
                         <a role="menuitem">{num}</a>
                         <a role="menuitem">{num}</a>
@@ -82,6 +82,8 @@ const PagingSizeUncontrolledDropdownWrapper = withUnstatedContainers(PagingSizeU
 PagingSizeUncontrolledDropdown.propTypes = {
 PagingSizeUncontrolledDropdown.propTypes = {
   t: PropTypes.func.isRequired, //  i18next
   t: PropTypes.func.isRequired, //  i18next
   adminCustomizeContainer: PropTypes.instanceOf(AdminCustomizeContainer).isRequired,
   adminCustomizeContainer: PropTypes.instanceOf(AdminCustomizeContainer).isRequired,
+  // toggleLabel: PropTypes.func,
+  dropdownItemSize: PropTypes.array,
 };
 };
 
 
 export default withTranslation()(PagingSizeUncontrolledDropdownWrapper);
 export default withTranslation()(PagingSizeUncontrolledDropdownWrapper);