-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(poweredBy): Let users define their own poweredBy template
Fixes: #1047 You can now pass an object to `poweredBy` like this: ```javascript poweredBy: { template: 'Link to {{data.url}}', // Also accepts function cssClasses: { root: 'applied to wrapper', link: 'applied to link' } } ``` Everything is handled directly in the widget, without the need for a React component. This was overkill because we never update the render of the `poweredBy` so it was easier to just generate the template at init time without going through all the process of creating a template. I've also added more thorough tests. Users will be able to independently change CSS classes or template.
- Loading branch information
1 parent
bf170a3
commit f1a96d8
Showing
5 changed files
with
250 additions
and
104 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default { | ||
poweredBy: ` | ||
<div class="{{cssClasses.root}}"> | ||
Search by | ||
<a class="{{cssClasses.link}}" href="{{url}}" target="_blank">Algolia</a> | ||
</div>` | ||
}; |
Oops, something went wrong.