Skip to content

Commit f2a7442

Browse files
committed
ensure the tabs are below the header in sms section
1 parent d1d3976 commit f2a7442

4 files changed

Lines changed: 49 additions & 61 deletions

File tree

src/pages/system-admin/sms-settings/sms-settings-wrapper.component.tsx

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import {
1313
} from '@carbon/react/icons';
1414
import SMSSettingsContent from './sms-settings.component';
1515
import SmsLogsContent from './sms-logs.component';
16+
import Illustration from './sms-settings-illustration.component';
17+
import { Header } from '../shared-components';
1618
import styles from './sms-settings.scss';
1719

1820
interface SMSWrapperProps {
@@ -24,28 +26,34 @@ const SMSWrapper: React.FC<SMSWrapperProps> = () => {
2426
const [selectedIndex, setSelectedIndex] = useState(0);
2527

2628
return (
27-
<div className={styles.smsSettingsWrapper}>
28-
<Tabs selectedIndex={selectedIndex} onChange={({ selectedIndex }) => setSelectedIndex(selectedIndex)}>
29-
<TabList aria-label="SMS management tabs">
30-
<Tab>
31-
<Settings className={styles.tabIcon} />
32-
{t('settings', 'Settings')}
33-
</Tab>
34-
<Tab>
35-
<Document className={styles.tabIcon} />
36-
{t('logs', 'Logs')}
37-
</Tab>
38-
</TabList>
39-
<TabPanels>
40-
<TabPanel>
41-
<SMSSettingsContent />
42-
</TabPanel>
43-
<TabPanel>
44-
{selectedIndex === 1 && <SmsLogsContent />}
45-
</TabPanel>
46-
</TabPanels>
47-
</Tabs>
48-
</div>
29+
<>
30+
<Header
31+
illustrationComponent={<Illustration />}
32+
title={t('sms', 'SMS')}
33+
/>
34+
<div className={styles.smsSettingsWrapper}>
35+
<Tabs selectedIndex={selectedIndex} onChange={({ selectedIndex }) => setSelectedIndex(selectedIndex)}>
36+
<TabList aria-label="SMS management tabs">
37+
<Tab>
38+
<Settings className={styles.tabIcon} />
39+
{t('settings', 'Settings')}
40+
</Tab>
41+
<Tab>
42+
<Document className={styles.tabIcon} />
43+
{t('logs', 'Logs')}
44+
</Tab>
45+
</TabList>
46+
<TabPanels>
47+
<TabPanel>
48+
<SMSSettingsContent />
49+
</TabPanel>
50+
<TabPanel>
51+
{selectedIndex === 1 && <SmsLogsContent />}
52+
</TabPanel>
53+
</TabPanels>
54+
</Tabs>
55+
</div>
56+
</>
4957
);
5058
};
5159

src/pages/system-admin/sms-settings/sms-settings.component.tsx

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ import {
1616
Save,
1717
Link,
1818
Information,
19-
Checkmark,
20-
Warning,
21-
Time,
2219
} from '@carbon/react/icons';
2320
import {
2421
showNotification,
@@ -31,18 +28,9 @@ import {
3128
testSMSConnection,
3229
} from './sms-settings.resources';
3330
import { type SMSSettings } from './sms-settings.types';
34-
import Illustration from './sms-settings-illustration.component';
35-
import { Header } from '../shared-components';
3631
import styles from './sms-settings.scss';
3732

38-
interface SMSSettingsContentProps {
39-
backButton?: {
40-
label: string;
41-
onClick: () => void;
42-
};
43-
}
44-
45-
const SMSSettingsContent: React.FC<SMSSettingsContentProps> = ({ backButton }) => {
33+
const SMSSettingsContent: React.FC = () => {
4634
const { t } = useTranslation();
4735
const isTablet = useLayoutType() === 'tablet';
4836
const { smsSettings, isLoading, isError, mutate } = useSMSSettings();
@@ -133,15 +121,8 @@ const SMSSettingsContent: React.FC<SMSSettingsContentProps> = ({ backButton }) =
133121
}
134122

135123
return (
136-
<>
137-
<Header
138-
illustrationComponent={<Illustration />}
139-
title={t('sms', 'SMS')}
140-
backButton={backButton}
141-
/>
142-
<div className={styles.smsSettingsContent}>
143-
<div className={styles.settingsContainer}>
144-
{/* Appointment Reminder Settings */}
124+
<div className={styles.smsSettingsContent}>
125+
<div className={styles.settingsContainer}>
145126
<Tile className={styles.settingsSection}>
146127
<div className={styles.sectionHeader}>
147128
<div>
@@ -213,7 +194,6 @@ const SMSSettingsContent: React.FC<SMSSettingsContentProps> = ({ backButton }) =
213194
</Layer>
214195
</Tile>
215196

216-
{/* SMS Server Configuration */}
217197
<Tile className={styles.settingsSection}>
218198
<div className={styles.sectionHeader}>
219199
<div>
@@ -295,7 +275,6 @@ const SMSSettingsContent: React.FC<SMSSettingsContentProps> = ({ backButton }) =
295275
</div>
296276
</Tile>
297277

298-
{/* Advanced Configuration */}
299278
<Tile className={styles.settingsSection}>
300279
<div className={styles.sectionHeader}>
301280
<div>
@@ -337,7 +316,6 @@ const SMSSettingsContent: React.FC<SMSSettingsContentProps> = ({ backButton }) =
337316
</Layer>
338317
</Tile>
339318

340-
{/* Save Actions */}
341319
<div className={styles.actionsBar}>
342320
<Button
343321
kind="primary"
@@ -348,9 +326,8 @@ const SMSSettingsContent: React.FC<SMSSettingsContentProps> = ({ backButton }) =
348326
{isSaving ? t('saving', 'Saving...') : t('saveSettings', 'Save Settings')}
349327
</Button>
350328
</div>
351-
</div>
352329
</div>
353-
</>
330+
</div>
354331
);
355332
};
356333

src/pages/system-admin/system-admin.component.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { useTranslation } from 'react-i18next';
3+
import { useNavigate } from 'react-router-dom';
34
import {
45
Connect,
56
Settings,
@@ -15,63 +16,64 @@ import styles from './system-admin.scss';
1516

1617
const SystemAdminDashboard: React.FC = () => {
1718
const { t } = useTranslation();
19+
const navigate = useNavigate();
1820

1921
const navItems = [
2022
{
2123
id: 'sync-profiles',
2224
label: t('syncProfiles', 'Sync Profiles'),
2325
description: t('syncProfilesDesc', 'Configure and manage FHIR sync profiles'),
2426
icon: Connect,
25-
path: '/system-admin/sync-profiles',
27+
path: '/sync-profiles',
2628
},
2729
{
2830
id: 'sync-task-types',
2931
label: t('syncTaskTypes', 'Sync Task Types'),
3032
description: t('syncTaskTypesDesc', 'Manage sync task types and view execution history'),
3133
icon: Settings,
32-
path: '/system-admin/sync-task-types',
34+
path: '/sync-task-types',
3335
},
3436
{
3537
id: 'schedule-tasks',
3638
label: t('scheduleTaskManager', 'Schedule Task Manager'),
3739
description: t('scheduleTaskManagerDesc', 'Schedule and automate recurring tasks'),
3840
icon: Calendar,
39-
path: '/system-admin/schedule-tasks',
41+
path: '/schedule-tasks',
4042
},
4143
{
4244
id: 'cohort-management',
4345
label: t('cohortManagement', 'Cohort Management'),
4446
description: t('cohortManagementDesc', 'Manage DSD refill groups and patient enrollment'),
4547
icon: Group,
46-
path: '/system-admin/cohort-management',
48+
path: '/cohort-management',
4749
},
4850
{
4951
id: 'viral-load-upload',
5052
label: t('viralLoadUpload', 'Viral Load Upload'),
5153
description: t('viralLoadUploadDesc', 'Upload viral load test results from CPHL'),
5254
icon: Upload,
53-
path: '/system-admin/viral-load-upload',
55+
path: '/viral-load-upload',
5456
},
5557
{
5658
id: 'sms-settings',
5759
label: t('sms', 'SMS'),
5860
description: t('smsDesc', 'Configure SMS gateway and view sent message logs'),
5961
icon: Mobile,
60-
path: '/system-admin/sms-settings',
62+
path: '/sms-settings',
6163
},
6264
{
6365
id: 'system-upgrades',
6466
label: t('systemUpgrades', 'System Updates & Upgrades'),
6567
description: t('systemUpgradesDesc', 'Execute system upgrades and update EMR components'),
6668
icon: Renew,
67-
path: '/system-admin/system-upgrades',
69+
path: '/system-upgrades',
6870
},
6971
{
7072
id: 'about-systems',
7173
label: t('aboutSystems', 'About Systems'),
7274
description: t('aboutSystemsDesc', 'View system information, version details, and facility code'),
7375
icon: Information,
74-
path: '/system-admin/about-systems',
76+
path: '/about-systems',
7577
},
7678
];
7779

@@ -85,18 +87,18 @@ const SystemAdminDashboard: React.FC = () => {
8587
{navItems.map((item) => {
8688
const Icon = item.icon;
8789
return (
88-
<a
90+
<button
8991
key={item.id}
9092
className={styles.dashboardCard}
91-
href={item.path}
93+
onClick={() => navigate(item.path)}
9294
>
9395
<div className={styles.cardIcon}>
9496
<Icon size={32} />
9597
</div>
9698
<h3>{item.label}</h3>
9799
<p>{item.description}</p>
98100
<ChevronRight size={20} className={styles.cardArrow} />
99-
</a>
101+
</button>
100102
);
101103
})}
102104
</div>

src/pages/system-admin/system-admin.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
border: 1px solid #e0e0e0;
2929
border-radius: 8px;
3030
padding: 1.5rem;
31-
text-decoration: none;
31+
text-align: left;
3232
color: inherit;
33+
cursor: pointer;
3334
transition: all 0.2s ease;
3435
position: relative;
3536

0 commit comments

Comments
 (0)