Skip to content

Commit 502f9ae

Browse files
authored
fix: allow setting href on footer logo (#2132)
* fix: allow setting href on footer logo * docs: document new props
1 parent df45405 commit 502f9ae

File tree

5 files changed

+33
-2
lines changed

5 files changed

+33
-2
lines changed

packages/components/src/components/telekom/logo/logo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class Logo {
9393
window.scrollTo({ top: 0 });
9494
}
9595
}}
96-
title={this.logoHideTitle ? '' : this.logoTitle}
96+
title={this.logoHideTitle ? undefined : this.logoTitle}
9797
aria-describedby={this.logoAriaDescribedBy}
9898
aria-hidden={this.logoAriaHidden}
9999
tabindex={this.logoAriaHidden ? -1 : 0}

packages/components/src/components/telekom/telekom-footer/readme.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
<!-- Auto Generated Below -->
66

77

8+
## Properties
9+
10+
| Property | Attribute | Description | Type | Default |
11+
| --------------- | ----------------- | ---------------------------------- | --------- | ----------------------- |
12+
| `logoHideTitle` | `logo-hide-title` | (optional) set logo specific title | `boolean` | `false` |
13+
| `logoHref` | `logo-href` | (optional) Logo link | `string` | `'javascript:void(0);'` |
14+
| `logoTitle` | `logo-title` | (optional) set logo specific title | `string` | `'Telekom Logo'` |
15+
16+
817
## Shadow Parts
918

1019
| Part | Description |

packages/components/src/components/telekom/telekom-footer/telekom-footer-content.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,21 @@
99
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
1010
*/
1111

12-
import { Component, h, Host } from '@stencil/core';
12+
import { Component, h, Host, Prop } from '@stencil/core';
1313

1414
@Component({
1515
tag: 'scale-telekom-footer-content',
1616
styleUrl: 'telekom-footer-content.css',
1717
shadow: true,
1818
})
1919
export class TelekomFooterContent {
20+
/** (optional) Logo link */
21+
@Prop() logoHref?: string = 'javascript:void(0);';
22+
/** (optional) set logo specific title */
23+
@Prop() logoTitle?: string = 'Telekom Logo';
24+
/** (optional) set logo specific title */
25+
@Prop() logoHideTitle?: boolean = false;
26+
2027
render() {
2128
return (
2229
<Host>
@@ -32,6 +39,9 @@ export class TelekomFooterContent {
3239
'var(--telekom-line-weight-highlight) solid var(--telekom-color-functional-focus-on-dark-background)',
3340
}}
3441
transparent
42+
href={this.logoHref}
43+
logoHideTitle={this.logoHideTitle}
44+
logoTitle={this.logoHideTitle ? undefined : this.logoTitle}
3545
></scale-logo>
3646
</div>
3747
<div part="body">
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<script>
2+
export default {
3+
name: 'FooterContent',
4+
props: {
5+
logoHref: { type: String, default: 'javascript:void(0);' },
6+
logoTitle: { type: String, default: 'Telekom Logo' },
7+
logoHideTitle: { type: Boolean, default: false }
8+
}
9+
};
10+
</script>

packages/storybook-vue/stories/components/telekom-footer/TelekomFooter.stories.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { Meta, ArgsTable, Story, Canvas } from '@storybook/addon-docs';
22
import TelekomFooter from './Footer.vue';
33
import TelekomFooterDataBackCompat from './TelekomFooterDataBackCompat.vue';
44
import { footerNavigation } from './fixtures';
5+
import FooterContent from './FooterContent.vue';
56

67
<Meta
78
title="Components/Telekom Footer"
89
component={TelekomFooter}
10+
subcomponents={{'Telekom Footer Content': FooterContent}}
911
argTypes={{
1012
type: {
1113
control: { type: 'select' },

0 commit comments

Comments
 (0)