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

replace inside of render method

kaori 5 лет назад
Родитель
Сommit
89db4a2e88
1 измененных файлов с 33 добавлено и 43 удалено
  1. 33 43
      src/client/js/components/Admin/Customize/CustomizeFunctionSetting.jsx

+ 33 - 43
src/client/js/components/Admin/Customize/CustomizeFunctionSetting.jsx

@@ -61,49 +61,37 @@ class CustomizeFunctionSetting extends React.Component {
   }
   }
 
 
 
 
-  // renderDropButtons(dropdownOpenGroup, pageLimitationGroup, switchPageListLimitationGrpup) {
-  //   const { t, adminCustomizeContainer } = this.props;
-  //   return (
-  //     <div>
-  //       {Object.entries(dropdownGroupMapping).map(([key, value]) => {
-  //         return (
-  //           // <NavItem key={key} type="button" className={`p-0 nav-link ${activeTab === key && 'active'}`}>
-  //           //   <NavLink onClick={() => { switchActiveTab(key) }}>
-  //           //     {value.icon}
-  //           //     {t(value.i18n)}
-  //           //   </NavLink>
-  //           // </NavItem>
-  //           <div className="form-group row">
-  //             <div className="offset-md-3 col-md-6 text-left">
-  //               <div className="my-0 w-100">
-  //                 <label>{t('admin:customize_setting.function_options.list_num_s')}</label>
-  //               </div>
-  //               <Dropdown isOpen={this.state.dropdownOpenGroup} toggle={this.onToggleDropdownS}>
-  //                 <DropdownToggle className="text-right col-6" caret>
-  //                   <span className="float-left">{adminCustomizeContainer.state.pageLimitationGroup}</span>
-  //                 </DropdownToggle>
-  //                 <DropdownMenu className="dropdown-menu" role="menu">
-  //                   <DropdownItem key={10} role="presentation" onClick={() => { adminCustomizeContainer.switchPageListLimitation(10) }}>
-  //                     <a role="menuitem">10</a>
-  //                   </DropdownItem>
-  //                   <DropdownItem key={30} role="presentation" onClick={() => { adminCustomizeContainer.switchPageListLimitation(30) }}>
-  //                     <a role="menuitem">30</a>
-  //                   </DropdownItem>
-  //                   <DropdownItem key={50} role="presentation" onClick={() => { adminCustomizeContainer.switchPageListLimitation(50) }}>
-  //                     <a role="menuitem">50</a>
-  //                   </DropdownItem>
-  //                 </DropdownMenu>
-  //               </Dropdown>
-  //               <p className="form-text text-muted">
-  //                 {t('admin:customize_setting.function_options.list_num_desc_s')}
-  //               </p>
-  //             </div>
-  //           </div>
-  //         );
-  //       })}
-  //     </div>
-  //   );
-  // }
+  renderDropButtons() {
+    const { t, adminCustomizeContainer } = this.props;
+    return (
+      <div className="form-group row">
+        <div className="offset-md-3 col-md-6 text-left">
+          <div className="my-0 w-100">
+            <label>{t('admin:customize_setting.function_options.list_num_s')}</label>
+          </div>
+          <UncontrolledDropdown>
+            <DropdownToggle className="text-right col-6" caret>
+              <span className="float-left">{adminCustomizeContainer.state.pageLimitationS}</span>
+            </DropdownToggle>
+            <DropdownMenu className="dropdown-menu" role="menu">
+              <DropdownItem key={10} role="presentation" onClick={() => { adminCustomizeContainer.switchPageListLimitationS(10) }}>
+                <a role="menuitem">10</a>
+              </DropdownItem>
+              <DropdownItem key={30} role="presentation" onClick={() => { adminCustomizeContainer.switchPageListLimitationS(30) }}>
+                <a role="menuitem">30</a>
+              </DropdownItem>
+              <DropdownItem key={50} role="presentation" onClick={() => { adminCustomizeContainer.switchPageListLimitationS(50) }}>
+                <a role="menuitem">50</a>
+              </DropdownItem>
+            </DropdownMenu>
+          </UncontrolledDropdown>
+          <p className="form-text text-muted">
+            {t('admin:customize_setting.function_options.list_num_desc_s')}
+          </p>
+        </div>
+      </div>
+    );
+  }
 
 
   render() {
   render() {
     const { t, adminCustomizeContainer } = this.props;
     const { t, adminCustomizeContainer } = this.props;
@@ -150,6 +138,8 @@ class CustomizeFunctionSetting extends React.Component {
               </div>
               </div>
             </div>
             </div>
 
 
+            { this.renderDropButtons() }
+
             {/* S: Modal */}
             {/* S: Modal */}
             <div className="form-group row">
             <div className="form-group row">
               <div className="offset-md-3 col-md-6 text-left">
               <div className="offset-md-3 col-md-6 text-left">