Skip to content

Commit 4696392

Browse files
committed
responding to pr feedback
1 parent f5bb06c commit 4696392

File tree

4 files changed

+9
-21
lines changed

4 files changed

+9
-21
lines changed

packages/components/src/components/hds/code-editor/full-screen-button.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@isIconOnly={{true}}
55
@color="secondary"
66
@size="small"
7-
@icon={{this.icon}}
7+
@icon={{this.state}}
88
@text="Toggle full screen view"
99
{{on "click" @onToggleFullScreen}}
1010
/>

packages/components/src/components/hds/code-editor/full-screen-button.ts

+2-14
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,16 @@ export default class HdsCodeEditorFullScreenButton extends Component<HdsCodeEdit
2020
return this.args.isFullScreen ? 'minimize' : 'maximize';
2121
}
2222

23-
get className() {
23+
get className(): string {
2424
const classes = [
2525
'hds-code-editor__full-screen-button',
2626
'hds-code-editor__button',
2727
];
2828

29-
const stateClass = {
30-
minimize: 'hds-code-editor__full-screen-button--minimize',
31-
maximize: 'hds-code-editor__full-screen-button--maximize',
32-
}[this.state];
29+
const stateClass = `hds-code-editor__full-screen-button--${this.state}`;
3330

3431
classes.push(stateClass);
3532

3633
return classes.join(' ');
3734
}
38-
39-
get icon(): HdsButtonSignature['Args']['icon'] {
40-
const stateIcons = {
41-
minimize: 'minimize',
42-
maximize: 'maximize',
43-
} as const;
44-
45-
return stateIcons[this.state];
46-
}
4735
}

packages/components/src/components/hds/code-editor/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ export default class HdsCodeEditor extends Component<HdsCodeEditorSignature> {
8787
}
8888

8989
@action
90-
onInput(newVal: string): void {
91-
this._value = newVal;
92-
this.args.onInput?.(newVal);
90+
onInput(newValue: string): void {
91+
this._value = newValue;
92+
this.args.onInput?.(newValue);
9393
}
9494

9595
@action

packages/components/src/modifiers/hds-code-editor.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface HdsCodeEditorSignature {
3131
};
3232
}
3333

34-
async function defineStreamLangugage(streamParser: StreamParser<unknown>) {
34+
async function defineStreamLanguage(streamParser: StreamParser<unknown>) {
3535
const { StreamLanguage } = await import('@codemirror/language');
3636

3737
return StreamLanguage.define(streamParser);
@@ -46,13 +46,13 @@ const LANGUAGES: Record<
4646
ruby: {
4747
load: async () => {
4848
const { ruby } = await import('@codemirror/legacy-modes/mode/ruby');
49-
return defineStreamLangugage(ruby);
49+
return defineStreamLanguage(ruby);
5050
},
5151
},
5252
shell: {
5353
load: async () => {
5454
const { shell } = await import('@codemirror/legacy-modes/mode/shell');
55-
return defineStreamLangugage(shell);
55+
return defineStreamLanguage(shell);
5656
},
5757
},
5858
go: {

0 commit comments

Comments
 (0)