From 0c487ab496334793c5dad1e6afdfbc4459297b06 Mon Sep 17 00:00:00 2001 From: Dreamacro <8615343+Dreamacro@users.noreply.github.com> Date: Tue, 3 Nov 2020 22:26:15 +0800 Subject: [PATCH] Fix: connections filter i18n --- src/containers/Connections/Devices/index.tsx | 10 ++++++++-- src/i18n/en_US.ts | 3 +++ src/i18n/zh_CN.ts | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/containers/Connections/Devices/index.tsx b/src/containers/Connections/Devices/index.tsx index d228676..2db3110 100644 --- a/src/containers/Connections/Devices/index.tsx +++ b/src/containers/Connections/Devices/index.tsx @@ -1,6 +1,7 @@ -import React from 'react' +import React, { useMemo } from 'react' import classnames from 'classnames' import { BaseComponentProps } from '@models' +import { useI18n } from '@stores' import './style.scss' interface DevicesProps extends BaseComponentProps { @@ -10,6 +11,9 @@ interface DevicesProps extends BaseComponentProps { } export function Devices (props: DevicesProps) { + const { translation } = useI18n() + const t = useMemo(() => translation('Connections').t, [translation]) + const { className, style } = props const classname = classnames('connections-devices', className) function handleSelected (label: string) { @@ -18,7 +22,9 @@ export function Devices (props: DevicesProps) { return (