fix: FavoriteGifSearch (#1842)

This commit is contained in:
Syncx 2023-10-25 18:10:50 +05:30 committed by V
parent cb93c11e16
commit 922e3ce6fe

View file

@ -91,13 +91,13 @@ export default definePlugin({
patches: [ patches: [
{ {
find: "renderCategoryExtras", find: "renderHeaderContent()",
replacement: [ replacement: [
{ {
// https://regex101.com/r/4uHtTE/1 // https://regex101.com/r/07gpzP/1
// ($1 renderHeaderContent=function { ... switch (x) ... case FAVORITES:return) ($2) ($3 case default:return r.jsx(($<searchComp>), {...props})) // ($1 renderHeaderContent=function { ... switch (x) ... case FAVORITES:return) ($2) ($3 case default:return r.jsx(($<searchComp>), {...props}))
match: /(renderHeaderContent=function.{1,150}FAVORITES:return)(.{1,150};)(case.{1,200}default:return\(0,\i\.jsx\)\((?<searchComp>\i\.\i))/, match: /(renderHeaderContent\(\).{1,150}FAVORITES:return)(.{1,150});(case.{1,200}default:return\(0,\i\.jsx\)\((?<searchComp>\i\..{1,10}),)/,
replace: "$1 this.state.resultType === \"Favorites\" ? $self.renderSearchBar(this, $<searchComp>) : $2; $3" replace: "$1 this.state.resultType === 'Favorites' ? $self.renderSearchBar(this, $<searchComp>) : $2;$3"
}, },
{ {
// to persist filtered favorites when component re-renders. // to persist filtered favorites when component re-renders.
@ -182,7 +182,7 @@ function SearchBar({ instance, SearchBarComponent }: { instance: Instance; Searc
ref={ref} ref={ref}
autoFocus={true} autoFocus={true}
className={containerClasses.searchBar} className={containerClasses.searchBar}
size={SearchBarComponent.Sizes.MEDIUM} size={SearchBarComponent.Sizes.SMALL}
onChange={onChange} onChange={onChange}
onClear={() => { onClear={() => {
setQuery(""); setQuery("");