Remove unused components (#6328)
This commit is contained in:
parent
74d1fc97cb
commit
c011a436f9
@ -71,6 +71,7 @@
|
||||
"autoprefixer": "^10.4.21",
|
||||
"babel-loader": "^10.0.0",
|
||||
"babel-plugin-transform-import-meta": "^2.3.3",
|
||||
"browserslist-config-baseline": "^0.5.0",
|
||||
"buffer": "^6.0.3",
|
||||
"concurrently": "^9.1.2",
|
||||
"copy-webpack-plugin": "^13.0.0",
|
||||
@ -132,7 +133,6 @@
|
||||
"@tauri-apps/plugin-updater": "^2.9.0",
|
||||
"async-mutex": "^0.5.0",
|
||||
"big-integer": "github:painor/BigInteger.js",
|
||||
"browserslist-config-baseline": "^0.5.0",
|
||||
"emoji-data-ios": "git+https://github.com/korenskoy/emoji-data-ios#443f1c9d7b16a82e7ee53f7f226d7d9a9920a105",
|
||||
"idb-keyval": "^6.2.2",
|
||||
"lowlight": "^3.3.0",
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
import type { FC } from '../../lib/teact/teact';
|
||||
import type React from '../../lib/teact/teact';
|
||||
import { memo, useCallback } from '../../lib/teact/teact';
|
||||
import { getActions } from '../../global';
|
||||
|
||||
import buildClassName from '../../util/buildClassName';
|
||||
|
||||
import Link from '../ui/Link';
|
||||
|
||||
type OwnProps = {
|
||||
className?: string;
|
||||
chatId?: string;
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
const ChatLink: FC<OwnProps> = ({
|
||||
className, chatId, children,
|
||||
}) => {
|
||||
const { openChat } = getActions();
|
||||
|
||||
const handleClick = useCallback(() => {
|
||||
if (chatId) {
|
||||
openChat({ id: chatId });
|
||||
}
|
||||
}, [chatId, openChat]);
|
||||
|
||||
if (!chatId) {
|
||||
return children;
|
||||
}
|
||||
|
||||
return (
|
||||
<Link className={buildClassName('ChatLink', className)} onClick={handleClick}>{children}</Link>
|
||||
);
|
||||
};
|
||||
|
||||
export default memo(ChatLink);
|
||||
@ -1,38 +0,0 @@
|
||||
import type { FC } from '../../lib/teact/teact';
|
||||
import type React from '../../lib/teact/teact';
|
||||
import { useCallback } from '../../lib/teact/teact';
|
||||
import { getActions } from '../../global';
|
||||
|
||||
import type { ApiGroupCall } from '../../api/types';
|
||||
|
||||
import buildClassName from '../../util/buildClassName';
|
||||
|
||||
import Link from '../ui/Link';
|
||||
|
||||
type OwnProps = {
|
||||
className?: string;
|
||||
groupCall?: Partial<ApiGroupCall>;
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
const GroupCallLink: FC<OwnProps> = ({
|
||||
className, groupCall, children,
|
||||
}) => {
|
||||
const { requestMasterAndJoinGroupCall } = getActions();
|
||||
|
||||
const handleClick = useCallback(() => {
|
||||
if (groupCall) {
|
||||
requestMasterAndJoinGroupCall({ id: groupCall.id, accessHash: groupCall.accessHash });
|
||||
}
|
||||
}, [groupCall, requestMasterAndJoinGroupCall]);
|
||||
|
||||
if (!groupCall) {
|
||||
return children;
|
||||
}
|
||||
|
||||
return (
|
||||
<Link className={buildClassName('GroupCallLink', className)} onClick={handleClick}>{children}</Link>
|
||||
);
|
||||
};
|
||||
|
||||
export default GroupCallLink;
|
||||
@ -1,38 +0,0 @@
|
||||
import type { FC } from '../../lib/teact/teact';
|
||||
import type React from '../../lib/teact/teact';
|
||||
import { useCallback } from '../../lib/teact/teact';
|
||||
import { getActions } from '../../global';
|
||||
|
||||
import type { ApiMessage } from '../../api/types';
|
||||
|
||||
import buildClassName from '../../util/buildClassName';
|
||||
|
||||
import Link from '../ui/Link';
|
||||
|
||||
type OwnProps = {
|
||||
className?: string;
|
||||
message?: ApiMessage;
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
const MessageLink: FC<OwnProps> = ({
|
||||
className, message, children,
|
||||
}) => {
|
||||
const { focusMessage } = getActions();
|
||||
|
||||
const handleMessageClick = useCallback((): void => {
|
||||
if (message) {
|
||||
focusMessage({ chatId: message.chatId, messageId: message.id });
|
||||
}
|
||||
}, [focusMessage, message]);
|
||||
|
||||
if (!message) {
|
||||
return children;
|
||||
}
|
||||
|
||||
return (
|
||||
<Link className={buildClassName('MessageLink', className)} onClick={handleMessageClick}>{children}</Link>
|
||||
);
|
||||
};
|
||||
|
||||
export default MessageLink;
|
||||
@ -1,38 +0,0 @@
|
||||
import type { FC } from '../../lib/teact/teact';
|
||||
import type React from '../../lib/teact/teact';
|
||||
import { useCallback } from '../../lib/teact/teact';
|
||||
import { getActions } from '../../global';
|
||||
|
||||
import type { ApiPeer } from '../../api/types';
|
||||
|
||||
import buildClassName from '../../util/buildClassName';
|
||||
|
||||
import Link from '../ui/Link';
|
||||
|
||||
type OwnProps = {
|
||||
className?: string;
|
||||
sender?: ApiPeer;
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
const UserLink: FC<OwnProps> = ({
|
||||
className, sender, children,
|
||||
}) => {
|
||||
const { openChat } = getActions();
|
||||
|
||||
const handleClick = useCallback(() => {
|
||||
if (sender) {
|
||||
openChat({ id: sender.id });
|
||||
}
|
||||
}, [sender, openChat]);
|
||||
|
||||
if (!sender) {
|
||||
return children;
|
||||
}
|
||||
|
||||
return (
|
||||
<Link className={buildClassName('UserLink', className)} onClick={handleClick}>{children}</Link>
|
||||
);
|
||||
};
|
||||
|
||||
export default UserLink;
|
||||
@ -37,7 +37,7 @@ import useLastCallback from '../../../hooks/useLastCallback';
|
||||
import useOldLang from '../../../hooks/useOldLang';
|
||||
|
||||
import CalendarModal from '../../common/CalendarModal';
|
||||
import CountryPickerModal from '../../common/CountryPickerModal';
|
||||
import CountryPickerModal from '../../common/CountryPickerModal.async';
|
||||
import GroupChatInfo from '../../common/GroupChatInfo';
|
||||
import Icon from '../../common/icons/Icon';
|
||||
import StarTopupOptionList from '../../modals/stars/StarTopupOptionList';
|
||||
|
||||
@ -3,10 +3,6 @@
|
||||
|
||||
&:hover {
|
||||
color: inherit;
|
||||
|
||||
&:global(.GroupCallLink) {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -354,14 +354,11 @@ export const PRIVACY_URL = 'https://telegram.org/privacy';
|
||||
export const MINI_APP_TOS_URL = 'https://telegram.org/tos/mini-apps';
|
||||
export const FRAGMENT_ADS_URL = 'https://fragment.com/ads';
|
||||
export const GENERAL_TOPIC_ID = 1;
|
||||
export const STORY_EXPIRE_PERIOD = 86400; // 1 day
|
||||
export const STORY_VIEWERS_EXPIRE_PERIOD = 86400; // 1 day
|
||||
export const FRESH_AUTH_PERIOD = 86400; // 1 day
|
||||
export const GIVEAWAY_BOOST_PER_PREMIUM = 4;
|
||||
export const GIVEAWAY_MAX_ADDITIONAL_CHANNELS = 10;
|
||||
export const GIVEAWAY_MAX_ADDITIONAL_USERS = 10;
|
||||
export const GIVEAWAY_MAX_ADDITIONAL_COUNTRIES = 10;
|
||||
export const BOOST_PER_SENT_GIFT = 3;
|
||||
export const FRAGMENT_PHONE_CODE = '888';
|
||||
export const FRAGMENT_PHONE_LENGTH = 11;
|
||||
export const BOT_VERIFICATION_PEERS_LIMIT = 20;
|
||||
|
||||
@ -663,7 +663,7 @@ function buildPrivateChannelLink(params: BuilderParams<PrivateChannelLink>): Bui
|
||||
};
|
||||
}
|
||||
|
||||
export function buildChatBoostLink(params: BuilderParams<ChatBoostLink>): BuilderReturnType<ChatBoostLink> {
|
||||
function buildChatBoostLink(params: BuilderParams<ChatBoostLink>): BuilderReturnType<ChatBoostLink> {
|
||||
const {
|
||||
username,
|
||||
id,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user