feat: rename categories > category and topics > topic #299
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Breaking Change!
We've renamed the
categoriesproperty tocategoryand thetopicsproperty totopic, to reflect that these properties only support a single value. We haven't been supporting multiple categories or topics for a while now, and believe that renaming this property is the right thing to do. It requires a small change on your end, but the clear naming reduces the number of potential bugs caused by misunderstanding.If you make use of different stores or tabs using the
categoriesortopicsproperties, you'll need to rename them to their singular variants.import MagicBell, { FloatingNotificationInbox } from '@magicbell/magicbell-react'; import React from 'react'; const stores = [ { id: 'default', defaultQueryParams: {} }, { id: 'unread', defaultQueryParams: { read: false } }, - { id: 'billing', defaultQueryParams: { categories: ['billing'] } }, + { id: 'billing', defaultQueryParams: { category: 'billing' } }, - { id: 'support', defaultQueryParams: { topics: ['support'] } }, + { id: 'support', defaultQueryParams: { topic: 'support' } }, ]; const tabs = [ { storeId: 'default', label: 'Latest' }, { storeId: 'unread', label: 'Archive' }, { storeId: 'billing', label: 'Billing' }, { storeId: 'support', label: 'Issues' }, ]; export default function Index() { return ( <MagicBell apiKey="__MAGICBELL_API_KEY__" userEmail="__MAGICBELL_USER_EMAIL__" userKey="__MAGICBELL_USER_KEY__" stores={stores} defaultIsOpen > {(props) => <FloatingNotificationInbox height={450} tabs={tabs} {...props} />} </MagicBell> ); }Likewise, when you filter notifications using our cli, you might need to change some arguments: