Let's make our app a bit visually pleasing by adding some images. The perfect place to do this is in the TaskListEmptyState component.
Step 1: Download Image
Download the following image and put it at ssets/no-tasks-light.png.
Step 2: Add the Image to the Plugin
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.
Step 3: Use the Image in the Component
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.
Step 4: Use a Different Image for Dark Mode
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:
Desktop Screen Size version
Mobile Screen Size version
Desktop Screen Size version on Dark mode
Mobile Screen Size version on Dark mode
Desktop Screen Size version on Light mode
Mobile Screen Size version on Light mode