|
@@ -1,10 +1,11 @@
|
|
|
import { ReactNode, useCallback } from 'react'
|
|
import { ReactNode, useCallback } from 'react'
|
|
|
import { useTranslation } from 'react-i18next'
|
|
import { useTranslation } from 'react-i18next'
|
|
|
-import Badge from '@/shared/components/badge'
|
|
|
|
|
-import Tooltip from '@/shared/components/tooltip'
|
|
|
|
|
|
|
+import OLBadge from '@/features/ui/components/ol/ol-badge'
|
|
|
|
|
+import OLTooltip from '@/features/ui/components/ol/ol-tooltip'
|
|
|
import { postJSON } from '@/infrastructure/fetch-json'
|
|
import { postJSON } from '@/infrastructure/fetch-json'
|
|
|
-import { Button } from 'react-bootstrap'
|
|
|
|
|
|
|
+import OLButton from '@/features/ui/components/ol/ol-button'
|
|
|
import getMeta from '@/utils/meta'
|
|
import getMeta from '@/utils/meta'
|
|
|
|
|
+import { isBootstrap5 } from '@/features/utils/bootstrap-5'
|
|
|
|
|
|
|
|
type IntegrationLinkingWidgetProps = {
|
|
type IntegrationLinkingWidgetProps = {
|
|
|
logo: ReactNode
|
|
logo: ReactNode
|
|
@@ -66,7 +67,7 @@ export function LabsExperimentWidget({
|
|
|
<div className="description-container">
|
|
<div className="description-container">
|
|
|
<div className="title-row">
|
|
<div className="title-row">
|
|
|
<h3 className="h4">{title}</h3>
|
|
<h3 className="h4">{title}</h3>
|
|
|
- {optedIn && <Badge bsStyle="info">{t('enabled')}</Badge>}
|
|
|
|
|
|
|
+ {optedIn && <OLBadge bg="info">{t('enabled')}</OLBadge>}
|
|
|
</div>
|
|
</div>
|
|
|
<p className="small">
|
|
<p className="small">
|
|
|
{description}{' '}
|
|
{description}{' '}
|
|
@@ -111,31 +112,36 @@ function ActionButton({
|
|
|
|
|
|
|
|
if (optedIn) {
|
|
if (optedIn) {
|
|
|
return (
|
|
return (
|
|
|
- <Button bsStyle={null} className="btn-secondary" onClick={handleDisable}>
|
|
|
|
|
|
|
+ <OLButton variant="secondary" onClick={handleDisable}>
|
|
|
{t('turn_off')}
|
|
{t('turn_off')}
|
|
|
- </Button>
|
|
|
|
|
|
|
+ </OLButton>
|
|
|
)
|
|
)
|
|
|
} else if (disabled) {
|
|
} else if (disabled) {
|
|
|
|
|
+ const tooltipableButton = isBootstrap5() ? (
|
|
|
|
|
+ <div className="d-inline-block">
|
|
|
|
|
+ <OLButton variant="primary" disabled>
|
|
|
|
|
+ {t('turn_on')}
|
|
|
|
|
+ </OLButton>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <OLButton variant="primary" disabled>
|
|
|
|
|
+ {t('turn_on')}
|
|
|
|
|
+ </OLButton>
|
|
|
|
|
+ )
|
|
|
return (
|
|
return (
|
|
|
- <Tooltip
|
|
|
|
|
|
|
+ <OLTooltip
|
|
|
id="experiment-disabled"
|
|
id="experiment-disabled"
|
|
|
description={t('this_experiment_isnt_accepting_new_participants')}
|
|
description={t('this_experiment_isnt_accepting_new_participants')}
|
|
|
overlayProps={{ delay: 0 }}
|
|
overlayProps={{ delay: 0 }}
|
|
|
>
|
|
>
|
|
|
- <Button bsStyle="secondary" className="btn btn-primary" disabled>
|
|
|
|
|
- {t('turn_on')}
|
|
|
|
|
- </Button>
|
|
|
|
|
- </Tooltip>
|
|
|
|
|
|
|
+ {tooltipableButton}
|
|
|
|
|
+ </OLTooltip>
|
|
|
)
|
|
)
|
|
|
} else {
|
|
} else {
|
|
|
return (
|
|
return (
|
|
|
- <Button
|
|
|
|
|
- bsStyle="primary"
|
|
|
|
|
- onClick={handleEnable}
|
|
|
|
|
- className="btn btn-primary"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <OLButton variant="primary" onClick={handleEnable}>
|
|
|
{t('turn_on')}
|
|
{t('turn_on')}
|
|
|
- </Button>
|
|
|
|
|
|
|
+ </OLButton>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|