Chat Folders: Fix translations (#1988)
This commit is contained in:
parent
206e9d063d
commit
7be9f5373c
@ -223,7 +223,7 @@ const ChatFolders: FC<OwnProps & StateProps> = ({
|
|||||||
return (
|
return (
|
||||||
<div className="ChatFolders">
|
<div className="ChatFolders">
|
||||||
{shouldRenderFolders ? (
|
{shouldRenderFolders ? (
|
||||||
<TabList tabs={folderTabs} activeTab={activeChatFolder} onSwitchTab={handleSwitchTab} />
|
<TabList tabs={folderTabs} activeTab={activeChatFolder} onSwitchTab={handleSwitchTab} areFolders />
|
||||||
) : shouldRenderPlaceholder ? (
|
) : shouldRenderPlaceholder ? (
|
||||||
<div className={buildClassName('tabs-placeholder', transitionClassNames)} />
|
<div className={buildClassName('tabs-placeholder', transitionClassNames)} />
|
||||||
) : undefined}
|
) : undefined}
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React, { memo, useRef, useEffect } 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 { IS_ANDROID, IS_IOS } from '../../util/environment';
|
||||||
import fastSmoothScrollHorizontal from '../../util/fastSmoothScrollHorizontal';
|
import fastSmoothScrollHorizontal from '../../util/fastSmoothScrollHorizontal';
|
||||||
|
|
||||||
import usePrevious from '../../hooks/usePrevious';
|
import usePrevious from '../../hooks/usePrevious';
|
||||||
import useHorizontalScroll from '../../hooks/useHorizontalScroll';
|
import useHorizontalScroll from '../../hooks/useHorizontalScroll';
|
||||||
import useLang from '../../hooks/useLang';
|
import useLang from '../../hooks/useLang';
|
||||||
@ -21,6 +23,7 @@ export type TabWithProperties = {
|
|||||||
|
|
||||||
type OwnProps = {
|
type OwnProps = {
|
||||||
tabs: readonly TabWithProperties[];
|
tabs: readonly TabWithProperties[];
|
||||||
|
areFolders?: boolean;
|
||||||
activeTab: number;
|
activeTab: number;
|
||||||
big?: boolean;
|
big?: boolean;
|
||||||
onSwitchTab: (index: number) => void;
|
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 SCROLL_DURATION = IS_IOS ? 450 : IS_ANDROID ? 400 : 300;
|
||||||
|
|
||||||
const TabList: FC<OwnProps> = ({
|
const TabList: FC<OwnProps> = ({
|
||||||
tabs, activeTab, big, onSwitchTab,
|
tabs, areFolders, activeTab, big, onSwitchTab,
|
||||||
}) => {
|
}) => {
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const containerRef = useRef<HTMLDivElement>(null);
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
@ -74,7 +77,8 @@ const TabList: FC<OwnProps> = ({
|
|||||||
{tabs.map((tab, i) => (
|
{tabs.map((tab, i) => (
|
||||||
<Tab
|
<Tab
|
||||||
key={tab.id ?? tab.title}
|
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}
|
isActive={i === activeTab}
|
||||||
isBlocked={tab.isBlocked}
|
isBlocked={tab.isBlocked}
|
||||||
badgeCount={tab.badgeCount}
|
badgeCount={tab.badgeCount}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user