Localize PartySegmentedControl
This commit is contained in:
parent
703c9f4d49
commit
d16565332e
1 changed files with 10 additions and 5 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import './index.scss'
|
import { useSnapshot } from 'valtio'
|
||||||
|
import { useTranslation } from 'next-i18next'
|
||||||
|
|
||||||
import { appState } from '~utils/appState'
|
import { appState } from '~utils/appState'
|
||||||
|
|
||||||
|
|
@ -8,7 +9,9 @@ import Segment from '~components/Segment'
|
||||||
import ToggleSwitch from '~components/ToggleSwitch'
|
import ToggleSwitch from '~components/ToggleSwitch'
|
||||||
|
|
||||||
import { GridType } from '~utils/enums'
|
import { GridType } from '~utils/enums'
|
||||||
import { useSnapshot } from 'valtio'
|
|
||||||
|
|
||||||
|
import './index.scss'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
selectedTab: GridType
|
selectedTab: GridType
|
||||||
|
|
@ -17,6 +20,8 @@ interface Props {
|
||||||
}
|
}
|
||||||
|
|
||||||
const PartySegmentedControl = (props: Props) => {
|
const PartySegmentedControl = (props: Props) => {
|
||||||
|
const { t } = useTranslation('common')
|
||||||
|
|
||||||
const { party, grid } = useSnapshot(appState)
|
const { party, grid } = useSnapshot(appState)
|
||||||
|
|
||||||
function getElement() {
|
function getElement() {
|
||||||
|
|
@ -62,21 +67,21 @@ const PartySegmentedControl = (props: Props) => {
|
||||||
name="characters"
|
name="characters"
|
||||||
selected={props.selectedTab == GridType.Character}
|
selected={props.selectedTab == GridType.Character}
|
||||||
onClick={props.onClick}
|
onClick={props.onClick}
|
||||||
>Characters</Segment>
|
>{t('party.segmented_control.characters')}</Segment>
|
||||||
|
|
||||||
<Segment
|
<Segment
|
||||||
groupName="grid"
|
groupName="grid"
|
||||||
name="weapons"
|
name="weapons"
|
||||||
selected={props.selectedTab == GridType.Weapon}
|
selected={props.selectedTab == GridType.Weapon}
|
||||||
onClick={props.onClick}
|
onClick={props.onClick}
|
||||||
>Weapons</Segment>
|
>{t('party.segmented_control.weapons')}</Segment>
|
||||||
|
|
||||||
<Segment
|
<Segment
|
||||||
groupName="grid"
|
groupName="grid"
|
||||||
name="summons"
|
name="summons"
|
||||||
selected={props.selectedTab == GridType.Summon}
|
selected={props.selectedTab == GridType.Summon}
|
||||||
onClick={props.onClick}
|
onClick={props.onClick}
|
||||||
>Summons</Segment>
|
>{t('party.segmented_control.summons')}</Segment>
|
||||||
</SegmentedControl>
|
</SegmentedControl>
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue