-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1713 from codecrafters-io/update-course-listing
Include stage counts in switch repository flow
- Loading branch information
Showing
4 changed files
with
62 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 30 additions & 14 deletions
44
app/components/course-page/repository-dropdown/non-active-repository-link.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,33 @@ | ||
{{! @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}} | ||
> | ||
<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" /> | ||
<img src={{@repository.language.tealLogoUrl}} alt={{@repository.language.name}} class="w-4 h-4 mr-2 hidden group-hover:block" /> | ||
<span class="text-gray-700">{{@repository.name}}</span> | ||
<div class="flex justify-between items-center py-2 px-3 hover:bg-gray-50 group cursor-pointer" role="button" data-test-repository-link ...attributes> | ||
<div> | ||
<div class="flex items-center"> | ||
<span class="text-gray-700 text-sm">{{@repository.name}}</span> | ||
|
||
<div class="text-gray-400 text-xs ml-1"> | ||
{{#if @repository.lastSubmissionAt}} | ||
(pushed | ||
{{date-from-now @repository.lastSubmissionAt}}) | ||
{{else}} | ||
(not pushed yet) | ||
{{/if}} | ||
</div> | ||
</div> | ||
|
||
<div class="text-gray-400 text-xs mt-1"> | ||
{{@repository.completedStages.length}} | ||
/ | ||
{{@repository.course.stages.length}} | ||
stages | ||
</div> | ||
</div> | ||
|
||
{{#if @repository.lastSubmissionAt}} | ||
<span class="text-gray-400 text-xs">(pushed {{date-from-now @repository.lastSubmissionAt}})</span> | ||
{{/if}} | ||
<div class="text-gray-400 text-xs ml-6"> | ||
<img | ||
src={{@repository.language.grayLogoUrl}} | ||
alt={{@repository.language.name}} | ||
class="opacity-75 w-6 h-6 block group-hover:hidden flex-shrink-0" | ||
/> | ||
|
||
<img src={{@repository.language.tealLogoUrl}} alt={{@repository.language.name}} class="w-6 h-6 hidden group-hover:block flex-shrink-0" /> | ||
</div> | ||
</div> |
22 changes: 22 additions & 0 deletions
22
app/components/course-page/repository-dropdown/non-active-repository-link.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |