Skip to content

Commit

Permalink
fix: Navbar2 notifications locale
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox committed Jan 8, 2024
1 parent af6c2dc commit ad4282b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/containers/Navbar2/Navbar2.container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
isSwitchingNetwork
} from '../../modules/wallet/selectors'
import { getData as getProfiles } from '../../modules/profile/selectors'
import { getLocale } from '../../modules/translation/selectors'
import {
disconnectWallet,
switchNetworkRequest
Expand All @@ -25,6 +26,7 @@ const mapState = (state: any): MapStateProps => {
chainId: getChainId(state),
manaBalances: getManaBalances(state),
address: getAddress(state),
locale: getLocale(state),
isSignedIn: isConnected(state),
isSigningIn: isConnecting(state),
appChainId: getAppChainId(state),
Expand Down
5 changes: 2 additions & 3 deletions src/containers/Navbar2/Navbar2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
checkIsOnboarding,
setOnboardingDone
} from '../../modules/notifications'
import { getCurrentLocale, t } from '../../modules/translation/utils'
import { t } from '../../modules/translation/utils'
import { getBaseUrl } from '../../lib/utils'
import ChainProvider from '../ChainProvider'
import {
Expand Down Expand Up @@ -56,7 +56,6 @@ const Navbar2: React.FC<Navbar2Props> = ({
if (identity) return new NotificationsAPI({ identity })
return null
}, [identity])
const currentLocale = getCurrentLocale().locale

const handleSwitchNetwork = useCallback(() => {
props.onSwitchNetwork(appChainId)
Expand Down Expand Up @@ -213,7 +212,7 @@ const Navbar2: React.FC<Navbar2Props> = ({
notifications={
withNotifications
? {
locale: currentLocale as NotificationLocale,
locale: props.locale as NotificationLocale,
isLoading,
isOnboarding: notificationsState.isOnboarding,
isOpen: notificationsState.isOpen,
Expand Down
2 changes: 2 additions & 0 deletions src/containers/Navbar2/Navbar2.types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type Navbar2Props = NavbarComponentProps & {
isSwitchingNetwork?: boolean
withNotifications?: boolean
identity?: AuthIdentity
locale: string
onSwitchNetwork: typeof switchNetworkRequest
onSignOut: typeof disconnectWallet
onSignIn: () => void
Expand All @@ -31,6 +32,7 @@ export type MapStateProps = Pick<
| 'appChainId'
| 'isSwitchingNetwork'
| 'avatar'
| 'locale'
>

export type MapDispatchProps = Pick<
Expand Down

0 comments on commit ad4282b

Please sign in to comment.