Skip to content

Commit 5ab93e7

Browse files
committed
Remove unused theme prop from HideMoreResults
1 parent 1b8d63a commit 5ab93e7

File tree

5 files changed

+6
-12
lines changed

5 files changed

+6
-12
lines changed

.changelog/2343.internal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove MUI themes from search results

src/app/pages/SearchResultsPage/GlobalSearchResultsView.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
isOnMainnet,
1515
} from '../../../types/network'
1616
import { HideMoreResults, ShowMoreResults } from './ShowMoreResults'
17-
import { getThemeForScope } from '../../../styles/theme'
1817
import { orderByLayer } from '../../../types/layers'
1918
import { useRedirectIfSingleResult } from './useRedirectIfSingleResult'
2019
import { SearchParams } from '../../components/Search/search-utils'
@@ -47,7 +46,6 @@ export const GlobalSearchResultsView: FC<{
4746
}
4847

4948
const otherNetworks = RouteUtils.getEnabledNetworks().filter(isNotMainnet)
50-
const notificationTheme = getThemeForScope('testnet')
5149
const mainnetResults = searchResults.filter(isOnMainnet).sort(orderByLayer)
5250
const otherResults = searchResults.filter(isNotOnMainnet).sort(orderByLayer)
5351

@@ -66,7 +64,7 @@ export const GlobalSearchResultsView: FC<{
6664
{otherResults.length !== 0 &&
6765
(othersOpen ? (
6866
<>
69-
<HideMoreResults theme={notificationTheme} onHide={() => setOthersOpen(false)} />
67+
<HideMoreResults onHide={() => setOthersOpen(false)} />
7068
{otherNetworks.map(net => (
7169
<SearchResultsList
7270
key={net}
@@ -79,7 +77,6 @@ export const GlobalSearchResultsView: FC<{
7977
</>
8078
) : (
8179
<ShowMoreResults
82-
theme={notificationTheme}
8380
hasWantedResults={!!mainnetResults.length}
8481
otherResultsCount={otherResults.length}
8582
onShow={() => setOthersOpen(true)}

src/app/pages/SearchResultsPage/ResultListFrame.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const ResultListFrame: FC<{ children: React.ReactNode; networkForTheme: s
1616
<div
1717
className={cn(
1818
expectedTheme !== networkForTheme &&
19-
'[&_>_div_>_[data-slot="card"]]:rounded-none [&_>_div_>_[data-slot="card"]]:border-solid [&_>_div_>_[data-slot="card"]]:border-theme-layout-accent [&_>_div_>_[data-slot="card"]]:border-y-[10px] [&_>_div_>_[data-slot="card"]]:border-x-[1px]',
19+
'[&_>_div_>_[data-slot="card"]]:rounded-none [&_>_div_>_[data-slot="card"]]:border-solid [&_>_div_>_[data-slot="card"]]:border-theme-layout-accent [&_>_div_>_[data-slot="card"]]:border-y-[10px] [&_>_div_>_[data-slot="card"]]:border-x',
2020
networkForTheme,
2121
)}
2222
>

src/app/pages/SearchResultsPage/ScopedSearchResultsView.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { FC, useState } from 'react'
22
import { useTranslation } from 'react-i18next'
3-
import { getFilterForNetwork, getNetworkNames, isOnMainnet } from '../../../types/network'
3+
import { getFilterForNetwork, getNetworkNames } from '../../../types/network'
44
import {
55
getFilterForScope,
66
getNameForScope,
77
getInverseFilterForScope,
88
SearchScope,
99
} from '../../../types/searchScope'
10-
import { getThemeForScope } from '../../../styles/theme'
1110
import { RouteUtils } from '../../utils/route-utils'
1211
import { SearchResults } from './hooks'
1312
import { SearchResultsList } from './SearchResultsList'
@@ -31,7 +30,6 @@ export const ScopedSearchResultsView: FC<{
3130
const isNotInWantedScope = getInverseFilterForScope(wantedScope)
3231
const wantedResults = searchResults.filter(isInWantedScope)
3332
const otherResults = searchResults.filter(isNotInWantedScope)
34-
const notificationTheme = getThemeForScope(otherResults.some(isOnMainnet) ? 'mainnet' : 'testnet')
3533

3634
useRedirectIfSingleResult(wantedScope, searchParams, searchResults)
3735

@@ -49,7 +47,7 @@ export const ScopedSearchResultsView: FC<{
4947
)}
5048
{othersOpen ? (
5149
<>
52-
<HideMoreResults theme={notificationTheme} onHide={() => setOthersOpen(false)} />
50+
<HideMoreResults onHide={() => setOthersOpen(false)} />
5351
{RouteUtils.getEnabledNetworks()
5452
.filter(net => net !== wantedScope.network)
5553
.map(net => (
@@ -65,7 +63,6 @@ export const ScopedSearchResultsView: FC<{
6563
) : (
6664
!!otherResults.length && (
6765
<ShowMoreResults
68-
theme={notificationTheme}
6966
onShow={() => setOthersOpen(true)}
7067
hasWantedResults={!!wantedResults.length}
7168
otherResultsCount={otherResults.length}

src/app/pages/SearchResultsPage/ShowMoreResults.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import ZoomOut from '@mui/icons-material/ZoomOut'
44
import { Trans, useTranslation } from 'react-i18next'
55
import ZoomIn from '@mui/icons-material/ZoomIn'
66

7-
export const HideMoreResults: FC<{ theme: Theme; onHide: () => void }> = ({ onHide }) => {
7+
export const HideMoreResults: FC<{ onHide: () => void }> = ({ onHide }) => {
88
return (
99
<div
1010
className="w-[90%] mx-auto md:w-full flex justify-center items-center gap-1 p-4 leading-tight my-8 rounded-md box-border bg-[#F4F4F5] hover:bg-[#DDDDDE] cursor-pointer"
@@ -19,7 +19,6 @@ export const HideMoreResults: FC<{ theme: Theme; onHide: () => void }> = ({ onHi
1919
}
2020

2121
export const ShowMoreResults: FC<{
22-
theme: Theme
2322
onShow: () => void
2423
hasWantedResults: boolean
2524
otherResultsCount: number

0 commit comments

Comments
 (0)