mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-26 20:34:44 +01:00
Chat Folders: Fix translations (#1988)
This commit is contained in:
parent
206e9d063d
commit
7be9f5373c
@ -223,7 +223,7 @@ const ChatFolders: FC<OwnProps & StateProps> = ({
|
||||
return (
|
||||
<div className="ChatFolders">
|
||||
{shouldRenderFolders ? (
|
||||
<TabList tabs={folderTabs} activeTab={activeChatFolder} onSwitchTab={handleSwitchTab} />
|
||||
<TabList tabs={folderTabs} activeTab={activeChatFolder} onSwitchTab={handleSwitchTab} areFolders />
|
||||
) : shouldRenderPlaceholder ? (
|
||||
<div className={buildClassName('tabs-placeholder', transitionClassNames)} />
|
||||
) : undefined}
|
||||
|
@ -1,8 +1,10 @@
|
||||
import type { FC } from '../../lib/teact/teact';
|
||||
import React, { memo, useRef, useEffect } from '../../lib/teact/teact';
|
||||
|
||||
import { ALL_FOLDER_ID } from '../../config';
|
||||
import { IS_ANDROID, IS_IOS } from '../../util/environment';
|
||||
import fastSmoothScrollHorizontal from '../../util/fastSmoothScrollHorizontal';
|
||||
|
||||
import usePrevious from '../../hooks/usePrevious';
|
||||
import useHorizontalScroll from '../../hooks/useHorizontalScroll';
|
||||
import useLang from '../../hooks/useLang';
|
||||
@ -21,6 +23,7 @@ export type TabWithProperties = {
|
||||
|
||||
type OwnProps = {
|
||||
tabs: readonly TabWithProperties[];
|
||||
areFolders?: boolean;
|
||||
activeTab: number;
|
||||
big?: boolean;
|
||||
onSwitchTab: (index: number) => void;
|
||||
@ -31,7 +34,7 @@ const TAB_SCROLL_THRESHOLD_PX = 16;
|
||||
const SCROLL_DURATION = IS_IOS ? 450 : IS_ANDROID ? 400 : 300;
|
||||
|
||||
const TabList: FC<OwnProps> = ({
|
||||
tabs, activeTab, big, onSwitchTab,
|
||||
tabs, areFolders, activeTab, big, onSwitchTab,
|
||||
}) => {
|
||||
// eslint-disable-next-line no-null/no-null
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
@ -74,7 +77,8 @@ const TabList: FC<OwnProps> = ({
|
||||
{tabs.map((tab, i) => (
|
||||
<Tab
|
||||
key={tab.id ?? tab.title}
|
||||
title={lang(tab.title)}
|
||||
// TODO Remove dependency on usage context
|
||||
title={(!areFolders || tab.id === ALL_FOLDER_ID) ? lang(tab.title) : tab.title}
|
||||
isActive={i === activeTab}
|
||||
isBlocked={tab.isBlocked}
|
||||
badgeCount={tab.badgeCount}
|
||||
|
Loading…
Reference in New Issue
Block a user