Skip to content

Commit

Permalink
add TS component
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitpaulk committed May 13, 2024
1 parent 96a0080 commit ee49ebc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/components/course-page/repository-dropdown.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@
<div class="">
{{#each this.nonActiveRepositories as |repository|}}
<CoursePage::RepositoryDropdown::NonActiveRepositoryLink
@onClick={{fn this.handleRepositoryLinkClick repository dd.actions}}
@repository={{repository}}
{{on "click" (fn this.handleRepositoryLinkClick repository dd.actions)}}
/>
{{/each}}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{{! @glint-nocheck: not typesafe yet }}
<div
class="flex justify-between items-center py-2 pl-2 pr-3 hover:bg-gray-50 group cursor-pointer"
role="button"
data-test-repository-link
{{on "click" @onClick}}
...attributes
>
<div class="flex items-center mr-6">
<img src={{@repository.language.grayLogoUrl}} alt={{@repository.language.name}} class="w-4 h-4 mr-2 block group-hover:hidden" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Component from '@glimmer/component';
import type RepositoryModel from 'codecrafters-frontend/models/repository';

interface Signature {
Element: HTMLDivElement;

Args: {
repository: RepositoryModel;
};

Blocks: {
default: [];
};
}

export default class NonActiveRepositoryLinkComponent extends Component<Signature> {}

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
'CoursePage::RepositoryDropdown::NonActiveRepositoryLink': typeof NonActiveRepositoryLinkComponent;
}
}

0 comments on commit ee49ebc

Please sign in to comment.