Skip to content

Commit

Permalink
fix: allow setting href on footer logo (#2132)
Browse files Browse the repository at this point in the history
* fix: allow setting href on footer logo

* docs: document new props
  • Loading branch information
felix-ico authored Sep 22, 2023
1 parent df45405 commit 502f9ae
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/components/src/components/telekom/logo/logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class Logo {
window.scrollTo({ top: 0 });
}
}}
title={this.logoHideTitle ? '' : this.logoTitle}
title={this.logoHideTitle ? undefined : this.logoTitle}
aria-describedby={this.logoAriaDescribedBy}
aria-hidden={this.logoAriaHidden}
tabindex={this.logoAriaHidden ? -1 : 0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
<!-- Auto Generated Below -->


## Properties

| Property | Attribute | Description | Type | Default |
| --------------- | ----------------- | ---------------------------------- | --------- | ----------------------- |
| `logoHideTitle` | `logo-hide-title` | (optional) set logo specific title | `boolean` | `false` |
| `logoHref` | `logo-href` | (optional) Logo link | `string` | `'javascript:void(0);'` |
| `logoTitle` | `logo-title` | (optional) set logo specific title | `string` | `'Telekom Logo'` |


## Shadow Parts

| Part | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,21 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import { Component, h, Host } from '@stencil/core';
import { Component, h, Host, Prop } from '@stencil/core';

@Component({
tag: 'scale-telekom-footer-content',
styleUrl: 'telekom-footer-content.css',
shadow: true,
})
export class TelekomFooterContent {
/** (optional) Logo link */
@Prop() logoHref?: string = 'javascript:void(0);';
/** (optional) set logo specific title */
@Prop() logoTitle?: string = 'Telekom Logo';
/** (optional) set logo specific title */
@Prop() logoHideTitle?: boolean = false;

render() {
return (
<Host>
Expand All @@ -32,6 +39,9 @@ export class TelekomFooterContent {
'var(--telekom-line-weight-highlight) solid var(--telekom-color-functional-focus-on-dark-background)',
}}
transparent
href={this.logoHref}
logoHideTitle={this.logoHideTitle}
logoTitle={this.logoHideTitle ? undefined : this.logoTitle}
></scale-logo>
</div>
<div part="body">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script>
export default {
name: 'FooterContent',
props: {
logoHref: { type: String, default: 'javascript:void(0);' },
logoTitle: { type: String, default: 'Telekom Logo' },
logoHideTitle: { type: Boolean, default: false }
}
};
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { Meta, ArgsTable, Story, Canvas } from '@storybook/addon-docs';
import TelekomFooter from './Footer.vue';
import TelekomFooterDataBackCompat from './TelekomFooterDataBackCompat.vue';
import { footerNavigation } from './fixtures';
import FooterContent from './FooterContent.vue';

<Meta
title="Components/Telekom Footer"
component={TelekomFooter}
subcomponents={{'Telekom Footer Content': FooterContent}}
argTypes={{
type: {
control: { type: 'select' },
Expand Down

0 comments on commit 502f9ae

Please sign in to comment.