-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visually differentiate sort components from filter components #200
base: master
Are you sure you want to change the base?
Visually differentiate sort components from filter components #200
Conversation
The result looks really good. |
I probably won't be able to work that hard on the project anytime soon, as I need to work a little at another job to earn some money) But I will do it when I have free time. |
That's awesome! Congrats for landing the new job :) |
@sebastientromp, I still feel like the sort components should be a separate component as they have different user interaction logic and perhaps in the future we may want to further differentiate sort components from filter components. For example, we may want to implement sorting in descending or ascending order, etc. While using the |
Yes, I agree that having different components make more sense. Let me think about it for a bit. |
|
||
@Component({ | ||
selector: 'sort-dropdown', | ||
styleUrls: [`../../css/global/scrollbar.scss`, `../../css/component/sort-dropdown.component.scss`], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I would reference the .scss of the filter-dropdown component, and use a new file only for the style that is specific to that new component. This would make it easier to understand the differences between the two
`, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class SortDropdownComponent implements AfterViewInit { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here I would use an abstract, parent component that contains the shared code, and use subclasses to redefine the behavior where appropriate.
The "filter" and "sort" functions are IMO intrinsically very similar, and I don't see them diverging a lot in the future. And if they do, it will most likely be through the options they propose, or how option selection is handled. This means that all the layout is probably best handled in a common way.
Would you like me to do it? Or would you like to give it a try?
07b0da7
to
fe6d979
Compare
159c76c
to
ef452e5
Compare
Before:
After:
Before:
After:
Before:
After:
Before:
After: