diff --git a/packages/apps/esm-offline-tools-app/src/index.ts b/packages/apps/esm-offline-tools-app/src/index.ts index 2f8a51349..370d167e9 100644 --- a/packages/apps/esm-offline-tools-app/src/index.ts +++ b/packages/apps/esm-offline-tools-app/src/index.ts @@ -1,4 +1,9 @@ -import { defineConfigSchema, getSyncLifecycle, registerBreadcrumbs, registerOfflineHandler } from '@openmrs/esm-framework'; +import { + defineConfigSchema, + getSyncLifecycle, + registerBreadcrumbs, + registerOfflineHandler, +} from '@openmrs/esm-framework'; import { routes } from './constants'; import { createDashboardLink } from './createDashboardLink'; import { dashboardMeta } from './dashboard.meta'; diff --git a/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-mode-button.extension.tsx b/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-mode-button.extension.tsx index d98b70fea..cc5f217ba 100644 --- a/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-mode-button.extension.tsx +++ b/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-mode-button.extension.tsx @@ -1,6 +1,6 @@ import React, { useState, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; -import { Toggle, Button, DefinitionTooltip } from '@carbon/react'; +import { Button } from '@carbon/react'; import { Network_3 } from '@carbon/react/icons'; import { getCurrentOfflineMode, @@ -18,7 +18,6 @@ function doNotCloseMenu(ev: React.SyntheticEvent) { const OfflineActionsModeButton: React.FC = () => { const { t } = useTranslation(); const isOnline = useConnectivity(); - const [lastRun, setLastRun] = useState(() => getCurrentOfflineMode().lastRun); const [active, setActive] = useState(() => getCurrentOfflineMode().active); const toggle = useCallback(() => { @@ -37,26 +36,21 @@ const OfflineActionsModeButton: React.FC = () => { return ( isOnline && ( -
+
- - {t('offlineReady', 'Offline Ready')} - +

{t('offlineReady', 'Offline Ready')}

- - {active && ( - - )} - - {!active && } -
+ {active ? ( + + ) : ( + + )} + ) ); }; diff --git a/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-mode-button.scss b/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-mode-button.scss index 538096c47..565871148 100644 --- a/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-mode-button.scss +++ b/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-mode-button.scss @@ -3,48 +3,8 @@ .panelItemContainer a { display: flex; - justify-content: space-between; align-items: center; - - :global(.cds--toggle-input__label .cds--toggle__switch) { - margin-top: 0 !important; - } - - :global(.cds--toggle) { - /* setting the width prevents the toggle from changing size when the text changes */ - width: 76px; - margin: 0 1rem; - } - - :global(.cds--toggle__text) { - color: $ui-02; - } - - :global(.cds--definition-term) { - color: $ui-02; - } - - svg { - margin: 0rem 0.75rem; - fill: $field-01; - } - - & > div { - display: flex; - flex-direction: row; - width: fit-content; - align-items: center; - } - - button, - button:hover { - color: $inverse-link; - } - - button :hover { - @include brand-03(background-color); - color: $inverse-link; - } + justify-content: space-between; } .panelItemContainer div {