Let's make our app a bit visually pleasing by adding some images. The perfect place to do this is in the TaskListEmptyState
component.
Download the following image and put it at ssets/no-tasks-light.png
.
Modify your plugin to add an assets
property like the in the code below:
Basically, we're telling BlueBase that the said image has an ID NoTasks
and where to find it. Now we can just reference this image by this ID and BlueBase will take care of loading and rendering it across formats.
Modify the ComponentState
node in the TaskListEmptyState
component and add a prop imageSource="NoTasks"
as shown in the code below:
Now when you refresh the app, you should see an image in the empty state.
Sometimes we need a different variant of an image for dark mode. Don't worry, we have got you covered here as well.
Download the following image and put it at: assets/no-tasks-dark.png
.
Now, modify the assets property in the plugin to match the following:
Try refreshing your app. You'll see different images will be rendered in light mode and dark mode.
Basically, you can define a different image with the same ID (NoTasks
in this example) for all of the following scenarios:
NoTasks
Default version
NoTasks_dark
Dark mode version
NoTasks_light
Light mode verion
NoTasks_desktop
Desktop Screen Size version
NoTasks_mobile
Mobile Screen Size version
NoTasks_desktop_dark
Desktop Screen Size version on Dark mode
NoTasks_mobile_dark
Mobile Screen Size version on Dark mode
NoTasks_desktop_light
Desktop Screen Size version on Light mode
NoTasks_mobile_light
Mobile Screen Size version on Light mode