Skip to content

Commit af1ec5b

Browse files
committed
add icons to toolbar components
1 parent 59b050a commit af1ec5b

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/features/common/components/card-toolbar-buttons/card-toolbar-clear-button/card-toolbar-clear-button.component.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
CardToolbarButtonComponent,
55
CardToolbarButtonComponentProps,
66
} from "@/features/common/components/card-toolbar-button/card-toolbar-button.component";
7+
import { ClearIcon } from "../../icons/clear/clear-icon";
78

89
interface CardToolbarClearButtonComponentProps
910
extends Omit<CardToolbarButtonComponentProps, "variant"> {
@@ -16,8 +17,12 @@ export const CardToolbarClearButtonComponent: React.FC<
1617
const dictionary = getButtonsUiDictionary(languageCode);
1718

1819
return (
19-
<CardToolbarButtonComponent {...props} variant="standard">
20-
{dictionary.clearButton.label}
20+
<CardToolbarButtonComponent
21+
{...props}
22+
variant="standard"
23+
tooltipText={dictionary.clearButton.label}
24+
>
25+
<ClearIcon />
2126
</CardToolbarButtonComponent>
2227
);
2328
};

src/features/common/components/card-toolbar-buttons/card-toolbar-copy-button/card-toolbar-copy-button.component.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import {
44
CardToolbarButtonComponentProps,
55
} from "@/features/common/components/card-toolbar-button/card-toolbar-button.component";
66
import { getButtonsUiDictionary } from "@/features/localization/services/ui-language-dictionary.service";
7+
import { CopyIcon } from "../../icons/copy/copy-icon";
8+
import { CheckIcon } from "../../icons/check/check-icon";
79

810
interface CardToolbarCopyButtonComponentProps
911
extends Omit<PropsWithChildren<CardToolbarButtonComponentProps>, "variant"> {
@@ -15,7 +17,6 @@ export const CardToolbarCopyButtonComponent: React.FC<
1517
CardToolbarCopyButtonComponentProps
1618
> = ({ languageCode, value, isDisabled, ...props }) => {
1719
const dictionary = getButtonsUiDictionary(languageCode);
18-
1920
const [isCopied, setIsCopied] = useState(false);
2021

2122
const resetCopy = () => {
@@ -36,10 +37,13 @@ export const CardToolbarCopyButtonComponent: React.FC<
3637
onPress={copyValue}
3738
onBlur={resetCopy}
3839
variant="standard"
40+
tooltipText={
41+
isCopied
42+
? dictionary.copyButton.done.label
43+
: dictionary.copyButton.idle.label
44+
}
3945
>
40-
{isCopied
41-
? dictionary.copyButton.done.label
42-
: dictionary.copyButton.idle.label}
46+
{isCopied ? <CheckIcon /> : <CopyIcon />}
4347
</CardToolbarButtonComponent>
4448
);
4549
};

0 commit comments

Comments
 (0)