Skip to content

Commit

Permalink
Table toolbar style overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen committed Feb 15, 2024
1 parent e85b411 commit 3364f4b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 33 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
import dayjs from 'dayjs';
import React from 'react';
import dayjs from 'dayjs';
import { useTranslation } from 'react-i18next';
import { omrsDateFormat } from '../../constants';
import {
DataTableSkeleton,
Button,
DataTable,
TableContainer,
DataTableSkeleton,
Table,
TableHead,
TableRow,
TableHeader,
TableBody,
TableCell,
TableContainer,
TableHead,
TableHeader,
TableRow,
TableToolbar,
TableToolbarContent,
TableToolbarSearch,
Button,
} from '@carbon/react';
import { Download } from '@carbon/react/icons';
import { ExtensionSlot, formatDate, formatDatetime } from '@openmrs/esm-framework';
import { downloadAppointmentsAsExcel } from '../../helpers/excel';
import { Download } from '@carbon/react/icons';
import styles from './calenar-patient-list.scss';
import { omrsDateFormat } from '../../constants';
import { useAppointments } from '../../hooks/useAppointments';
import styles from './calendar-patient-list.scss';

interface CalendarPatientListProps {}

const CalendarPatientList: React.FC<CalendarPatientListProps> = () => {
const CalendarPatientList: React.FC = () => {
const { t } = useTranslation();
const currentPathName: string = decodeURI(window.location.pathname);
const serviceName = currentPathName.split('/')[7];
Expand Down Expand Up @@ -84,7 +82,7 @@ const CalendarPatientList: React.FC<CalendarPatientListProps> = () => {
</div>
<DataTable rows={rowData} headers={headers}>
{({ rows, headers, getHeaderProps, getRowProps, getBatchActionProps, onInputChange }) => (
<TableContainer title={`${t('count', 'Count')} ${rowData.length}`}>
<TableContainer className={styles.tableContainer} title={`${t('count', 'Count')} ${rowData.length}`}>
<TableToolbar>
<TableToolbarContent>
<TableToolbarSearch
Expand All @@ -94,7 +92,7 @@ const CalendarPatientList: React.FC<CalendarPatientListProps> = () => {
<Button
size="lg"
kind="tertiary"
renderIcon={Download}
renderIcon={(props) => <Download size={16} {...props} />}
onClick={() =>
downloadAppointmentsAsExcel(
appointments,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@use '@carbon/styles/scss/type';
@use '@carbon/colors';

.container {
margin: 1rem;
}

.header {
margin-bottom: 1rem;
& > h2 {
@include type.type-style('heading-02');
color: colors.$gray-100;
}
}

.tableContainer {
:global(.cds--table-toolbar) {
position: relative;
height: 3rem;
min-height: 0rem;
overflow: visible;
top: 0;
}

&:global(.cds--data-table-container) {
padding-top: 0rem;
}
}

0 comments on commit 3364f4b

Please sign in to comment.