Skip to content

Commit 3a3108d

Browse files
committed
refactor(components): add types and clean imports
Add TypeScript declarations for LoadingSkeleton component to improve type safety across the app. Extend the component registry for better type inference. Update LeaderboardPageEntriesTableSkeletonRow to include typed Args for rankText, enhancing component API clarity. Remove unused imports (task, tracked) from entries-table component to clean up the codebase and reduce clutter.
1 parent 3fd2b3b commit 3a3108d

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

app/components/leaderboard-page/entries-table.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import type LeaderboardEntryModel from 'codecrafters-frontend/models/leaderboard
55
import type LeaderboardRankCalculationModel from 'codecrafters-frontend/models/leaderboard-rank-calculation';
66
import type Store from '@ember-data/store';
77
import { inject as service } from '@ember/service';
8-
import { task } from 'ember-concurrency';
9-
import { tracked } from '@glimmer/tracking';
108

119
interface Signature {
1210
Element: HTMLDivElement;

app/components/leaderboard-page/entries-table/skeleton-row.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import Component from '@glimmer/component';
22

33
interface Signature {
44
Element: HTMLTableRowElement;
5+
6+
Args: {
7+
rankText: string;
8+
};
59
}
610

711
export default class LeaderboardPageEntriesTableSkeletonRow extends Component<Signature> {}

app/components/loading-skeleton.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ export default class LoadingSkeleton extends Component<Signature> {
2020
}
2121
}
2222
}
23+
24+
declare module '@glint/environment-ember-loose/registry' {
25+
export default interface Registry {
26+
LoadingSkeleton: typeof LoadingSkeleton;
27+
}
28+
}

0 commit comments

Comments
 (0)