Sfoglia il codice sorgente

apply botType to each official-bot

kaori 5 anni fa
parent
commit
5fc361e08d

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

@@ -116,12 +116,12 @@ const SlackIntegration = (props) => {
   const renderBotTypeCard = (botType) => {
   const renderBotTypeCard = (botType) => {
     return (
     return (
       <div
       <div
-        className={`card admin-bot-card mx-3 rounded border-radius-sm shadow ${currentBotType === 'official-bot' ? 'border-primary' : ''}`}
-        onClick={() => handleBotTypeSelect('official-bot')}
+        className={`card admin-bot-card mx-3 rounded border-radius-sm shadow ${currentBotType === `${botType}` ? 'border-primary' : ''}`}
+        onClick={() => handleBotTypeSelect(`${botType}`)}
         role="button"
         role="button"
       >
       >
         <div>
         <div>
-          <h3 className={`card-header mb-0 py-3 text-center ${currentBotType === 'official-bot' ? 'bg-primary text-light' : ''}`}>
+          <h3 className={`card-header mb-0 py-3 text-center ${currentBotType === `${botType}` ? 'bg-primary text-light' : ''}`}>
             <span className="mr-2">
             <span className="mr-2">
               {t('admin:slack_integration.selecting_bot_types.official_bot')}
               {t('admin:slack_integration.selecting_bot_types.official_bot')}
             </span>
             </span>
@@ -129,7 +129,7 @@ const SlackIntegration = (props) => {
               {t('admin:slack_integration.selecting_bot_types.recommended')}
               {t('admin:slack_integration.selecting_bot_types.recommended')}
             </span>
             </span>
             {/* TODO: add an appropriate link by GW-5614 */}
             {/* TODO: add an appropriate link by GW-5614 */}
-            <i className={`fa fa-external-link btn-link ${currentBotType === 'official-bot' ? 'bg-primary text-light' : ''}`} aria-hidden="true"></i>
+            <i className={`fa fa-external-link btn-link ${currentBotType === `${botType}` ? 'bg-primary text-light' : ''}`} aria-hidden="true"></i>
           </h3>
           </h3>
         </div>
         </div>
         <div className="card-body p-4">
         <div className="card-body p-4">
@@ -186,7 +186,7 @@ const SlackIntegration = (props) => {
 
 
         <div className="row my-4">
         <div className="row my-4">
           <div className="card-deck mx-auto">
           <div className="card-deck mx-auto">
-            {renderBotTypeCard()}
+            {renderBotTypeCard('official-bot')}
 
 
             {/* <div
             {/* <div
               className={`card admin-bot-card mx-3 rounded border-radius-sm shadow ${currentBotType === 'official-bot' ? 'border-primary' : ''}`}
               className={`card admin-bot-card mx-3 rounded border-radius-sm shadow ${currentBotType === 'official-bot' ? 'border-primary' : ''}`}