Revert "Added translation to Tabs"

This reverts commit 1ed9d6de78.
This commit is contained in:
Airyzz 2022-06-15 13:02:39 +09:30
parent 1ed9d6de78
commit 8c7749532b
4 changed files with 4 additions and 26 deletions

View file

@ -30,12 +30,5 @@
"uncategorize_subspaces": "Uncategorize subspaces", "uncategorize_subspaces": "Uncategorize subspaces",
"pin_sidebar": "Pin to sidebar", "pin_sidebar": "Pin to sidebar",
"unpin_sidebar": "Unpin from sidebar" "unpin_sidebar": "Unpin from sidebar"
},
"settings":{
"tabs": {
"general": "General",
"members": "Members",
"permission": "Permissions"
}
} }
} }

View file

@ -5,12 +5,5 @@
}, },
"welcome":{ "welcome":{
"heading": "いらっしゃいませ" "heading": "いらっしゃいませ"
},
"settings":{
"tabs": {
"general": "一般",
"members": "ユーザー",
"permission": "許可"
}
} }
} }

View file

@ -5,9 +5,6 @@ import './Tabs.scss';
import Button from '../button/Button'; import Button from '../button/Button';
import ScrollView from '../scroll/ScrollView'; import ScrollView from '../scroll/ScrollView';
import '../../i18n.jsx'
import { useTranslation } from 'react-i18next';
function TabItem({ function TabItem({
selected, iconSrc, selected, iconSrc,
onClick, children, disabled, onClick, children, disabled,
@ -44,8 +41,6 @@ TabItem.propTypes = {
function Tabs({ items, defaultSelected, onSelect }) { function Tabs({ items, defaultSelected, onSelect }) {
const [selectedItem, setSelectedItem] = useState(items[defaultSelected]); const [selectedItem, setSelectedItem] = useState(items[defaultSelected]);
const { t } = useTranslation();
const handleTabSelection = (item, index) => { const handleTabSelection = (item, index) => {
if (selectedItem === item) return; if (selectedItem === item) return;
setSelectedItem(item); setSelectedItem(item);
@ -64,7 +59,7 @@ function Tabs({ items, defaultSelected, onSelect }) {
disabled={item.disabled} disabled={item.disabled}
onClick={() => handleTabSelection(item, index)} onClick={() => handleTabSelection(item, index)}
> >
{(item.translate != undefined && item.translate) ? t(item.text) : item.text} {item.text}
</TabItem> </TabItem>
))} ))}
</div> </div>

View file

@ -44,26 +44,23 @@ import '../../i18n.jsx'
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
const tabText = { const tabText = {
GENERAL: 'settings.tabs.general', GENERAL: 'General',
MEMBERS: 'settings.tabs.members', MEMBERS: 'Members',
PERMISSIONS: 'settings.tabs.permission', PERMISSIONS: 'Permissions',
}; };
const tabItems = [{ const tabItems = [{
iconSrc: SettingsIC, iconSrc: SettingsIC,
text: tabText.GENERAL, text: tabText.GENERAL,
translate: true,
disabled: false, disabled: false,
}, { }, {
iconSrc: UserIC, iconSrc: UserIC,
text: tabText.MEMBERS, text: tabText.MEMBERS,
translate: true,
disabled: false, disabled: false,
}, { }, {
iconSrc: ShieldUserIC, iconSrc: ShieldUserIC,
text: tabText.PERMISSIONS, text: tabText.PERMISSIONS,
disabled: false, disabled: false,
translate: true
}]; }];
function GeneralSettings({ roomId }) { function GeneralSettings({ roomId }) {