Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) O3-2840: Download button and TableToolbarSearch component shouldn't overlap #981

Merged
merged 3 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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;
}
}
Loading