Skip to content

Commit

Permalink
fix: manage gauge translation
Browse files Browse the repository at this point in the history
  • Loading branch information
amytsang committed Oct 31, 2024
1 parent 5ada25f commit c5fdee1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/main/lingui.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
catalogs: [
{
path: 'src/locales/{locale}/messages',
include: ['src/components', 'src/hooks', 'src/layout', 'src/pages', 'src/store'],
include: ['src/components', 'src/hooks', 'src/layout', 'src/pages', 'src/store', 'src/widgets'],
},
],
format: 'po',
Expand Down
13 changes: 9 additions & 4 deletions apps/main/src/widgets/manage-gauge/ui/ManageGauge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ import AddRewardToken from '@/features/add-gauge-reward-token'
import DepositReward from '@/features/deposit-gauge-reward'
import { useGaugeManager, useGaugeRewardsDistributors } from '@/entities/gauge'
import { useSignerAddress } from '@/entities/signer'
import useStore from '@/store/useStore'

const ManageGauge: React.FC<{ poolId: string; chainId: ChainId }> = ({ poolId, chainId }) => {
const locale = useStore((state) => state.locale)
// eslint-disable-next-line react-hooks/exhaustive-deps
const sliderTabsLocale = useMemo(() => sliderTabs, [locale])

const [activeTab, setActiveTab] = useState<TabValue>('add_reward')
const { data: signerAddress } = useSignerAddress()

Expand All @@ -27,9 +32,9 @@ const ManageGauge: React.FC<{ poolId: string; chainId: ChainId }> = ({ poolId, c
!!rewardDistributors &&
!!signerAddress &&
Object.values(rewardDistributors).some((distributorId) =>
isAddressEqual(distributorId as Address, signerAddress)
isAddressEqual(distributorId as Address, signerAddress),
),
[rewardDistributors, signerAddress]
[rewardDistributors, signerAddress],
)

const renderActiveTab = useCallback(() => {
Expand All @@ -53,12 +58,12 @@ const ManageGauge: React.FC<{ poolId: string; chainId: ChainId }> = ({ poolId, c
}
return false
},
[isGaugeManager, isRewardsDistributor]
[isGaugeManager, isRewardsDistributor],
)

return (
<>
<TabSlider tabs={sliderTabs} activeTab={activeTab} onTabChange={setActiveTab} isTabVisible={isTabVisible} />
<TabSlider tabs={sliderTabsLocale} activeTab={activeTab} onTabChange={setActiveTab} isTabVisible={isTabVisible} />
{renderActiveTab()}
</>
)
Expand Down

0 comments on commit c5fdee1

Please sign in to comment.