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 115323b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 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', 'src/features'],
},
],
format: 'po',
Expand Down
14 changes: 0 additions & 14 deletions apps/main/src/widgets/manage-gauge/model.ts

This file was deleted.

19 changes: 15 additions & 4 deletions apps/main/src/widgets/manage-gauge/ui/ManageGauge.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
import { t } from '@lingui/macro'
import TabSlider, { Tab } from '@/ui/TabSlider/TabSlider'
import { useCallback, useMemo, useState } from 'react'
import { isAddressEqual, type Address } from 'viem'
import { sliderTabs } from '@/widgets/manage-gauge/model'
import type { TabValue } from '@/widgets/manage-gauge/types'
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'

const ManageGauge: React.FC<{ poolId: string; chainId: ChainId }> = ({ poolId, chainId }) => {
const sliderTabs: Tab<TabValue>[] = [
{
label: t`Add Reward`,
value: 'add_reward',
},
{
label: t`Deposit Reward`,
value: 'deposit_reward',
},
]

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

Expand All @@ -27,9 +38,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,7 +64,7 @@ const ManageGauge: React.FC<{ poolId: string; chainId: ChainId }> = ({ poolId, c
}
return false
},
[isGaugeManager, isRewardsDistributor]
[isGaugeManager, isRewardsDistributor],
)

return (
Expand Down

0 comments on commit 115323b

Please sign in to comment.