Jelajahi Sumber

Handling bot change

Steven Fukase 5 tahun lalu
induk
melakukan
537fb7568d

+ 3 - 3
src/client/js/components/Admin/SlackIntegration/ConfirmBotChangeModal.jsx

@@ -34,10 +34,10 @@ const ConfirmBotChangeModal = ({ show, onButtonClick }) => {
 
           <div className="modal-footer">
             <button type="button" className="btn btn-secondary" onClick={() => onButtonClick('close')}>
-              Close
+              Cancel
             </button>
-            <button type="button" className="btn btn-primary" onClick={() => onButtonClick('save')}>
-              Save
+            <button type="button" className="btn btn-primary" onClick={() => onButtonClick('change')}>
+              Change
             </button>
           </div>
         </div>

+ 7 - 5
src/client/js/components/Admin/SlackIntegration/SlackIntegration.jsx

@@ -9,15 +9,17 @@ import ConfirmBotChangeModal from './ConfirmBotChangeModal';
 const SlackIntegration = () => {
 
   const [modalVisibility, setmodalVisibility] = useState(false);
+  const [currentBotType, setcurrentBotType] = useState('custom-bot-non-proxy');
+  let settingsComponent = null;
+
+  const changeBotSettings = (botType) => {
+    console.log(botType);
+  }
 
   const handleBotTypeSelect = (clickedBotType) => {
-    console.log(clickedBotType);
     setmodalVisibility(true);
   };
 
-  const currentBotType = 'custom-bot-non-proxy';
-  let settingsComponent = null;
-
   switch (currentBotType) {
     case 'official-bot':
       settingsComponent = <OfficialBotSettings />;
@@ -41,7 +43,7 @@ const SlackIntegration = () => {
           show={modalVisibility}
           onButtonClick={(button) => {
             if (button === 'close') setmodalVisibility(false);
-            if (button === 'save') console.log('save button clicked');
+            if (button === 'change') changeBotSettings();
           }}
         />
       </div>