-
Notifications
You must be signed in to change notification settings - Fork 887
refactor: use WidgetsIcon for null resources #3754
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
refactor: use WidgetsIcon for null resources #3754
Conversation
NICE! 👍🏼 |
@jsjoeio is the unknown resource still a Edit: answered my own question, I think we should changed this to the widget icon too
|
resolves #3301 |
Nice catch! I'll update that now then re-request a review. |
// this resource can return undefined | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | ||
const IconComponent = iconByResource[type] ?? HelpIcon | ||
const IconComponent = iconByResource[type] ?? WidgetsIcon |
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.
Since the resource can be undefined
, I modified the return type of iconByResource
to match that, which lets us remove this eslint
line.
728ceeb
to
459cbd9
Compare
Based on user feedback, we believe the `WidgetsIcon` will cause less confusion.
Before, we were using `string` for `type` in `ResourceAvatar`. This meant it wasn't tied to the types generated from the backend. Now it imports `WorkspaceResource` so that there is a single source of truth and they always stay in sync.
459cbd9
to
6716acc
Compare
This PR updates the icon used for null resources
Previous icon used:
h/t to @kconley-sq for the suggestion! 🎉
Also found another issue which I will tackle after this: #3767