Skip to content

Commit

Permalink
fix(footer): try to use new locale changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ariellalgilmore committed Nov 8, 2023
1 parent 4802032 commit 000202b
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions packages/web-components/src/components/footer/footer-composite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ class C4DFooterComposite extends MediaQueryMixin(
/**
* Handles `click` event on the locale button.
*/
private _handleClickLocaleButton = () => {
private async _handleClickLocaleButton() {
this.openLocaleModal = true;

// Set 'open' attribute after modal is in dom so CSS can fade it in.
// await this.updateComplete;
await this.updateComplete;
const composite = this.modalRenderRoot?.querySelector(
'c4d-locale-modal-composite'
);
composite?.setAttribute('open', '');
};
}

@state()
_isMobile = this.carbonBreakpoints.lg.matches;
Expand Down Expand Up @@ -205,11 +205,16 @@ class C4DFooterComposite extends MediaQueryMixin(
@property({ attribute: false })
localeList?: LocaleList;

/**
* @inheritdoc
*/
modalTriggerProps = ['openLocaleModal', 'localeList'];

/**
* `true` to open the locale modal.
*/
@property({ type: Boolean, attribute: 'open-locale-modal' })
openLocaleModal = false;
openLocaleModal;

/**
* Footer size.
Expand Down Expand Up @@ -260,16 +265,17 @@ class C4DFooterComposite extends MediaQueryMixin(
openLocaleModal,
_loadLocaleList: loadLocaleList,
} = this;
return html`
<c4d-locale-modal-composite
lang-display="${ifDefined(langDisplay)}"
language="${ifDefined(language)}"
?open="${openLocaleModal}"
.collatorCountryName="${ifDefined(collatorCountryName)}"
.localeList="${ifDefined(localeList)}"
._loadLocaleList="${ifDefined(loadLocaleList)}">
</c4d-locale-modal-composite>
`;
return openLocaleModal
? html`
<c4d-locale-modal-composite
lang-display="${ifDefined(langDisplay)}"
language="${ifDefined(language)}"
.collatorCountryName="${ifDefined(collatorCountryName)}"
.localeList="${ifDefined(localeList)}"
._loadLocaleList="${ifDefined(loadLocaleList)}">
</c4d-locale-modal-composite>
`
: html``;
}

renderLanguageSelector(slot = 'language-selector') {
Expand Down

0 comments on commit 000202b

Please sign in to comment.