Skip to content

Commit

Permalink
feat: Changed text and icon for print function
Browse files Browse the repository at this point in the history
  • Loading branch information
edvinstava committed May 31, 2024
1 parent 444a3fd commit 105fd45
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 29 deletions.
26 changes: 0 additions & 26 deletions src/UI/Icons/PdfIcon.tsx

This file was deleted.

18 changes: 18 additions & 0 deletions src/UI/Icons/PrintIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';

export const PrintIcon = () => (
<svg
xmlns='http://www.w3.org/2000/svg'
id='Layer_1'
data-name='Layer 1'
viewBox='0 0 24 24'
width='20'
height='20'
>
<g id='_01_align_center' data-name='01 align center'>
{/* eslint-disable-next-line max-len */}
<path d='M24,9a3,3,0,0,0-3-3H19V0H5V6H3A3,3,0,0,0,0,9V21H5v3H19V21h5ZM7,2H17V6H7ZM17,22H7V16H17Zm5-3H19V14H5v5H2V9A1,1,0,0,1,3,8H21a1,1,0,0,1,1,1Z' />
<rect x='15' y='10' width='4' height='2' />
</g>
</svg>
);
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useState, useRef, useEffect } from 'react';
import i18n from '@dhis2/d2-i18n';
import { usePopper } from 'react-popper';
import { EllipsisButton } from './EllipsisButton';
import { PopoverList, PopoverListItem, PopoverListDivider } from './PopoverList';
import { CategoryCodes, ChartData } from '../../../types/chartDataTypes';
import { PdfIcon } from '../../../UI/Icons/PdfIcon';
import { MappedEntityValues } from '../../../utils/DataFetching/Sorting/useMappedTrackedEntity';
import { PrintDocument } from '../../../utils/ChartOptions';
import { PrintIcon } from '../../../UI/Icons/PrintIcon';

interface ChartSettingsButtonProps {
category: keyof typeof CategoryCodes;
Expand Down Expand Up @@ -67,8 +68,8 @@ export const ChartSettingsButton = ({
popoverAttributes={{ ...attributes.popper }}
>
<PopoverListItem
label='Convert to PDF'
icon={<PdfIcon />}
label={i18n.t('Print')}
icon={<PrintIcon />}
onClick={handlePrintDocument}
/>
<PopoverListDivider />
Expand Down

0 comments on commit 105fd45

Please sign in to comment.