Skip to content

Commit

Permalink
okay time to split
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellacosse committed Aug 15, 2024
1 parent d921626 commit 860ac82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions client/src/www/views/language_view/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import '@material/web/icon/icon.js';
@customElement('language-view')
export class LanguageView extends LitElement {
@property({type: Array}) languages!: {id: string; name: string}[];
@property({type: String}) selectedLanguageID!: string;
@property({type: String, attribute: 'selected-language-id'}) selectedLanguageID!: string;

static styles = css`
:host {
Expand Down Expand Up @@ -64,13 +64,11 @@ export class LanguageView extends LitElement {
}

private handleLanguageSelection({target}: Event) {
const languageCode = (target as HTMLInputElement)?.value || '';

this.dispatchEvent(
new CustomEvent('SetLanguageRequested', {
bubbles: true,
composed: true,
detail: {languageCode},
detail: {languageCode: (target as HTMLInputElement).value},
})
);
}
Expand Down
6 changes: 3 additions & 3 deletions client/src/www/views/language_view/stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ export default {
title: 'Client/Language View',
component: 'contact-view',
args: {
selectedLanguage: 'en',
selectedLanguageID: 'en',
languages: [
{id: 'en', name: 'English'},
{id: 'es', name: 'Español'},
],
},
};

export const Example = ({selectedLanguage, languages}: LanguageView) => html`
export const Example = ({selectedLanguageID, languages}: LanguageView) => html`
<language-view
selectedLanguage=${selectedLanguage}
selected-language-id=${selectedLanguageID}
.languages=${languages}
></language-view>
`;

0 comments on commit 860ac82

Please sign in to comment.