diff --git a/package.json b/package.json index b17a87ab7..7c179293f 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/components/common/ChatLink.tsx b/src/components/common/ChatLink.tsx deleted file mode 100644 index a4d84f713..000000000 --- a/src/components/common/ChatLink.tsx +++ /dev/null @@ -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 = ({ - className, chatId, children, -}) => { - const { openChat } = getActions(); - - const handleClick = useCallback(() => { - if (chatId) { - openChat({ id: chatId }); - } - }, [chatId, openChat]); - - if (!chatId) { - return children; - } - - return ( - {children} - ); -}; - -export default memo(ChatLink); diff --git a/src/components/common/GroupCallLink.tsx b/src/components/common/GroupCallLink.tsx deleted file mode 100644 index 37b20fa3e..000000000 --- a/src/components/common/GroupCallLink.tsx +++ /dev/null @@ -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; - children: React.ReactNode; -}; - -const GroupCallLink: FC = ({ - 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 ( - {children} - ); -}; - -export default GroupCallLink; diff --git a/src/components/common/MessageLink.tsx b/src/components/common/MessageLink.tsx deleted file mode 100644 index 8fd98b5f9..000000000 --- a/src/components/common/MessageLink.tsx +++ /dev/null @@ -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 = ({ - 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 ( - {children} - ); -}; - -export default MessageLink; diff --git a/src/components/common/UserLink.tsx b/src/components/common/UserLink.tsx deleted file mode 100644 index 6f6b5d02d..000000000 --- a/src/components/common/UserLink.tsx +++ /dev/null @@ -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 = ({ - className, sender, children, -}) => { - const { openChat } = getActions(); - - const handleClick = useCallback(() => { - if (sender) { - openChat({ id: sender.id }); - } - }, [sender, openChat]); - - if (!sender) { - return children; - } - - return ( - {children} - ); -}; - -export default UserLink; diff --git a/src/components/main/premium/GiveawayModal.tsx b/src/components/main/premium/GiveawayModal.tsx index 43794fa83..2e6d81c89 100644 --- a/src/components/main/premium/GiveawayModal.tsx +++ b/src/components/main/premium/GiveawayModal.tsx @@ -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'; diff --git a/src/components/ui/Link.module.scss b/src/components/ui/Link.module.scss index ad93cba37..7f04f01b1 100644 --- a/src/components/ui/Link.module.scss +++ b/src/components/ui/Link.module.scss @@ -3,10 +3,6 @@ &:hover { color: inherit; - - &:global(.GroupCallLink) { - text-decoration: none; - } } } diff --git a/src/config.ts b/src/config.ts index a3399fe18..8b38d6f46 100644 --- a/src/config.ts +++ b/src/config.ts @@ -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; diff --git a/src/util/deepLinkParser.ts b/src/util/deepLinkParser.ts index bc9bc736c..21fe2efb9 100644 --- a/src/util/deepLinkParser.ts +++ b/src/util/deepLinkParser.ts @@ -663,7 +663,7 @@ function buildPrivateChannelLink(params: BuilderParams): Bui }; } -export function buildChatBoostLink(params: BuilderParams): BuilderReturnType { +function buildChatBoostLink(params: BuilderParams): BuilderReturnType { const { username, id,