Skip to content

Commit 9287100

Browse files
committed
feat(ButtonMobileStore): add title prop
Prop to be used as title for the image
1 parent 16f957b commit 9287100

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

packages/orbit-components/src/ButtonMobileStore/README.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@ After adding import into your project you can use it simply like:
1616

1717
Table below contains all types of the props available in the ButtonMobileStore component.
1818

19-
| Name | Type | Default | Description |
20-
| :-------------- | :------------------------- | :------ | :-------------------------------------------------------------------------------------------------------------- |
21-
| alt | `string` | | Optional property for passing own `alt` attribute to the DOM image element. |
22-
| dataTest | `string` | | Optional prop for testing purposes. |
23-
| id | `string` | | Set `id` for `ButtonMobileStore` |
24-
| href | `string` | | The URL to link when the ButtonMobileStore is clicked. |
25-
| onClick | `event => void \| Promise` | | Function for handling onClick event. |
26-
| stopPropagation | `boolean` | | If `true` the click event won't bubble. Useful when you use ButtonMobileStore inside another clickable element. |
27-
| **type** | [`enum`](#enum) | | The type of the ButtonMobileStore. |
28-
| lang | [`enum`](#enum) | `EN` | The language of button |
19+
| Name | Type | Default | Description |
20+
| :-------------- | :------------------------- | :----------- | :---------------------------------------------------------------------------- |
21+
| alt | `string` | | Optional property for passing own `alt` attribute to the DOM image element. |
22+
| title | `string` | | Optional property for passing own `title` attribute to the DOM image element. |
23+
| dataTest | `string` | | Optional prop for testing purposes. |
24+
| id | `string` | | Set `id` for `ButtonMobileStore`. |
25+
| href | `string` | | The URL to link when the ButtonMobileStore is clicked. |
26+
| onClick | `event => void \| Promise` | | Function for handling onClick event. |
27+
| stopPropagation | `boolean` | | If `true` the click event won't bubble. |
28+
| type | [`enum`](#enum) | `"appStore"` | The type of the ButtonMobileStore. |
29+
| lang | [`enum`](#enum) | `EN` | The language of the image displayed on the button. |
2930

3031
### enum
3132

packages/orbit-components/src/ButtonMobileStore/index.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const ButtonMobileStore = ({
1818
onClick,
1919
dataTest,
2020
id,
21-
alt = "",
21+
alt,
22+
title,
2223
stopPropagation = false,
2324
}: Props) => {
2425
const onClickHandler = (ev: React.MouseEvent<HTMLAnchorElement>) => {
@@ -39,7 +40,7 @@ const ButtonMobileStore = ({
3940
data-test={dataTest}
4041
id={id}
4142
>
42-
<img srcSet={getSrc(type, lang)} height="40px" alt={alt} />
43+
<img srcSet={getSrc(type, lang)} height="40px" alt={alt} title={title} />
4344
</a>
4445
);
4546
};

packages/orbit-components/src/ButtonMobileStore/types.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface Props extends Common.Globals {
1111
readonly stopPropagation?: boolean;
1212
readonly href?: string;
1313
readonly alt?: string;
14+
readonly title?: string;
1415
readonly lang?: string;
1516
readonly onClick?: (ev: React.MouseEvent<HTMLAnchorElement>) => void;
1617
}

0 commit comments

Comments
 (0)