diff --git a/src/components/auth/AuthCode.async.tsx b/src/components/auth/AuthCode.async.tsx index 0cb4dfdc7..917b62a7e 100644 --- a/src/components/auth/AuthCode.async.tsx +++ b/src/components/auth/AuthCode.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; import Loading from '../ui/Loading'; -const AuthCodeAsync: FC = () => { +const AuthCodeAsync = () => { const AuthCode = useModuleLoader(Bundles.Auth, 'AuthCode'); return AuthCode ? : ; diff --git a/src/components/auth/AuthPassword.async.tsx b/src/components/auth/AuthPassword.async.tsx index d41ed3cb0..04f9b77f5 100644 --- a/src/components/auth/AuthPassword.async.tsx +++ b/src/components/auth/AuthPassword.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; import Loading from '../ui/Loading'; -const AuthPasswordAsync: FC = () => { +const AuthPasswordAsync = () => { const AuthPassword = useModuleLoader(Bundles.Auth, 'AuthPassword'); return AuthPassword ? : ; diff --git a/src/components/auth/AuthRegister.async.tsx b/src/components/auth/AuthRegister.async.tsx index 85c4daf4c..d9aa8c307 100644 --- a/src/components/auth/AuthRegister.async.tsx +++ b/src/components/auth/AuthRegister.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; import Loading from '../ui/Loading'; -const AuthRegisterAsync: FC = () => { +const AuthRegisterAsync = () => { const AuthRegister = useModuleLoader(Bundles.Auth, 'AuthRegister'); return AuthRegister ? : ; diff --git a/src/components/calls/ActiveCallHeader.async.tsx b/src/components/calls/ActiveCallHeader.async.tsx index 055a811ee..df5ff9b87 100644 --- a/src/components/calls/ActiveCallHeader.async.tsx +++ b/src/components/calls/ActiveCallHeader.async.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../lib/teact/teact'; - import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; @@ -8,7 +6,7 @@ type OwnProps = { isActive?: boolean; }; -const ActiveCallHeaderAsync: FC = (props) => { +const ActiveCallHeaderAsync = (props: OwnProps) => { const { isActive } = props; const ActiveCallHeader = useModuleLoader(Bundles.Calls, 'ActiveCallHeader', !isActive); diff --git a/src/components/calls/ActiveCallHeader.tsx b/src/components/calls/ActiveCallHeader.tsx index a9c040d01..0c21b688c 100644 --- a/src/components/calls/ActiveCallHeader.tsx +++ b/src/components/calls/ActiveCallHeader.tsx @@ -1,4 +1,3 @@ -import type { FC } from '../../lib/teact/teact'; import { memo, useEffect } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; @@ -18,11 +17,11 @@ type StateProps = { phoneCallUser?: ApiUser; }; -const ActiveCallHeader: FC = ({ +const ActiveCallHeader = ({ groupCall, phoneCallUser, isCallPanelVisible, -}) => { +}: StateProps) => { const { toggleGroupCallPanel } = getActions(); const lang = useOldLang(); diff --git a/src/components/calls/group/GroupCall.async.tsx b/src/components/calls/group/GroupCall.async.tsx index 2f642f30b..b5e5c2814 100644 --- a/src/components/calls/group/GroupCall.async.tsx +++ b/src/components/calls/group/GroupCall.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './GroupCall'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const GroupCallAsync: FC = (props) => { +const GroupCallAsync = (props: OwnProps) => { const { groupCallId } = props; const GroupCall = useModuleLoader(Bundles.Calls, 'GroupCall', !groupCallId); diff --git a/src/components/calls/phone/PhoneCall.async.tsx b/src/components/calls/phone/PhoneCall.async.tsx index 8ffb61d4b..fc748f1ed 100644 --- a/src/components/calls/phone/PhoneCall.async.tsx +++ b/src/components/calls/phone/PhoneCall.async.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../../lib/teact/teact'; - import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; @@ -8,7 +6,7 @@ type OwnProps = { isActive?: boolean; }; -const PhoneCallAsync: FC = (props) => { +const PhoneCallAsync = (props: OwnProps) => { const { isActive } = props; const PhoneCall = useModuleLoader(Bundles.Calls, 'PhoneCall', !isActive); diff --git a/src/components/calls/phone/PhoneCall.tsx b/src/components/calls/phone/PhoneCall.tsx index 25a7a4a31..56e6153f3 100644 --- a/src/components/calls/phone/PhoneCall.tsx +++ b/src/components/calls/phone/PhoneCall.tsx @@ -1,6 +1,5 @@ import '../../../global/actions/calls'; -import type { FC } from '../../../lib/teact/teact'; import { memo, useCallback, useEffect, useMemo, useRef, } from '../../../lib/teact/teact'; @@ -45,12 +44,12 @@ type StateProps = { isCallPanelVisible?: boolean; }; -const PhoneCall: FC = ({ +const PhoneCall = ({ user, isOutgoing, phoneCall, isCallPanelVisible, -}) => { +}: StateProps) => { const lang = useOldLang(); const { hangUp, requestMasterAndAcceptCall, playGroupCallSound, toggleGroupCallPanel, connectToActivePhoneCall, diff --git a/src/components/calls/phone/RatePhoneCallModal.async.tsx b/src/components/calls/phone/RatePhoneCallModal.async.tsx index a6cabdd6b..47e657615 100644 --- a/src/components/calls/phone/RatePhoneCallModal.async.tsx +++ b/src/components/calls/phone/RatePhoneCallModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './RatePhoneCallModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const RatePhoneCallModalAsync: FC = (props) => { +const RatePhoneCallModalAsync = (props: OwnProps) => { const { isOpen } = props; const RatePhoneCallModal = useModuleLoader(Bundles.Calls, 'RatePhoneCallModal', !isOpen); diff --git a/src/components/common/AboutMonetizationModal.async.tsx b/src/components/common/AboutMonetizationModal.async.tsx index bd58a346f..2743dfa45 100644 --- a/src/components/common/AboutMonetizationModal.async.tsx +++ b/src/components/common/AboutMonetizationModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './AboutMonetizationModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const AboutMonetizationModalAsync: FC = (props) => { +const AboutMonetizationModalAsync = (props: OwnProps) => { const { isOpen } = props; const AboutMonetizationModal = useModuleLoader(Bundles.Extra, 'AboutMonetizationModal', !isOpen); diff --git a/src/components/common/CalendarModal.async.tsx b/src/components/common/CalendarModal.async.tsx index 0343cb58a..8f533f744 100644 --- a/src/components/common/CalendarModal.async.tsx +++ b/src/components/common/CalendarModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './CalendarModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const CalendarModalAsync: FC = (props) => { +const CalendarModalAsync = (props: OwnProps) => { const { isOpen } = props; const CalendarModal = useModuleLoader(Bundles.Extra, 'CalendarModal', !isOpen); diff --git a/src/components/common/CountryPickerModal.async.tsx b/src/components/common/CountryPickerModal.async.tsx index ffe61b84e..f860a0e0a 100644 --- a/src/components/common/CountryPickerModal.async.tsx +++ b/src/components/common/CountryPickerModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './CountryPickerModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const CountryPickerModalAsync: FC = (props) => { +const CountryPickerModalAsync = (props: OwnProps) => { const { isOpen } = props; const CountryPickerModal = useModuleLoader(Bundles.Extra, 'CountryPickerModal', !isOpen); diff --git a/src/components/common/CustomEmojiSetsModal.async.tsx b/src/components/common/CustomEmojiSetsModal.async.tsx index 370d29795..412a64126 100644 --- a/src/components/common/CustomEmojiSetsModal.async.tsx +++ b/src/components/common/CustomEmojiSetsModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './CustomEmojiSetsModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const CustomEmojiSetsModalAsync: FC = (props) => { +const CustomEmojiSetsModalAsync = (props: OwnProps) => { const { customEmojiSetIds } = props; const CustomEmojiSetsModal = useModuleLoader(Bundles.Extra, 'CustomEmojiSetsModal', !customEmojiSetIds); diff --git a/src/components/common/DeleteMessageModal.async.tsx b/src/components/common/DeleteMessageModal.async.tsx index 6fc37560d..6d5d9ebfa 100644 --- a/src/components/common/DeleteMessageModal.async.tsx +++ b/src/components/common/DeleteMessageModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './DeleteMessageModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const DeleteMessageModalAsync: FC = (props) => { +const DeleteMessageModalAsync = (props: OwnProps) => { const { isOpen } = props; const DeleteMessageModal = useModuleLoader(Bundles.Extra, 'DeleteMessageModal', !isOpen); diff --git a/src/components/common/PinMessageModal.async.tsx b/src/components/common/PinMessageModal.async.tsx index 69383907d..286fbf9bd 100644 --- a/src/components/common/PinMessageModal.async.tsx +++ b/src/components/common/PinMessageModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './PinMessageModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const PinMessageModalAsync: FC = (props) => { +const PinMessageModalAsync = (props: OwnProps) => { const { isOpen } = props; const PinMessageModal = useModuleLoader(Bundles.Extra, 'PinMessageModal', !isOpen); diff --git a/src/components/common/PrivacySettingsNoticeModal.async.tsx b/src/components/common/PrivacySettingsNoticeModal.async.tsx index 9357d87fc..b5acd5f32 100644 --- a/src/components/common/PrivacySettingsNoticeModal.async.tsx +++ b/src/components/common/PrivacySettingsNoticeModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './PrivacySettingsNoticeModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const PrivacySettingsNoticeModalAsync: FC = (props) => { +const PrivacySettingsNoticeModalAsync = (props: OwnProps) => { const { isOpen } = props; const PrivacySettingsNoticeModal = useModuleLoader(Bundles.Extra, 'PrivacySettingsNoticeModal', !isOpen); diff --git a/src/components/common/SeenByModal.async.tsx b/src/components/common/SeenByModal.async.tsx index e347c39f5..83dca874a 100644 --- a/src/components/common/SeenByModal.async.tsx +++ b/src/components/common/SeenByModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './SeenByModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const SeenByModalAsync: FC = (props) => { +const SeenByModalAsync = (props: OwnProps) => { const { isOpen } = props; const SeenByModal = useModuleLoader(Bundles.Extra, 'SeenByModal', !isOpen); diff --git a/src/components/common/StickerSetModal.async.tsx b/src/components/common/StickerSetModal.async.tsx index 4466b217d..4731bbbae 100644 --- a/src/components/common/StickerSetModal.async.tsx +++ b/src/components/common/StickerSetModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './StickerSetModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const StickerSetModalAsync: FC = (props) => { +const StickerSetModalAsync = (props: OwnProps) => { const { isOpen } = props; const StickerSetModal = useModuleLoader(Bundles.Extra, 'StickerSetModal', !isOpen); diff --git a/src/components/common/UnpinAllMessagesModal.async.tsx b/src/components/common/UnpinAllMessagesModal.async.tsx index 671f671b1..ef88a3067 100644 --- a/src/components/common/UnpinAllMessagesModal.async.tsx +++ b/src/components/common/UnpinAllMessagesModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './UnpinAllMessagesModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const UnpinAllMessagesModalAsync: FC = (props) => { +const UnpinAllMessagesModalAsync = (props: OwnProps) => { const { isOpen } = props; const UnpinAllMessagesModal = useModuleLoader(Bundles.Extra, 'UnpinAllMessagesModal', !isOpen); diff --git a/src/components/common/VerificationMonetizationModal.async.tsx b/src/components/common/VerificationMonetizationModal.async.tsx index f2009773b..5f3c19476 100644 --- a/src/components/common/VerificationMonetizationModal.async.tsx +++ b/src/components/common/VerificationMonetizationModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './VerificationMonetizationModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const VerificationMonetizationModalAsync: FC = (props) => { +const VerificationMonetizationModalAsync = (props: OwnProps) => { const { modal } = props; const VerificationMonetizationModal = useModuleLoader(Bundles.Extra, 'VerificationMonetizationModal', !modal); diff --git a/src/components/left/ArchivedChats.async.tsx b/src/components/left/ArchivedChats.async.tsx index 145474e34..dde2d9c25 100644 --- a/src/components/left/ArchivedChats.async.tsx +++ b/src/components/left/ArchivedChats.async.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './ArchivedChats'; import { Bundles } from '../../util/moduleLoader'; @@ -8,7 +6,7 @@ import useModuleLoader from '../../hooks/useModuleLoader'; import Loading from '../ui/Loading'; -const ArchivedChatsAsync: FC = (props) => { +const ArchivedChatsAsync = (props: OwnProps) => { const ArchivedChats = useModuleLoader(Bundles.Extra, 'ArchivedChats'); return ArchivedChats ? : ; diff --git a/src/components/left/ChatFolderModal.async.tsx b/src/components/left/ChatFolderModal.async.tsx index 1d7896d23..a54d2b18c 100644 --- a/src/components/left/ChatFolderModal.async.tsx +++ b/src/components/left/ChatFolderModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './ChatFolderModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const ChatFolderModalAsync: FC = (props) => { +const ChatFolderModalAsync = (props: OwnProps) => { const { isOpen } = props; const ChatFolderModal = useModuleLoader(Bundles.Extra, 'ChatFolderModal', !isOpen); diff --git a/src/components/left/MuteChatModal.async.tsx b/src/components/left/MuteChatModal.async.tsx index e06da3f11..59243f6da 100644 --- a/src/components/left/MuteChatModal.async.tsx +++ b/src/components/left/MuteChatModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './MuteChatModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const MuteChatModalAsync: FC = (props) => { +const MuteChatModalAsync = (props: OwnProps) => { const { isOpen } = props; const MuteChatModal = useModuleLoader(Bundles.Extra, 'MuteChatModal', !isOpen); diff --git a/src/components/left/main/ContactList.async.tsx b/src/components/left/main/ContactList.async.tsx index dc206a9d6..a7b793306 100644 --- a/src/components/left/main/ContactList.async.tsx +++ b/src/components/left/main/ContactList.async.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './ContactList'; import { Bundles } from '../../../util/moduleLoader'; @@ -8,7 +6,7 @@ import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; -const ContactListAsync: FC = (props) => { +const ContactListAsync = (props: OwnProps) => { const ContactList = useModuleLoader(Bundles.Extra, 'ContactList'); return ContactList ? : ; diff --git a/src/components/left/main/StatusButton.tsx b/src/components/left/main/StatusButton.tsx index 96fef0513..aa6f883f5 100644 --- a/src/components/left/main/StatusButton.tsx +++ b/src/components/left/main/StatusButton.tsx @@ -1,4 +1,3 @@ -import type { FC } from '../../../lib/teact/teact'; import { memo, useCallback, useRef } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; @@ -29,7 +28,7 @@ interface StateProps { const EFFECT_DURATION_MS = 1500; const EMOJI_STATUS_SIZE = 24; -const StatusButton: FC = ({ emojiStatus, collectibleStatuses, isAccountFrozen }) => { +const StatusButton = ({ emojiStatus, collectibleStatuses, isAccountFrozen }: StateProps) => { const { setEmojiStatus, loadCurrentUser, openFrozenAccountModal } = getActions(); const buttonRef = useRef(); diff --git a/src/components/left/main/StatusPickerMenu.async.tsx b/src/components/left/main/StatusPickerMenu.async.tsx index 698832d09..09139d4ac 100644 --- a/src/components/left/main/StatusPickerMenu.async.tsx +++ b/src/components/left/main/StatusPickerMenu.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './StatusPickerMenu'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const StatusPickerMenuAsync: FC = (props) => { +const StatusPickerMenuAsync = (props: OwnProps) => { const { isOpen } = props; const StatusPickerMenu = useModuleLoader(Bundles.Extra, 'StatusPickerMenu', !isOpen); diff --git a/src/components/left/newChat/NewChat.async.tsx b/src/components/left/newChat/NewChat.async.tsx index b38ac57b0..b98c4a937 100644 --- a/src/components/left/newChat/NewChat.async.tsx +++ b/src/components/left/newChat/NewChat.async.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './NewChat'; import { Bundles } from '../../../util/moduleLoader'; @@ -8,7 +6,7 @@ import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; -const NewChatAsync: FC = (props) => { +const NewChatAsync = (props: OwnProps) => { const NewChat = useModuleLoader(Bundles.Extra, 'NewChat'); return NewChat ? : ; diff --git a/src/components/left/search/LeftSearch.async.tsx b/src/components/left/search/LeftSearch.async.tsx index a0b8afdf3..be080e845 100644 --- a/src/components/left/search/LeftSearch.async.tsx +++ b/src/components/left/search/LeftSearch.async.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './LeftSearch'; import { Bundles } from '../../../util/moduleLoader'; @@ -8,7 +6,7 @@ import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; -const LeftSearchAsync: FC = (props) => { +const LeftSearchAsync = (props: OwnProps) => { const LeftSearch = useModuleLoader(Bundles.Extra, 'LeftSearch'); return LeftSearch ? : ; diff --git a/src/components/left/settings/Settings.async.tsx b/src/components/left/settings/Settings.async.tsx index 6884adaf3..0928ddff2 100644 --- a/src/components/left/settings/Settings.async.tsx +++ b/src/components/left/settings/Settings.async.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './Settings'; import { Bundles } from '../../../util/moduleLoader'; @@ -8,7 +6,7 @@ import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; -const SettingsAsync: FC = (props) => { +const SettingsAsync = (props: OwnProps) => { const Settings = useModuleLoader(Bundles.Extra, 'Settings'); return Settings ? : ; diff --git a/src/components/main/AttachBotRecipientPicker.async.tsx b/src/components/main/AttachBotRecipientPicker.async.tsx index 88cc0a005..e970019ee 100644 --- a/src/components/main/AttachBotRecipientPicker.async.tsx +++ b/src/components/main/AttachBotRecipientPicker.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './AttachBotRecipientPicker'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const AttachBotRecipientPickerAsync: FC = (props) => { +const AttachBotRecipientPickerAsync = (props: OwnProps) => { const { requestedAttachBotInChat } = props; const AttachBotRecipientPicker = useModuleLoader( Bundles.Extra, 'AttachBotRecipientPicker', !requestedAttachBotInChat, diff --git a/src/components/main/BotTrustModal.async.tsx b/src/components/main/BotTrustModal.async.tsx index c99aa8e39..6c27dc72c 100644 --- a/src/components/main/BotTrustModal.async.tsx +++ b/src/components/main/BotTrustModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './BotTrustModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const BotTrustModalAsync: FC = (props) => { +const BotTrustModalAsync = (props: OwnProps) => { const { bot } = props; const BotTrustModal = useModuleLoader(Bundles.Extra, 'BotTrustModal', !bot); diff --git a/src/components/main/DeleteFolderDialog.async.tsx b/src/components/main/DeleteFolderDialog.async.tsx index da5e2b740..2b4c14f7b 100644 --- a/src/components/main/DeleteFolderDialog.async.tsx +++ b/src/components/main/DeleteFolderDialog.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './DeleteFolderDialog'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const DeleteFolderDialogAsync: FC = (props) => { +const DeleteFolderDialogAsync = (props: OwnProps) => { const { folder } = props; const DeleteFolderDialog = useModuleLoader(Bundles.Extra, 'DeleteFolderDialog', !folder); diff --git a/src/components/main/Dialogs.async.tsx b/src/components/main/Dialogs.async.tsx deleted file mode 100644 index 204c6ed58..000000000 --- a/src/components/main/Dialogs.async.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import type { FC } from '../../lib/teact/teact'; - -import { Bundles } from '../../util/moduleLoader'; - -import useModuleLoader from '../../hooks/useModuleLoader'; - -const DialogsAsync: FC = ({ isOpen }) => { - const Dialogs = useModuleLoader(Bundles.Extra, 'Dialogs', !isOpen); - - return Dialogs ? : undefined; -}; - -export default DialogsAsync; diff --git a/src/components/main/Dialogs.tsx b/src/components/main/Dialogs.tsx index 44ad07e6d..17300df6f 100644 --- a/src/components/main/Dialogs.tsx +++ b/src/components/main/Dialogs.tsx @@ -1,4 +1,3 @@ -import type { FC } from '../../lib/teact/teact'; import { memo, useEffect } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; @@ -22,7 +21,7 @@ type StateProps = { dialogs: (ApiError | ApiContact)[]; }; -const Dialogs: FC = ({ dialogs, currentMessageList }) => { +const Dialogs = ({ dialogs, currentMessageList }: StateProps) => { const { dismissDialog, sendMessage, diff --git a/src/components/main/DownloadManager.tsx b/src/components/main/DownloadManager.tsx index 07b8c073a..3bb912e44 100644 --- a/src/components/main/DownloadManager.tsx +++ b/src/components/main/DownloadManager.tsx @@ -1,4 +1,3 @@ -import type { FC } from '../../lib/teact/teact'; import { memo, useEffect } from '../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../global'; @@ -23,9 +22,9 @@ const GLOBAL_UPDATE_DEBOUNCE = 1000; const processedHashes = new Set(); const downloadedHashes = new Set(); -const DownloadManager: FC = ({ +const DownloadManager = ({ activeDownloads, -}) => { +}: StateProps) => { const { cancelMediaHashDownloads, showNotification } = getActions(); const runDebounced = useRunDebounced(GLOBAL_UPDATE_DEBOUNCE, true); diff --git a/src/components/main/DraftRecipientPicker.async.tsx b/src/components/main/DraftRecipientPicker.async.tsx index c32bd59c5..6e82da745 100644 --- a/src/components/main/DraftRecipientPicker.async.tsx +++ b/src/components/main/DraftRecipientPicker.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './DraftRecipientPicker'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const DraftRecipientPickerAsync: FC = (props) => { +const DraftRecipientPickerAsync = (props: OwnProps) => { const { requestedDraft } = props; const DraftRecipientPicker = useModuleLoader(Bundles.Extra, 'DraftRecipientPicker', !requestedDraft); diff --git a/src/components/main/ForwardRecipientPicker.async.tsx b/src/components/main/ForwardRecipientPicker.async.tsx index 72a402844..08a0df75a 100644 --- a/src/components/main/ForwardRecipientPicker.async.tsx +++ b/src/components/main/ForwardRecipientPicker.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './ForwardRecipientPicker'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const ForwardRecipientPickerAsync: FC = (props) => { +const ForwardRecipientPickerAsync = (props: OwnProps) => { const { isOpen } = props; const ForwardRecipientPicker = useModuleLoader(Bundles.Extra, 'ForwardRecipientPicker', !isOpen); diff --git a/src/components/main/HistoryCalendar.async.tsx b/src/components/main/HistoryCalendar.async.tsx index 2ffce73b3..9d568e62c 100644 --- a/src/components/main/HistoryCalendar.async.tsx +++ b/src/components/main/HistoryCalendar.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './HistoryCalendar'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const HistoryCalendarAsync: FC = (props) => { +const HistoryCalendarAsync = (props: OwnProps) => { const { isOpen } = props; const HistoryCalendar = useModuleLoader(Bundles.Extra, 'HistoryCalendar', !isOpen); diff --git a/src/components/main/LockScreen.async.tsx b/src/components/main/LockScreen.async.tsx index ec1a9dc45..749cb9afd 100644 --- a/src/components/main/LockScreen.async.tsx +++ b/src/components/main/LockScreen.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './LockScreen'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const LockScreenAsync: FC = (props) => { +const LockScreenAsync = (props: OwnProps) => { const { isLocked } = props; const LockScreen = useModuleLoader(Bundles.Main, 'LockScreen', !isLocked); diff --git a/src/components/main/Main.async.tsx b/src/components/main/Main.async.tsx index 803485435..58822b8d0 100644 --- a/src/components/main/Main.async.tsx +++ b/src/components/main/Main.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './Main'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const MainAsync: FC = (props) => { +const MainAsync = (props: OwnProps) => { const Main = useModuleLoader(Bundles.Main, 'Main'); return Main ?
: undefined; diff --git a/src/components/main/Main.tsx b/src/components/main/Main.tsx index af39f8eb1..8a127aee5 100644 --- a/src/components/main/Main.tsx +++ b/src/components/main/Main.tsx @@ -77,7 +77,7 @@ import StoryViewer from '../story/StoryViewer.async'; import AttachBotRecipientPicker from './AttachBotRecipientPicker.async'; import BotTrustModal from './BotTrustModal.async'; import DeleteFolderDialog from './DeleteFolderDialog.async'; -import Dialogs from './Dialogs.async'; +import Dialogs from './Dialogs'; import DownloadManager from './DownloadManager'; import DraftRecipientPicker from './DraftRecipientPicker.async'; import FoldersSidebar from './FoldersSidebar'; @@ -109,7 +109,6 @@ type StateProps = { isMediaViewerOpen: boolean; isStoryViewerOpen: boolean; isForwardModalOpen: boolean; - hasDialogs: boolean; safeLinkModalUrl?: string; isHistoryCalendarOpen: boolean; shouldSkipHistoryAnimations?: boolean; @@ -161,7 +160,6 @@ const Main = ({ isMediaViewerOpen, isStoryViewerOpen, isForwardModalOpen, - hasDialogs, activeGroupCallId, safeLinkModalUrl, isHistoryCalendarOpen, @@ -561,7 +559,7 @@ const Main = ({ - + @@ -627,7 +625,6 @@ export default memo(withGlobal( openedGame, isLeftColumnShown, historyCalendarSelectedAt, - dialogs, newContact, ratingPhoneCall, premiumModal, @@ -660,7 +657,6 @@ export default memo(withGlobal( isStoryViewerOpen: selectIsStoryViewerOpen(global), isForwardModalOpen: selectIsForwardModalOpen(global), isReactionPickerOpen: selectIsReactionPickerOpen(global), - hasDialogs: Boolean(dialogs.length), safeLinkModalUrl, isHistoryCalendarOpen: Boolean(historyCalendarSelectedAt), shouldSkipHistoryAnimations, diff --git a/src/components/main/NewContactModal.async.tsx b/src/components/main/NewContactModal.async.tsx index c5d6a69c5..9f4e9e848 100644 --- a/src/components/main/NewContactModal.async.tsx +++ b/src/components/main/NewContactModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './NewContactModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const NewContactModalAsync: FC = (props) => { +const NewContactModalAsync = (props: OwnProps) => { const { isOpen } = props; const NewContactModal = useModuleLoader(Bundles.Extra, 'NewContactModal', !isOpen); diff --git a/src/components/main/SafeLinkModal.async.tsx b/src/components/main/SafeLinkModal.async.tsx index 05e7a698e..7ccbcd1e3 100644 --- a/src/components/main/SafeLinkModal.async.tsx +++ b/src/components/main/SafeLinkModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './SafeLinkModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const SafeLinkModalAsync: FC = (props) => { +const SafeLinkModalAsync = (props: OwnProps) => { const { url } = props; const SafeLinkModal = useModuleLoader(Bundles.Extra, 'SafeLinkModal', !url); diff --git a/src/components/main/WebAppsCloseConfirmationModal.async.tsx b/src/components/main/WebAppsCloseConfirmationModal.async.tsx index bc04067c1..3313cc33e 100644 --- a/src/components/main/WebAppsCloseConfirmationModal.async.tsx +++ b/src/components/main/WebAppsCloseConfirmationModal.async.tsx @@ -1,14 +1,14 @@ -import type { FC } from '../../lib/teact/teact'; +import type { OwnProps } from './WebAppsCloseConfirmationModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const WebAppsCloseConfirmationModalAsync: FC = (props) => { +const WebAppsCloseConfirmationModalAsync = (props: OwnProps) => { const { modal } = props; const WebAppsCloseConfirmationModal = useModuleLoader(Bundles.Extra, 'WebAppsCloseConfirmationModal', !modal); - return WebAppsCloseConfirmationModal ? : undefined; + return WebAppsCloseConfirmationModal ? : undefined; }; export default WebAppsCloseConfirmationModalAsync; diff --git a/src/components/main/WebAppsCloseConfirmationModal.tsx b/src/components/main/WebAppsCloseConfirmationModal.tsx index 4d2182c37..471bf2620 100644 --- a/src/components/main/WebAppsCloseConfirmationModal.tsx +++ b/src/components/main/WebAppsCloseConfirmationModal.tsx @@ -1,9 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; import { memo, useCallback, useRef, useState, } from '../../lib/teact/teact'; import { getActions } from '../../global'; +import type { TabState } from '../../global/types'; + import buildClassName from '../../util/buildClassName'; import useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation'; @@ -14,16 +15,19 @@ import Button from '../ui/Button'; import Checkbox from '../ui/Checkbox'; import Modal from '../ui/Modal'; -type OwnProps = { - isOpen: boolean; +export type OwnProps = { + modal: TabState['isWebAppsCloseConfirmationModalOpen']; }; -const WebAppsCloseConfirmationModal: FC = ({ - isOpen, -}) => { +const WebAppsCloseConfirmationModal = ({ + modal, +}: OwnProps) => { + const { closeWebAppsCloseConfirmationModal, closeWebAppModal } = getActions(); + const oldLang = useOldLang(); const lang = useLang(); - const { closeWebAppsCloseConfirmationModal, closeWebAppModal } = getActions(); + + const isOpen = Boolean(modal); const [shouldSkipInFuture, setShouldSkipInFuture] = useState(false); diff --git a/src/components/main/premium/GiveawayModal.async.tsx b/src/components/main/premium/GiveawayModal.async.tsx index 5edc71493..b9418f5e4 100644 --- a/src/components/main/premium/GiveawayModal.async.tsx +++ b/src/components/main/premium/GiveawayModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './GiveawayModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const GiveawayModalAsync: FC = (props) => { +const GiveawayModalAsync = (props: OwnProps) => { const { isOpen } = props; const GiveawayModal = useModuleLoader(Bundles.Extra, 'GiveawayModal', !isOpen); diff --git a/src/components/main/premium/PremiumMainModal.async.tsx b/src/components/main/premium/PremiumMainModal.async.tsx index 38a6aab38..bd206afcc 100644 --- a/src/components/main/premium/PremiumMainModal.async.tsx +++ b/src/components/main/premium/PremiumMainModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './PremiumMainModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const PremiumMainModalAsync: FC = (props) => { +const PremiumMainModalAsync = (props: OwnProps) => { const { isOpen } = props; const PremiumMainModal = useModuleLoader(Bundles.Extra, 'PremiumMainModal', !isOpen); diff --git a/src/components/main/premium/StarsGiftingPickerModal.async.tsx b/src/components/main/premium/StarsGiftingPickerModal.async.tsx index 1f262d820..047e10299 100644 --- a/src/components/main/premium/StarsGiftingPickerModal.async.tsx +++ b/src/components/main/premium/StarsGiftingPickerModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './StarsGiftingPickerModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const StarsGiftingPickerModalAsync: FC = (props) => { +const StarsGiftingPickerModalAsync = (props: OwnProps) => { const { isOpen } = props; const StarsGiftingPickerModal = useModuleLoader(Bundles.Stars, 'StarsGiftingPickerModal', !isOpen); diff --git a/src/components/main/premium/common/PremiumLimitReachedModal.async.tsx b/src/components/main/premium/common/PremiumLimitReachedModal.async.tsx index f6b598376..990ef4b29 100644 --- a/src/components/main/premium/common/PremiumLimitReachedModal.async.tsx +++ b/src/components/main/premium/common/PremiumLimitReachedModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './PremiumLimitReachedModal'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const PremiumLimitReachedModalAsync: FC = (props) => { +const PremiumLimitReachedModalAsync = (props: OwnProps) => { const { limit } = props; const PremiumLimitReachedModal = useModuleLoader(Bundles.Extra, 'PremiumLimitReachedModal', !limit); diff --git a/src/components/main/premium/previews/PremiumFeaturePreviewStickers.tsx b/src/components/main/premium/previews/PremiumFeaturePreviewStickers.tsx index bb8d3875a..e92a5e4f0 100644 --- a/src/components/main/premium/previews/PremiumFeaturePreviewStickers.tsx +++ b/src/components/main/premium/previews/PremiumFeaturePreviewStickers.tsx @@ -1,4 +1,3 @@ -import type { FC } from '../../../../lib/teact/teact'; import { memo, useEffect, useRef, useState, } from '../../../../lib/teact/teact'; @@ -25,24 +24,26 @@ type StateProps = { stickers: GlobalState['stickers']['premium']['stickers']; }; -const EMOJI_SIZE_MULTIPLIER = 0.6; -const EFFECT_SIZE_MULTIPLIER = 0.8; -const MAX_EMOJIS = 15; -const ENDED_DELAY = 150; - -const AnimatedCircleSticker: FC<{ +type StickerProps = { size: number; realIndex: number; sticker: ApiSticker; index: number; maxLength: number; + canPlay: boolean; onClick: (index: number) => void; onEnded: (index: number) => void; - canPlay: boolean; -}> = ({ +}; + +const EMOJI_SIZE_MULTIPLIER = 0.6; +const EFFECT_SIZE_MULTIPLIER = 0.8; +const MAX_EMOJIS = 15; +const ENDED_DELAY = 150; + +const AnimatedCircleSticker = ({ size, realIndex, canPlay, sticker, index, maxLength, onClick, onEnded, -}) => { +}: StickerProps) => { const mediaData = useMedia(`sticker${sticker.id}`); const mediaDataAround = useMedia(`sticker${sticker.id}?size=f`); @@ -103,9 +104,9 @@ const AnimatedCircleSticker: FC<{ ); }; -const PremiumFeaturePreviewStickers: FC = ({ +const PremiumFeaturePreviewStickers = ({ stickers, isActive, -}) => { +}: OwnProps & StateProps) => { const containerRef = useRef(); const [offset, setOffset] = useState(0); const [size, setSize] = useState(0); diff --git a/src/components/middle/ChatLanguageModal.async.tsx b/src/components/middle/ChatLanguageModal.async.tsx index 558f9fd43..63be1de2a 100644 --- a/src/components/middle/ChatLanguageModal.async.tsx +++ b/src/components/middle/ChatLanguageModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './ChatLanguageModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const ChatLanguageModalAsync: FC = (props) => { +const ChatLanguageModalAsync = (props: OwnProps) => { const { isOpen } = props; const ChatLanguageModal = useModuleLoader(Bundles.Extra, 'ChatLanguageModal', !isOpen); diff --git a/src/components/middle/EmojiInteractionAnimation.async.tsx b/src/components/middle/EmojiInteractionAnimation.async.tsx index d8a7fb871..ef3260971 100644 --- a/src/components/middle/EmojiInteractionAnimation.async.tsx +++ b/src/components/middle/EmojiInteractionAnimation.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './EmojiInteractionAnimation'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const EmojiInteractionAnimationAsync: FC = (props) => { +const EmojiInteractionAnimationAsync = (props: OwnProps) => { const { activeEmojiInteraction } = props; const EmojiInteractionAnimation = useModuleLoader( Bundles.Extra, 'EmojiInteractionAnimation', !activeEmojiInteraction, diff --git a/src/components/middle/HeaderMenuContainer.async.tsx b/src/components/middle/HeaderMenuContainer.async.tsx index 06001b9e9..e3396c994 100644 --- a/src/components/middle/HeaderMenuContainer.async.tsx +++ b/src/components/middle/HeaderMenuContainer.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './HeaderMenuContainer'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const HeaderMenuContainerAsync: FC = (props) => { +const HeaderMenuContainerAsync = (props: OwnProps) => { const { isOpen } = props; const HeaderMenuContainer = useModuleLoader(Bundles.Extra, 'HeaderMenuContainer', !isOpen); diff --git a/src/components/middle/MessageListHistoryHandler.tsx b/src/components/middle/MessageListHistoryHandler.tsx index 4f06656db..c4b9c37b6 100644 --- a/src/components/middle/MessageListHistoryHandler.tsx +++ b/src/components/middle/MessageListHistoryHandler.tsx @@ -1,4 +1,3 @@ -import type { FC } from '../../lib/teact/teact'; import { memo } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; @@ -15,35 +14,38 @@ type StateProps = { // Actual `MessageList` components are unmounted when deep in the history, // so we need a separate component just for handling history -const MessageListHistoryHandler: FC = ({ messageLists }) => { +const MessageListHistoryHandler = ({ messageLists }: StateProps) => { const { openChat } = getActions(); const closeChat = () => { openChat({ id: undefined }, { forceSyncOnIOs: true }); }; - const MessageHistoryRecord: FC = ({ chatId, type, threadId }) => { - useHistoryBack({ - isActive: true, - hash: createLocationHash(chatId, type, threadId), - onBack: closeChat, - }); - }; - return (
{messageLists?.map((messageList, i) => ( ))}
); }; +const MessageHistoryRecord = ({ + chatId, type, threadId, onBack, +}: GlobalMessageList & { onBack: NoneToVoidFunction }) => { + useHistoryBack({ + isActive: true, + hash: createLocationHash(chatId, type, threadId), + onBack, + }); + + return undefined; +}; + export default memo(withGlobal( (global): Complete => { return { diff --git a/src/components/middle/MessageSelectToolbar.async.tsx b/src/components/middle/MessageSelectToolbar.async.tsx index 754348936..58d6585d7 100644 --- a/src/components/middle/MessageSelectToolbar.async.tsx +++ b/src/components/middle/MessageSelectToolbar.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './MessageSelectToolbar'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const MessageSelectToolbarAsync: FC = (props) => { +const MessageSelectToolbarAsync = (props: OwnProps) => { const { isActive } = props; const MessageSelectToolbar = useModuleLoader(Bundles.Extra, 'MessageSelectToolbar', !isActive); diff --git a/src/components/middle/ReactorListModal.async.tsx b/src/components/middle/ReactorListModal.async.tsx index f2faedd71..a697d02c1 100644 --- a/src/components/middle/ReactorListModal.async.tsx +++ b/src/components/middle/ReactorListModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './ReactorListModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const ReactorListModalAsync: FC = (props) => { +const ReactorListModalAsync = (props: OwnProps) => { const { isOpen } = props; const ReactorListModal = useModuleLoader(Bundles.Extra, 'ReactorListModal', !isOpen); diff --git a/src/components/middle/composer/AttachmentModal.async.tsx b/src/components/middle/composer/AttachmentModal.async.tsx index cfc32cd67..bb5db895a 100644 --- a/src/components/middle/composer/AttachmentModal.async.tsx +++ b/src/components/middle/composer/AttachmentModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './AttachmentModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const AttachmentModalAsync: FC = (props) => { +const AttachmentModalAsync = (props: OwnProps) => { const { attachments } = props; const AttachmentModal = useModuleLoader(Bundles.Extra, 'AttachmentModal', !attachments.length); diff --git a/src/components/middle/composer/BotCommandMenu.async.tsx b/src/components/middle/composer/BotCommandMenu.async.tsx index 145d411c3..88f809c4f 100644 --- a/src/components/middle/composer/BotCommandMenu.async.tsx +++ b/src/components/middle/composer/BotCommandMenu.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './BotCommandMenu'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const BotCommandMenuAsync: FC = (props) => { +const BotCommandMenuAsync = (props: OwnProps) => { const { isOpen } = props; const BotCommandMenu = useModuleLoader(Bundles.Extra, 'BotCommandMenu', !isOpen); diff --git a/src/components/middle/composer/ChatCommandTooltip.async.tsx b/src/components/middle/composer/ChatCommandTooltip.async.tsx index 732fe1f89..494928483 100644 --- a/src/components/middle/composer/ChatCommandTooltip.async.tsx +++ b/src/components/middle/composer/ChatCommandTooltip.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './ChatCommandTooltip'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const ChatCommandTooltipAsync: FC = (props) => { +const ChatCommandTooltipAsync = (props: OwnProps) => { const { isOpen } = props; const ChatCommandTooltip = useModuleLoader(Bundles.Extra, 'ChatCommandTooltip', !isOpen); diff --git a/src/components/middle/composer/CustomEmojiTooltip.async.tsx b/src/components/middle/composer/CustomEmojiTooltip.async.tsx index 36dbcca06..30d5d54ab 100644 --- a/src/components/middle/composer/CustomEmojiTooltip.async.tsx +++ b/src/components/middle/composer/CustomEmojiTooltip.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './CustomEmojiTooltip'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const CustomEmojiTooltipAsync: FC = (props) => { +const CustomEmojiTooltipAsync = (props: OwnProps) => { const { isOpen } = props; const CustomEmojiTooltip = useModuleLoader(Bundles.Extra, 'CustomEmojiTooltip', !isOpen); diff --git a/src/components/middle/composer/CustomSendMenu.async.tsx b/src/components/middle/composer/CustomSendMenu.async.tsx index a6a3f8dfb..021bc8658 100644 --- a/src/components/middle/composer/CustomSendMenu.async.tsx +++ b/src/components/middle/composer/CustomSendMenu.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './CustomSendMenu'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const CustomSendMenuAsync: FC = (props) => { +const CustomSendMenuAsync = (props: OwnProps) => { const { isOpen } = props; const CustomSend = useModuleLoader(Bundles.Extra, 'CustomSendMenu', !isOpen); diff --git a/src/components/middle/composer/DropArea.async.tsx b/src/components/middle/composer/DropArea.async.tsx index 30e67af29..836aa1ca5 100644 --- a/src/components/middle/composer/DropArea.async.tsx +++ b/src/components/middle/composer/DropArea.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './DropArea'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const DropAreaAsync: FC = (props) => { +const DropAreaAsync = (props: OwnProps) => { const { isOpen } = props; const DropArea = useModuleLoader(Bundles.Extra, 'DropArea', !isOpen); diff --git a/src/components/middle/composer/EmojiTooltip.async.tsx b/src/components/middle/composer/EmojiTooltip.async.tsx index d726eec42..e6478962d 100644 --- a/src/components/middle/composer/EmojiTooltip.async.tsx +++ b/src/components/middle/composer/EmojiTooltip.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './EmojiTooltip'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const EmojiTooltipAsync: FC = (props) => { +const EmojiTooltipAsync = (props: OwnProps) => { const { isOpen } = props; const EmojiTooltip = useModuleLoader(Bundles.Extra, 'EmojiTooltip', !isOpen); diff --git a/src/components/middle/composer/InlineBotTooltip.async.tsx b/src/components/middle/composer/InlineBotTooltip.async.tsx index f9128b0d0..5bdd0e030 100644 --- a/src/components/middle/composer/InlineBotTooltip.async.tsx +++ b/src/components/middle/composer/InlineBotTooltip.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './InlineBotTooltip'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const InlineBotTooltipAsync: FC = (props) => { +const InlineBotTooltipAsync = (props: OwnProps) => { const { isOpen } = props; const InlineBotTooltip = useModuleLoader(Bundles.Extra, 'InlineBotTooltip', !isOpen); diff --git a/src/components/middle/composer/MentionTooltip.async.tsx b/src/components/middle/composer/MentionTooltip.async.tsx index 0c1f27922..e9be5d8c4 100644 --- a/src/components/middle/composer/MentionTooltip.async.tsx +++ b/src/components/middle/composer/MentionTooltip.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './MentionTooltip'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const MentionTooltipAsync: FC = (props) => { +const MentionTooltipAsync = (props: OwnProps) => { const { isOpen } = props; const MentionTooltip = useModuleLoader(Bundles.Extra, 'MentionTooltip', !isOpen); diff --git a/src/components/middle/composer/PollModal.async.tsx b/src/components/middle/composer/PollModal.async.tsx index 9a56bb779..e5ed879a6 100644 --- a/src/components/middle/composer/PollModal.async.tsx +++ b/src/components/middle/composer/PollModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './PollModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const PollModalAsync: FC = (props) => { +const PollModalAsync = (props: OwnProps) => { const { isOpen } = props; const PollModal = useModuleLoader(Bundles.Extra, 'PollModal', !isOpen); diff --git a/src/components/middle/composer/SendAsMenu.async.tsx b/src/components/middle/composer/SendAsMenu.async.tsx index 1e0c7db18..d5634e31f 100644 --- a/src/components/middle/composer/SendAsMenu.async.tsx +++ b/src/components/middle/composer/SendAsMenu.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './SendAsMenu'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const SendAsMenuAsync: FC = (props) => { +const SendAsMenuAsync = (props: OwnProps) => { const { isOpen } = props; const SendAsMenu = useModuleLoader(Bundles.Extra, 'SendAsMenu', !isOpen); diff --git a/src/components/middle/composer/StickerTooltip.async.tsx b/src/components/middle/composer/StickerTooltip.async.tsx index f132b8bf6..5002bdfdf 100644 --- a/src/components/middle/composer/StickerTooltip.async.tsx +++ b/src/components/middle/composer/StickerTooltip.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './StickerTooltip'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const StickerTooltipAsync: FC = (props) => { +const StickerTooltipAsync = (props: OwnProps) => { const { isOpen } = props; const StickerTooltip = useModuleLoader(Bundles.Extra, 'StickerTooltip', !isOpen); diff --git a/src/components/middle/composer/SymbolMenu.async.tsx b/src/components/middle/composer/SymbolMenu.async.tsx index 3058b642c..52b241939 100644 --- a/src/components/middle/composer/SymbolMenu.async.tsx +++ b/src/components/middle/composer/SymbolMenu.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './SymbolMenu'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const SymbolMenuAsync: FC = (props) => { +const SymbolMenuAsync = (props: OwnProps) => { const { isOpen } = props; const SymbolMenu = useModuleLoader(Bundles.Extra, 'SymbolMenu', !isOpen); diff --git a/src/components/middle/composer/TextFormatter.async.tsx b/src/components/middle/composer/TextFormatter.async.tsx index ca48755f3..dcf78fbcc 100644 --- a/src/components/middle/composer/TextFormatter.async.tsx +++ b/src/components/middle/composer/TextFormatter.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './TextFormatter'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const TextFormatterAsync: FC = (props) => { +const TextFormatterAsync = (props: OwnProps) => { const { isOpen } = props; const TextFormatter = useModuleLoader(Bundles.Extra, 'TextFormatter', !isOpen); diff --git a/src/components/middle/composer/ToDoListModal.async.tsx b/src/components/middle/composer/ToDoListModal.async.tsx index b06d2e814..52a39b1b1 100644 --- a/src/components/middle/composer/ToDoListModal.async.tsx +++ b/src/components/middle/composer/ToDoListModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './ToDoListModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const ToDoListModalAsync: FC = (props) => { +const ToDoListModalAsync = (props: OwnProps) => { const { modal } = props; const ToDoListModal = useModuleLoader(Bundles.Extra, 'ToDoListModal', !modal); diff --git a/src/components/middle/message/ContextMenuContainer.async.tsx b/src/components/middle/message/ContextMenuContainer.async.tsx index 07ad455fb..45c173791 100644 --- a/src/components/middle/message/ContextMenuContainer.async.tsx +++ b/src/components/middle/message/ContextMenuContainer.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './ContextMenuContainer'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const ContextMenuContainerAsync: FC = (props) => { +const ContextMenuContainerAsync = (props: OwnProps) => { const { isOpen } = props; const ContextMenuContainer = useModuleLoader(Bundles.Extra, 'ContextMenuContainer', !isOpen); diff --git a/src/components/middle/message/SponsoredContextMenuContainer.async.tsx b/src/components/middle/message/SponsoredContextMenuContainer.async.tsx index 942a6a207..5b82e5c81 100644 --- a/src/components/middle/message/SponsoredContextMenuContainer.async.tsx +++ b/src/components/middle/message/SponsoredContextMenuContainer.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './SponsoredContextMenuContainer'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const SponsoredContextMenuContainerAsync: FC = (props) => { +const SponsoredContextMenuContainerAsync = (props: OwnProps) => { const { isOpen } = props; const SponsoredContextMenuContainer = useModuleLoader( Bundles.Extra, 'SponsoredContextMenuContainer', !isOpen, diff --git a/src/components/middle/message/reactions/ReactionPicker.async.tsx b/src/components/middle/message/reactions/ReactionPicker.async.tsx index 5f3caa807..df3108afa 100644 --- a/src/components/middle/message/reactions/ReactionPicker.async.tsx +++ b/src/components/middle/message/reactions/ReactionPicker.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './ReactionPicker'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const ReactionPickerAsync: FC = (props) => { +const ReactionPickerAsync = (props: OwnProps) => { const { isOpen } = props; const ReactionPicker = useModuleLoader(Bundles.Extra, 'ReactionPicker', !isOpen); diff --git a/src/components/middle/search/MiddleSearch.async.tsx b/src/components/middle/search/MiddleSearch.async.tsx index f07282380..d395cd4bc 100644 --- a/src/components/middle/search/MiddleSearch.async.tsx +++ b/src/components/middle/search/MiddleSearch.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './MiddleSearch'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const MiddleSearchAsync: FC = (props) => { +const MiddleSearchAsync = (props: OwnProps) => { const { isActive } = props; const MiddleSearch = useModuleLoader(Bundles.Extra, 'MiddleSearch', !isActive, true); diff --git a/src/components/modals/aboutAds/AboutAdsModal.async.tsx b/src/components/modals/aboutAds/AboutAdsModal.async.tsx index 6f65102a3..0e5e0aa71 100644 --- a/src/components/modals/aboutAds/AboutAdsModal.async.tsx +++ b/src/components/modals/aboutAds/AboutAdsModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './AboutAdsModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const AboutAdsModalAsync: FC = (props) => { +const AboutAdsModalAsync = (props: OwnProps) => { const { modal } = props; const AboutAdsModal = useModuleLoader(Bundles.Extra, 'AboutAdsModal', !modal); diff --git a/src/components/modals/attachBotInstall/AttachBotInstallModal.async.tsx b/src/components/modals/attachBotInstall/AttachBotInstallModal.async.tsx index f2d43b8ff..18235314a 100644 --- a/src/components/modals/attachBotInstall/AttachBotInstallModal.async.tsx +++ b/src/components/modals/attachBotInstall/AttachBotInstallModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './AttachBotInstallModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const AttachBotInstallModalAsync: FC = (props) => { +const AttachBotInstallModalAsync = (props: OwnProps) => { const { modal } = props; const AttachBotInstallModal = useModuleLoader(Bundles.Extra, 'AttachBotInstallModal', !modal); diff --git a/src/components/modals/boost/BoostModal.async.tsx b/src/components/modals/boost/BoostModal.async.tsx index 191f31a06..d0e854768 100644 --- a/src/components/modals/boost/BoostModal.async.tsx +++ b/src/components/modals/boost/BoostModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './BoostModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const BoostModalAsync: FC = (props) => { +const BoostModalAsync = (props: OwnProps) => { const { modal } = props; const BoostModal = useModuleLoader(Bundles.Extra, 'BoostModal', !modal); diff --git a/src/components/modals/chatInvite/ChatInviteModal.async.tsx b/src/components/modals/chatInvite/ChatInviteModal.async.tsx index be799bb08..5cdbdfce1 100644 --- a/src/components/modals/chatInvite/ChatInviteModal.async.tsx +++ b/src/components/modals/chatInvite/ChatInviteModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './ChatInviteModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const ChatInviteModalAsync: FC = (props) => { +const ChatInviteModalAsync = (props: OwnProps) => { const { modal } = props; const ChatInviteModal = useModuleLoader(Bundles.Extra, 'ChatInviteModal', !modal); diff --git a/src/components/modals/chatlist/ChatlistModal.async.tsx b/src/components/modals/chatlist/ChatlistModal.async.tsx index a1314db13..ae1e8418a 100644 --- a/src/components/modals/chatlist/ChatlistModal.async.tsx +++ b/src/components/modals/chatlist/ChatlistModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './ChatlistModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const ChatlistModalAsync: FC = (props) => { +const ChatlistModalAsync = (props: OwnProps) => { const { modal } = props; const ChatlistModal = useModuleLoader(Bundles.Extra, 'ChatlistModal', !modal); diff --git a/src/components/modals/collectible/CollectibleInfoModal.async.tsx b/src/components/modals/collectible/CollectibleInfoModal.async.tsx index b6b43fa81..28a2e800e 100644 --- a/src/components/modals/collectible/CollectibleInfoModal.async.tsx +++ b/src/components/modals/collectible/CollectibleInfoModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './CollectibleInfoModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const CollectibleInfoModalAsync: FC = (props) => { +const CollectibleInfoModalAsync = (props: OwnProps) => { const { modal } = props; const CollectibleInfoModal = useModuleLoader(Bundles.Extra, 'CollectibleInfoModal', !modal); diff --git a/src/components/modals/deleteAccount/DeleteAccountModal.async.tsx b/src/components/modals/deleteAccount/DeleteAccountModal.async.tsx index 5fd97dca8..2c4949368 100644 --- a/src/components/modals/deleteAccount/DeleteAccountModal.async.tsx +++ b/src/components/modals/deleteAccount/DeleteAccountModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './DeleteAccountModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const DeleteAccountModalAsync: FC = (props) => { +const DeleteAccountModalAsync = (props: OwnProps) => { const { modal } = props; const DeleteAccountModal = useModuleLoader(Bundles.Extra, 'DeleteAccountModal', !modal); diff --git a/src/components/modals/emojiStatusAccess/EmojiStatusAccessModal.async.tsx b/src/components/modals/emojiStatusAccess/EmojiStatusAccessModal.async.tsx index c39bd33c7..1f8479a9b 100644 --- a/src/components/modals/emojiStatusAccess/EmojiStatusAccessModal.async.tsx +++ b/src/components/modals/emojiStatusAccess/EmojiStatusAccessModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './EmojiStatusAccessModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const EmojiStatusAccessModalAsync: FC = (props) => { +const EmojiStatusAccessModalAsync = (props: OwnProps) => { const { modal } = props; const EmojiStatusAccessModal = useModuleLoader(Bundles.Extra, 'EmojiStatusAccessModal', !modal); diff --git a/src/components/modals/frozenAccount/FrozenAccountModal.async.tsx b/src/components/modals/frozenAccount/FrozenAccountModal.async.tsx index 475a564de..1b19c40c9 100644 --- a/src/components/modals/frozenAccount/FrozenAccountModal.async.tsx +++ b/src/components/modals/frozenAccount/FrozenAccountModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './FrozenAccountModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const FrozenAccountModalAsync: FC = (props) => { +const FrozenAccountModalAsync = (props: OwnProps) => { const { modal } = props; const FrozenAccountModal = useModuleLoader(Bundles.Extra, 'FrozenAccountModal', !modal); diff --git a/src/components/modals/gift/GiftModal.async.tsx b/src/components/modals/gift/GiftModal.async.tsx index fa97c1165..cc137123b 100644 --- a/src/components/modals/gift/GiftModal.async.tsx +++ b/src/components/modals/gift/GiftModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './GiftModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const GiftModalAsync: FC = (props) => { +const GiftModalAsync = (props: OwnProps) => { const { modal } = props; const GiftModal = useModuleLoader(Bundles.Stars, 'GiftModal', !modal); diff --git a/src/components/modals/gift/StarGiftPriceDecreaseInfoModal.async.tsx b/src/components/modals/gift/StarGiftPriceDecreaseInfoModal.async.tsx index d5fadbf83..896420316 100644 --- a/src/components/modals/gift/StarGiftPriceDecreaseInfoModal.async.tsx +++ b/src/components/modals/gift/StarGiftPriceDecreaseInfoModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './StarGiftPriceDecreaseInfoModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const StarGiftPriceDecreaseInfoModalAsync: FC = (props) => { +const StarGiftPriceDecreaseInfoModalAsync = (props: OwnProps) => { const { modal } = props; const StarGiftPriceDecreaseInfoModal = useModuleLoader(Bundles.Stars, 'StarGiftPriceDecreaseInfoModal', !modal); diff --git a/src/components/modals/gift/info/GiftInfoModal.async.tsx b/src/components/modals/gift/info/GiftInfoModal.async.tsx index 68ddb5a65..e26b6b42e 100644 --- a/src/components/modals/gift/info/GiftInfoModal.async.tsx +++ b/src/components/modals/gift/info/GiftInfoModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './GiftInfoModal'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const GiftInfoModalAsync: FC = (props) => { +const GiftInfoModalAsync = (props: OwnProps) => { const { modal } = props; const GiftInfoModal = useModuleLoader(Bundles.Stars, 'GiftInfoModal', !modal); diff --git a/src/components/modals/gift/locked/GiftLockedModal.async.tsx b/src/components/modals/gift/locked/GiftLockedModal.async.tsx index 657769936..3b7e0848b 100644 --- a/src/components/modals/gift/locked/GiftLockedModal.async.tsx +++ b/src/components/modals/gift/locked/GiftLockedModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './GiftLockedModal'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const GiftLockedModalAsync: FC = (props) => { +const GiftLockedModalAsync = (props: OwnProps) => { const { modal } = props; const GiftLockedModal = useModuleLoader(Bundles.Stars, 'GiftLockedModal', !modal); diff --git a/src/components/modals/gift/message/GiftDescriptionRemoveModal.async.tsx b/src/components/modals/gift/message/GiftDescriptionRemoveModal.async.tsx index 7152ba9fc..1e7067586 100644 --- a/src/components/modals/gift/message/GiftDescriptionRemoveModal.async.tsx +++ b/src/components/modals/gift/message/GiftDescriptionRemoveModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './GiftDescriptionRemoveModal'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const GiftDescriptionRemoveModalAsync: FC = (props) => { +const GiftDescriptionRemoveModalAsync = (props: OwnProps) => { const { modal } = props; const GiftDescriptionRemoveModal = useModuleLoader(Bundles.Stars, 'GiftDescriptionRemoveModal', !modal); diff --git a/src/components/modals/gift/recipient/GiftRecipientPicker.async.tsx b/src/components/modals/gift/recipient/GiftRecipientPicker.async.tsx index 54a86dfa9..c40349fdb 100644 --- a/src/components/modals/gift/recipient/GiftRecipientPicker.async.tsx +++ b/src/components/modals/gift/recipient/GiftRecipientPicker.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './GiftRecipientPicker'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const GiftRecipientPickerAsync: FC = (props) => { +const GiftRecipientPickerAsync = (props: OwnProps) => { const { modal } = props; const GiftRecipientPicker = useModuleLoader(Bundles.Stars, 'GiftRecipientPicker', !modal); diff --git a/src/components/modals/gift/resale/GiftResalePriceComposerModal.async.tsx b/src/components/modals/gift/resale/GiftResalePriceComposerModal.async.tsx index e60b23a1a..671c3e2ed 100644 --- a/src/components/modals/gift/resale/GiftResalePriceComposerModal.async.tsx +++ b/src/components/modals/gift/resale/GiftResalePriceComposerModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './GiftResalePriceComposerModal'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const GiftResalePriceComposerModalAsync: FC = (props) => { +const GiftResalePriceComposerModalAsync = (props: OwnProps) => { const { modal } = props; const GiftResalePriceComposerModal = useModuleLoader(Bundles.Stars, 'GiftResalePriceComposerModal', !modal); diff --git a/src/components/modals/gift/status/GiftStatusInfoModal.async.tsx b/src/components/modals/gift/status/GiftStatusInfoModal.async.tsx index a0c730ff0..2d6ad086e 100644 --- a/src/components/modals/gift/status/GiftStatusInfoModal.async.tsx +++ b/src/components/modals/gift/status/GiftStatusInfoModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './GiftStatusInfoModal'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const GiftStatusInfoModalAsync: FC = (props) => { +const GiftStatusInfoModalAsync = (props: OwnProps) => { const { modal } = props; const GiftStatusInfoModal = useModuleLoader(Bundles.Stars, 'GiftStatusInfoModal', !modal); diff --git a/src/components/modals/gift/transfer/GiftTransferConfirmModal.async.tsx b/src/components/modals/gift/transfer/GiftTransferConfirmModal.async.tsx index 1a8be517e..fc6399994 100644 --- a/src/components/modals/gift/transfer/GiftTransferConfirmModal.async.tsx +++ b/src/components/modals/gift/transfer/GiftTransferConfirmModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './GiftTransferConfirmModal'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const GiftTransferConfirmModalAsync: FC = (props) => { +const GiftTransferConfirmModalAsync = (props: OwnProps) => { const { modal } = props; const GiftTransferConfirmModal = useModuleLoader( Bundles.Stars, diff --git a/src/components/modals/gift/transfer/GiftTransferModal.async.tsx b/src/components/modals/gift/transfer/GiftTransferModal.async.tsx index 94c70cca9..d8215edb4 100644 --- a/src/components/modals/gift/transfer/GiftTransferModal.async.tsx +++ b/src/components/modals/gift/transfer/GiftTransferModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './GiftTransferModal'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const GiftTransferModalAsync: FC = (props) => { +const GiftTransferModalAsync = (props: OwnProps) => { const { modal } = props; const GiftTransferModal = useModuleLoader(Bundles.Stars, 'GiftTransferModal', !modal); diff --git a/src/components/modals/gift/upgrade/GiftUpgradeModal.async.tsx b/src/components/modals/gift/upgrade/GiftUpgradeModal.async.tsx index 9ae43c7c8..0e9e31b91 100644 --- a/src/components/modals/gift/upgrade/GiftUpgradeModal.async.tsx +++ b/src/components/modals/gift/upgrade/GiftUpgradeModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './GiftUpgradeModal'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const GiftUpgradeModalAsync: FC = (props) => { +const GiftUpgradeModalAsync = (props: OwnProps) => { const { modal } = props; const GiftUpgradeModal = useModuleLoader(Bundles.Stars, 'GiftUpgradeModal', !modal); diff --git a/src/components/modals/gift/value/GiftInfoValueModal.async.tsx b/src/components/modals/gift/value/GiftInfoValueModal.async.tsx index 4e6fdf498..dbff7b5ce 100644 --- a/src/components/modals/gift/value/GiftInfoValueModal.async.tsx +++ b/src/components/modals/gift/value/GiftInfoValueModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './GiftInfoValueModal'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const GiftInfoValueModalAsync: FC = (props) => { +const GiftInfoValueModalAsync = (props: OwnProps) => { const { modal } = props; const GiftInfoValueModal = useModuleLoader(Bundles.Stars, 'GiftInfoValueModal', !modal); diff --git a/src/components/modals/gift/withdraw/GiftWithdrawModal.async.tsx b/src/components/modals/gift/withdraw/GiftWithdrawModal.async.tsx index 3f0da9d1a..03421fabb 100644 --- a/src/components/modals/gift/withdraw/GiftWithdrawModal.async.tsx +++ b/src/components/modals/gift/withdraw/GiftWithdrawModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './GiftWithdrawModal'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const GiftWithdrawModalAsync: FC = (props) => { +const GiftWithdrawModalAsync = (props: OwnProps) => { const { modal } = props; const GiftWithdrawModal = useModuleLoader(Bundles.Stars, 'GiftWithdrawModal', !modal); diff --git a/src/components/modals/giftcode/GiftCodeModal.async.tsx b/src/components/modals/giftcode/GiftCodeModal.async.tsx index c5c5a33b4..67d0d03a4 100644 --- a/src/components/modals/giftcode/GiftCodeModal.async.tsx +++ b/src/components/modals/giftcode/GiftCodeModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './GiftCodeModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const GiftCodeModalAsync: FC = (props) => { +const GiftCodeModalAsync = (props: OwnProps) => { const { modal } = props; const GiftCodeModal = useModuleLoader(Bundles.Extra, 'GiftCodeModal', !modal); diff --git a/src/components/modals/inviteViaLink/InviteViaLinkModal.async.tsx b/src/components/modals/inviteViaLink/InviteViaLinkModal.async.tsx index 60764435c..fde4a8fef 100644 --- a/src/components/modals/inviteViaLink/InviteViaLinkModal.async.tsx +++ b/src/components/modals/inviteViaLink/InviteViaLinkModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './InviteViaLinkModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const InviteViaLinkModalAsync: FC = (props) => { +const InviteViaLinkModalAsync = (props: OwnProps) => { const { modal } = props; const InviteViaLinkModal = useModuleLoader(Bundles.Extra, 'InviteViaLinkModal', !modal); diff --git a/src/components/modals/locationAccess/LocationAccessModal.async.tsx b/src/components/modals/locationAccess/LocationAccessModal.async.tsx index 590071327..1a397ea86 100644 --- a/src/components/modals/locationAccess/LocationAccessModal.async.tsx +++ b/src/components/modals/locationAccess/LocationAccessModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './LocationAccessModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const LocationAccessModalAsync: FC = (props) => { +const LocationAccessModalAsync = (props: OwnProps) => { const { modal } = props; const LocationAccessModal = useModuleLoader(Bundles.Extra, 'LocationAccessModal', !modal); diff --git a/src/components/modals/map/MapModal.async.tsx b/src/components/modals/map/MapModal.async.tsx index e60d11cbd..99d302c56 100644 --- a/src/components/modals/map/MapModal.async.tsx +++ b/src/components/modals/map/MapModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './MapModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const MapModalAsync: FC = (props) => { +const MapModalAsync = (props: OwnProps) => { const { modal } = props; const MapModal = useModuleLoader(Bundles.Extra, 'MapModal', !modal); diff --git a/src/components/modals/oneTimeMedia/OneTimeMediaModal.async.tsx b/src/components/modals/oneTimeMedia/OneTimeMediaModal.async.tsx index 8e6ca3319..d61d8e953 100644 --- a/src/components/modals/oneTimeMedia/OneTimeMediaModal.async.tsx +++ b/src/components/modals/oneTimeMedia/OneTimeMediaModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './OneTimeMediaModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const OneTimeMediaModalAsync: FC = (props) => { +const OneTimeMediaModalAsync = (props: OwnProps) => { const { modal } = props; const OneTimeMediaModal = useModuleLoader(Bundles.Extra, 'OneTimeMediaModal', !modal); diff --git a/src/components/modals/paidReaction/PaidReactionModal.async.tsx b/src/components/modals/paidReaction/PaidReactionModal.async.tsx index b580477ee..dcf6b822e 100644 --- a/src/components/modals/paidReaction/PaidReactionModal.async.tsx +++ b/src/components/modals/paidReaction/PaidReactionModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './PaidReactionModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const PaidReactionModalAsync: FC = (props) => { +const PaidReactionModalAsync = (props: OwnProps) => { const { modal } = props; const PaidReactionModal = useModuleLoader(Bundles.Stars, 'PaidReactionModal', !modal); diff --git a/src/components/modals/preparedMessage/PreparedMessageModal.async.tsx b/src/components/modals/preparedMessage/PreparedMessageModal.async.tsx index 8f0b53851..7e4122ca9 100644 --- a/src/components/modals/preparedMessage/PreparedMessageModal.async.tsx +++ b/src/components/modals/preparedMessage/PreparedMessageModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './PreparedMessageModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const PreparedMessageModalAsync: FC = (props) => { +const PreparedMessageModalAsync = (props: OwnProps) => { const { modal } = props; const PreparedMessageModal = useModuleLoader(Bundles.Extra, 'PreparedMessageModal', !modal); diff --git a/src/components/modals/profileRating/ProfileRatingModal.async.tsx b/src/components/modals/profileRating/ProfileRatingModal.async.tsx index c57cd57a6..6a53c225d 100644 --- a/src/components/modals/profileRating/ProfileRatingModal.async.tsx +++ b/src/components/modals/profileRating/ProfileRatingModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './ProfileRatingModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const ProfileRatingModalAsync: FC = (props) => { +const ProfileRatingModalAsync = (props: OwnProps) => { const { modal } = props; const ProfileRatingModal = useModuleLoader(Bundles.Extra, 'ProfileRatingModal', !modal); diff --git a/src/components/modals/reportAd/ReportAdModal.async.tsx b/src/components/modals/reportAd/ReportAdModal.async.tsx index 3ad4d7dc5..76e9fba61 100644 --- a/src/components/modals/reportAd/ReportAdModal.async.tsx +++ b/src/components/modals/reportAd/ReportAdModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './ReportAdModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const ReportAdModalAsync: FC = (props) => { +const ReportAdModalAsync = (props: OwnProps) => { const { modal } = props; const ReportAdModal = useModuleLoader(Bundles.Extra, 'ReportAdModal', !modal); diff --git a/src/components/modals/reportModal/ReportModal.async.tsx b/src/components/modals/reportModal/ReportModal.async.tsx index f45d988aa..95e7d3d87 100644 --- a/src/components/modals/reportModal/ReportModal.async.tsx +++ b/src/components/modals/reportModal/ReportModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './ReportModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const ReportModalAsync: FC = (props) => { +const ReportModalAsync = (props: OwnProps) => { const { modal } = props; const ReportModal = useModuleLoader(Bundles.Extra, 'ReportModal', !modal); diff --git a/src/components/modals/sharePreparedMessage/SharePreparedMessageModal.async.tsx b/src/components/modals/sharePreparedMessage/SharePreparedMessageModal.async.tsx index f6983de10..ca1ca0b74 100644 --- a/src/components/modals/sharePreparedMessage/SharePreparedMessageModal.async.tsx +++ b/src/components/modals/sharePreparedMessage/SharePreparedMessageModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './SharePreparedMessageModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const SharePreparedMessageModalAsync: FC = (props) => { +const SharePreparedMessageModalAsync = (props: OwnProps) => { const { modal } = props; const SharePreparedMessageModal = useModuleLoader(Bundles.Extra, 'SharePreparedMessageModal', !modal); diff --git a/src/components/modals/stars/StarsBalanceModal.async.tsx b/src/components/modals/stars/StarsBalanceModal.async.tsx index a73ac310b..54cd54aff 100644 --- a/src/components/modals/stars/StarsBalanceModal.async.tsx +++ b/src/components/modals/stars/StarsBalanceModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './StarsBalanceModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const StarsBalanceModalAsync: FC = (props) => { +const StarsBalanceModalAsync = (props: OwnProps) => { const { modal } = props; const StarsBalanceModal = useModuleLoader(Bundles.Stars, 'StarsBalanceModal', !modal); diff --git a/src/components/modals/stars/StarsPaymentModal.async.tsx b/src/components/modals/stars/StarsPaymentModal.async.tsx index 8cb82de39..c579b692a 100644 --- a/src/components/modals/stars/StarsPaymentModal.async.tsx +++ b/src/components/modals/stars/StarsPaymentModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './StarsPaymentModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const StarPaymentModalAsync: FC = (props) => { +const StarPaymentModalAsync = (props: OwnProps) => { const { modal } = props; const StarPaymentModal = useModuleLoader(Bundles.Stars, 'StarPaymentModal', !modal?.inputInvoice); diff --git a/src/components/modals/stars/chatRefund/ChatRefundModal.async.tsx b/src/components/modals/stars/chatRefund/ChatRefundModal.async.tsx index 4aed9eaf5..64ca2584d 100644 --- a/src/components/modals/stars/chatRefund/ChatRefundModal.async.tsx +++ b/src/components/modals/stars/chatRefund/ChatRefundModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './ChatRefundModal'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const ChatRefundModalAsync: FC = (props) => { +const ChatRefundModalAsync = (props: OwnProps) => { const { modal } = props; const ChatRefundModal = useModuleLoader(Bundles.Stars, 'ChatRefundModal', !modal); diff --git a/src/components/modals/stars/gift/StarsGiftModal.async.tsx b/src/components/modals/stars/gift/StarsGiftModal.async.tsx index 51ca2804c..4485ab50d 100644 --- a/src/components/modals/stars/gift/StarsGiftModal.async.tsx +++ b/src/components/modals/stars/gift/StarsGiftModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './StarsGiftModal'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const StarsGiftModalAsync: FC = (props) => { +const StarsGiftModalAsync = (props: OwnProps) => { const { modal } = props; const StarsGiftModal = useModuleLoader(Bundles.Stars, 'StarsGiftModal', !modal); diff --git a/src/components/modals/stars/subscription/StarsSubscriptionModal.async.tsx b/src/components/modals/stars/subscription/StarsSubscriptionModal.async.tsx index 2867db927..a18708899 100644 --- a/src/components/modals/stars/subscription/StarsSubscriptionModal.async.tsx +++ b/src/components/modals/stars/subscription/StarsSubscriptionModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './StarsSubscriptionModal'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const StarsSubscriptionModalAsync: FC = (props) => { +const StarsSubscriptionModalAsync = (props: OwnProps) => { const { modal } = props; const StarsSubscriptionModal = useModuleLoader(Bundles.Stars, 'StarsSubscriptionModal', !modal); diff --git a/src/components/modals/stars/transaction/StarsTransactionModal.async.tsx b/src/components/modals/stars/transaction/StarsTransactionModal.async.tsx index 5e588b805..8e190da10 100644 --- a/src/components/modals/stars/transaction/StarsTransactionModal.async.tsx +++ b/src/components/modals/stars/transaction/StarsTransactionModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../../lib/teact/teact'; - import type { OwnProps } from './StarsTransactionModal'; import { Bundles } from '../../../../util/moduleLoader'; import useModuleLoader from '../../../../hooks/useModuleLoader'; -const StarsTransactionModalAsync: FC = (props) => { +const StarsTransactionModalAsync = (props: OwnProps) => { const { modal } = props; const StarsTransactionModal = useModuleLoader(Bundles.Stars, 'StarsTransactionInfoModal', !modal); diff --git a/src/components/modals/suggestMessage/SuggestMessageModal.async.tsx b/src/components/modals/suggestMessage/SuggestMessageModal.async.tsx index 98b46252a..ded51d982 100644 --- a/src/components/modals/suggestMessage/SuggestMessageModal.async.tsx +++ b/src/components/modals/suggestMessage/SuggestMessageModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './SuggestMessageModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const SuggestMessageModalAsync: FC = (props) => { +const SuggestMessageModalAsync = (props: OwnProps) => { const { modal } = props; const SuggestMessageModal = useModuleLoader(Bundles.Extra, 'SuggestMessageModal', !modal); diff --git a/src/components/modals/suggestedPostApproval/SuggestedPostApprovalModal.async.tsx b/src/components/modals/suggestedPostApproval/SuggestedPostApprovalModal.async.tsx index 4c99a9495..6ea4dad88 100644 --- a/src/components/modals/suggestedPostApproval/SuggestedPostApprovalModal.async.tsx +++ b/src/components/modals/suggestedPostApproval/SuggestedPostApprovalModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './SuggestedPostApprovalModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const SuggestedPostApprovalModalAsync: FC = (props) => { +const SuggestedPostApprovalModalAsync = (props: OwnProps) => { const { modal } = props; const SuggestedPostApprovalModal = useModuleLoader(Bundles.Extra, 'SuggestedPostApprovalModal', !modal); diff --git a/src/components/modals/suggestedStatus/SuggestedStatusModal.async.tsx b/src/components/modals/suggestedStatus/SuggestedStatusModal.async.tsx index df3feee39..c922b53aa 100644 --- a/src/components/modals/suggestedStatus/SuggestedStatusModal.async.tsx +++ b/src/components/modals/suggestedStatus/SuggestedStatusModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './SuggestedStatusModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const SuggestedStatusModalAsync: FC = (props) => { +const SuggestedStatusModalAsync = (props: OwnProps) => { const { modal } = props; const SuggestedStatusModal = useModuleLoader(Bundles.Extra, 'SuggestedStatusModal', !modal); diff --git a/src/components/modals/urlAuth/UrlAuthModal.async.tsx b/src/components/modals/urlAuth/UrlAuthModal.async.tsx index 6b91e6372..35d78ec0f 100644 --- a/src/components/modals/urlAuth/UrlAuthModal.async.tsx +++ b/src/components/modals/urlAuth/UrlAuthModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './UrlAuthModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const UrlAuthModalAsync: FC = (props) => { +const UrlAuthModalAsync = (props: OwnProps) => { const { modal } = props; const UrlAuthModal = useModuleLoader(Bundles.Extra, 'UrlAuthModal', !modal); diff --git a/src/components/modals/webApp/MoreAppsTabContent.tsx b/src/components/modals/webApp/MoreAppsTabContent.tsx index 57067a160..3d1c794cb 100644 --- a/src/components/modals/webApp/MoreAppsTabContent.tsx +++ b/src/components/modals/webApp/MoreAppsTabContent.tsx @@ -1,4 +1,3 @@ -import type { FC } from '../../../lib/teact/teact'; import { memo, useCallback, @@ -34,10 +33,10 @@ type StateProps = { const LESS_GRID_ITEMS_AMOUNT = 5; const runThrottled = throttle((cb) => cb(), 500, true); -const MoreAppsTabContent: FC = ({ +const MoreAppsTabContent = ({ foundIds, recentBotIds, -}) => { +}: StateProps) => { const oldLang = useOldLang(); const lang = useLang(); const [shouldShowMoreMine, setShouldShowMoreMine] = useState(false); diff --git a/src/components/modals/webApp/WebAppModal.async.tsx b/src/components/modals/webApp/WebAppModal.async.tsx index d4e346b5a..b8a900642 100644 --- a/src/components/modals/webApp/WebAppModal.async.tsx +++ b/src/components/modals/webApp/WebAppModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './WebAppModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; -const WebAppModalAsync: FC = (props) => { +const WebAppModalAsync = (props: OwnProps) => { const { modal } = props; const WebAppModal = useModuleLoader(Bundles.Extra, 'WebAppModal', !modal?.isModalOpen); diff --git a/src/components/payment/PaymentModal.async.tsx b/src/components/payment/PaymentModal.async.tsx index 129a28d4c..c98a61c31 100644 --- a/src/components/payment/PaymentModal.async.tsx +++ b/src/components/payment/PaymentModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './PaymentModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const PaymentModalAsync: FC = (props) => { +const PaymentModalAsync = (props: OwnProps) => { const { isOpen } = props; const PaymentModal = useModuleLoader(Bundles.Extra, 'PaymentModal', !isOpen); diff --git a/src/components/payment/ReceiptModal.async.tsx b/src/components/payment/ReceiptModal.async.tsx index a448a3299..3123b239e 100644 --- a/src/components/payment/ReceiptModal.async.tsx +++ b/src/components/payment/ReceiptModal.async.tsx @@ -1,12 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './ReceiptModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; -const ReceiptModalAsync: FC = (props) => { +const ReceiptModalAsync = (props: OwnProps) => { const { isOpen } = props; const ReceiptModal = useModuleLoader(Bundles.Extra, 'ReceiptModal', !isOpen); diff --git a/src/components/right/CreateTopic.async.tsx b/src/components/right/CreateTopic.async.tsx index ff35e760a..c5a3ce5c3 100644 --- a/src/components/right/CreateTopic.async.tsx +++ b/src/components/right/CreateTopic.async.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './CreateTopic'; import { Bundles } from '../../util/moduleLoader'; @@ -8,7 +6,7 @@ import useModuleLoader from '../../hooks/useModuleLoader'; import Loading from '../ui/Loading'; -const CreateTopicAsync: FC = (props) => { +const CreateTopicAsync = (props: OwnProps) => { const CreateTopic = useModuleLoader(Bundles.Extra, 'CreateTopic'); return CreateTopic ? : ; diff --git a/src/components/right/EditTopic.async.tsx b/src/components/right/EditTopic.async.tsx index c20399eeb..bfe7903f4 100644 --- a/src/components/right/EditTopic.async.tsx +++ b/src/components/right/EditTopic.async.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../lib/teact/teact'; - import type { OwnProps } from './EditTopic'; import { Bundles } from '../../util/moduleLoader'; @@ -8,7 +6,7 @@ import useModuleLoader from '../../hooks/useModuleLoader'; import Loading from '../ui/Loading'; -const EditTopicAsync: FC = (props) => { +const EditTopicAsync = (props: OwnProps) => { const EditTopic = useModuleLoader(Bundles.Extra, 'EditTopic'); return EditTopic ? : ; diff --git a/src/components/right/GifSearch.async.tsx b/src/components/right/GifSearch.async.tsx index f8690ae0d..457d7e64f 100644 --- a/src/components/right/GifSearch.async.tsx +++ b/src/components/right/GifSearch.async.tsx @@ -1,4 +1,4 @@ -import type { FC } from '../../lib/teact/teact'; +import type { OwnProps } from './GifSearch'; import { Bundles } from '../../util/moduleLoader'; @@ -6,10 +6,11 @@ import useModuleLoader from '../../hooks/useModuleLoader'; import Loading from '../ui/Loading'; -const GifSearchAsync: FC = () => { - const GifSearch = useModuleLoader(Bundles.Extra, 'GifSearch'); +const GifSearchAsync = (props: OwnProps) => { + const { isActive } = props; + const GifSearch = useModuleLoader(Bundles.Extra, 'GifSearch', !isActive); - return GifSearch ? : ; + return GifSearch ? : ; }; export default GifSearchAsync; diff --git a/src/components/right/GifSearch.tsx b/src/components/right/GifSearch.tsx index 36ddd5f6f..f141f6545 100644 --- a/src/components/right/GifSearch.tsx +++ b/src/components/right/GifSearch.tsx @@ -30,7 +30,7 @@ import Loading from '../ui/Loading'; import './GifSearch.scss'; -type OwnProps = { +export type OwnProps = { onClose: NoneToVoidFunction; isActive: boolean; }; diff --git a/src/components/right/PollResults.async.tsx b/src/components/right/PollResults.async.tsx index ee42d80c1..3ef1de7f6 100644 --- a/src/components/right/PollResults.async.tsx +++ b/src/components/right/PollResults.async.tsx @@ -1,4 +1,4 @@ -import type { FC } from '../../lib/teact/teact'; +import type { OwnProps } from './PollResults'; import { Bundles } from '../../util/moduleLoader'; @@ -6,10 +6,11 @@ import useModuleLoader from '../../hooks/useModuleLoader'; import Loading from '../ui/Loading'; -const PollResultsAsync: FC = () => { - const PollResults = useModuleLoader(Bundles.Extra, 'PollResults'); +const PollResultsAsync = (props: OwnProps) => { + const { isActive } = props; + const PollResults = useModuleLoader(Bundles.Extra, 'PollResults', !isActive); - return PollResults ? : ; + return PollResults ? : ; }; export default PollResultsAsync; diff --git a/src/components/right/PollResults.tsx b/src/components/right/PollResults.tsx index 9bf3bcbc2..9dd08dffc 100644 --- a/src/components/right/PollResults.tsx +++ b/src/components/right/PollResults.tsx @@ -1,4 +1,3 @@ -import type { FC } from '../../lib/teact/teact'; import { memo } from '../../lib/teact/teact'; import { withGlobal } from '../../global'; @@ -18,7 +17,7 @@ import PollAnswerResults from './PollAnswerResults'; import './PollResults.scss'; -type OwnProps = { +export type OwnProps = { isActive: boolean; onClose: NoneToVoidFunction; }; @@ -29,13 +28,13 @@ type StateProps = { poll?: ApiPoll; }; -const PollResults: FC = ({ +const PollResults = ({ isActive, chat, message, poll, onClose, -}) => { +}: OwnProps & StateProps) => { const lang = useOldLang(); useHistoryBack({ diff --git a/src/components/right/StickerSearch.async.tsx b/src/components/right/StickerSearch.async.tsx index c8d060ad3..224701831 100644 --- a/src/components/right/StickerSearch.async.tsx +++ b/src/components/right/StickerSearch.async.tsx @@ -1,4 +1,4 @@ -import type { FC } from '../../lib/teact/teact'; +import type { OwnProps } from './StickerSearch'; import { Bundles } from '../../util/moduleLoader'; @@ -6,10 +6,11 @@ import useModuleLoader from '../../hooks/useModuleLoader'; import Loading from '../ui/Loading'; -const StickerSearchAsync: FC = () => { - const StickerSearch = useModuleLoader(Bundles.Extra, 'StickerSearch'); +const StickerSearchAsync = (props: OwnProps) => { + const { isActive } = props; + const StickerSearch = useModuleLoader(Bundles.Extra, 'StickerSearch', !isActive); - return StickerSearch ? : ; + return StickerSearch ? : ; }; export default StickerSearchAsync; diff --git a/src/components/right/StickerSearch.tsx b/src/components/right/StickerSearch.tsx index bdc748350..3420f6620 100644 --- a/src/components/right/StickerSearch.tsx +++ b/src/components/right/StickerSearch.tsx @@ -1,4 +1,3 @@ -import type { FC } from '../../lib/teact/teact'; import { memo, useEffect, useRef, } from '../../lib/teact/teact'; @@ -16,7 +15,7 @@ import StickerSetResult from './StickerSetResult'; import './StickerSearch.scss'; -type OwnProps = { +export type OwnProps = { onClose: NoneToVoidFunction; isActive: boolean; }; @@ -32,14 +31,14 @@ const INTERSECTION_THROTTLE = 200; const runThrottled = throttle((cb) => cb(), 60000, true); -const StickerSearch: FC = ({ +const StickerSearch = ({ isActive, query, featuredIds, resultIds, isModalOpen, onClose, -}) => { +}: OwnProps & StateProps) => { const { loadFeaturedStickers } = getActions(); const containerRef = useRef(); diff --git a/src/components/right/management/Management.async.tsx b/src/components/right/management/Management.async.tsx index 740ade6c3..75dd8502f 100644 --- a/src/components/right/management/Management.async.tsx +++ b/src/components/right/management/Management.async.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './Management'; import { Bundles } from '../../../util/moduleLoader'; @@ -8,7 +6,7 @@ import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; -const ManagementAsync: FC = (props) => { +const ManagementAsync = (props: OwnProps) => { const Management = useModuleLoader(Bundles.Extra, 'Management'); return Management ? : ; diff --git a/src/components/right/statistics/MessageStatistics.async.tsx b/src/components/right/statistics/MessageStatistics.async.tsx index 27ffd98da..fb8564345 100644 --- a/src/components/right/statistics/MessageStatistics.async.tsx +++ b/src/components/right/statistics/MessageStatistics.async.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './MessageStatistics'; import { Bundles } from '../../../util/moduleLoader'; @@ -8,7 +6,7 @@ import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; -const MessageStatisticsAsync: FC = (props) => { +const MessageStatisticsAsync = (props: OwnProps) => { const MessageStatistics = useModuleLoader(Bundles.Extra, 'MessageStatistics'); return MessageStatistics ? : ; diff --git a/src/components/right/statistics/Statistics.async.tsx b/src/components/right/statistics/Statistics.async.tsx index d7ed8fffc..160df703a 100644 --- a/src/components/right/statistics/Statistics.async.tsx +++ b/src/components/right/statistics/Statistics.async.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './Statistics'; import { Bundles } from '../../../util/moduleLoader'; @@ -8,7 +6,7 @@ import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; -const StatisticsAsync: FC = (props) => { +const StatisticsAsync = (props: OwnProps) => { const Statistics = useModuleLoader(Bundles.Extra, 'Statistics'); return Statistics ? : ; diff --git a/src/components/right/statistics/StoryStatistics.async.tsx b/src/components/right/statistics/StoryStatistics.async.tsx index 97616f3e2..1f1d25a49 100644 --- a/src/components/right/statistics/StoryStatistics.async.tsx +++ b/src/components/right/statistics/StoryStatistics.async.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../../lib/teact/teact'; - import type { OwnProps } from './StoryStatistics'; import { Bundles } from '../../../util/moduleLoader'; @@ -8,7 +6,7 @@ import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; -const StoryStatisticsAsync: FC = (props) => { +const StoryStatisticsAsync = (props: OwnProps) => { const StoryStatistics = useModuleLoader(Bundles.Extra, 'StoryStatistics'); return StoryStatistics ? : ; diff --git a/src/components/test/Test.tsx b/src/components/test/Test.tsx index da58f7281..6e8e9851a 100644 --- a/src/components/test/Test.tsx +++ b/src/components/test/Test.tsx @@ -1,4 +1,3 @@ -import type { FC } from '../../lib/teact/teact'; import { useState } from '../../lib/teact/teact'; import { withGlobal } from '../../global'; @@ -14,7 +13,7 @@ type StateProps = { let lastTimeout: number | undefined; -const Test: FC = ({ authState, globalRand }) => { +const Test = ({ authState, globalRand }: StateProps) => { // eslint-disable-next-line no-console console.log('rendering `Test`', authState, globalRand); diff --git a/src/components/test/TestControlledInput.tsx b/src/components/test/TestControlledInput.tsx index b9eaf87cd..1c9b3e224 100644 --- a/src/components/test/TestControlledInput.tsx +++ b/src/components/test/TestControlledInput.tsx @@ -1,8 +1,6 @@ -import type { FC } from '../../lib/teact/teact'; -import type React from '../../lib/teact/teact'; import { useState } from '../../lib/teact/teact'; -const Test: FC = () => { +const Test = () => { const [inputValue, setInputValue] = useState('Controlled'); const [isCheckboxAllowed, setIsCheckboxAllowed] = useState(true); const [isChecked, setIsChecked] = useState(true); diff --git a/src/components/test/TestPortal.tsx b/src/components/test/TestPortal.tsx index a5db5c8e9..e8b01d921 100644 --- a/src/components/test/TestPortal.tsx +++ b/src/components/test/TestPortal.tsx @@ -1,4 +1,3 @@ -import type { FC } from '../../lib/teact/teact'; import { useState } from '../../lib/teact/teact'; import Portal from '../ui/Portal'; @@ -17,7 +16,7 @@ const StateChecker = () => { ); }; -const TestPortal: FC = () => { +const TestPortal = () => { const [value, setValue] = useState(0); const position = 100 + Math.round(Math.random() * 300); diff --git a/src/components/test/TestSetContent.tsx b/src/components/test/TestSetContent.tsx index bcea49a06..5f9678b99 100644 --- a/src/components/test/TestSetContent.tsx +++ b/src/components/test/TestSetContent.tsx @@ -1,11 +1,10 @@ -import type { FC } from '../../lib/teact/teact'; import { useState } from '../../lib/teact/teact'; // 1. Make sure "First line" is rendered even if followed by a component with single text. // 2. Make sure it then can be normally removed (target is preserved). // 3. Make sure "Last line" is also rendered. -const Text: FC = () => { +const Text = () => { return 'text component'; }; diff --git a/src/components/ui/MenuItem.tsx b/src/components/ui/MenuItem.tsx index 1fa46178f..ea323171c 100644 --- a/src/components/ui/MenuItem.tsx +++ b/src/components/ui/MenuItem.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../lib/teact/teact'; - import type { IconName } from '../../types/icons'; import { IS_TEST } from '../../config'; @@ -17,9 +15,6 @@ export type MenuItemProps = { customIcon?: React.ReactNode; className?: string; children: React.ReactNode; - onClick?: (e: React.SyntheticEvent, arg?: number) => void; - clickArg?: number; - onContextMenu?: (e: React.UIEvent) => void; href?: string; rel?: string; target?: string; @@ -29,6 +24,9 @@ export type MenuItemProps = { ariaLabel?: string; withWrap?: boolean; withPreventDefaultOnMouseDown?: boolean; + clickArg?: number; + onClick?: (e: React.SyntheticEvent, arg?: number) => void; + onContextMenu?: (e: React.UIEvent) => void; } & ({ icon: 'A' | 'K'; isCharIcon: true; @@ -37,14 +35,13 @@ export type MenuItemProps = { isCharIcon?: false; }); -const MenuItem: FC = (props) => { +const MenuItem = (props: MenuItemProps) => { const { icon, isCharIcon, customIcon, className, children, - onClick, href, target, download, @@ -53,9 +50,10 @@ const MenuItem: FC = (props) => { ariaLabel, withWrap, rel = 'noopener noreferrer', - onContextMenu, - clickArg, withPreventDefaultOnMouseDown, + clickArg, + onClick, + onContextMenu, } = props; const lang = useLang(); diff --git a/src/components/ui/ProgressSpinner.tsx b/src/components/ui/ProgressSpinner.tsx index 8ff42ac3f..c3ddd0951 100644 --- a/src/components/ui/ProgressSpinner.tsx +++ b/src/components/ui/ProgressSpinner.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../lib/teact/teact'; -import type React from '../../lib/teact/teact'; import { memo, useEffect, useRef } from '../../lib/teact/teact'; import { requestMutation } from '../../lib/fasterdom/fasterdom'; @@ -14,6 +12,17 @@ import Icon from '../common/icons/Icon'; import './ProgressSpinner.scss'; +type OwnProps = { + progress?: number; + size?: 's' | 'm' | 'l' | 'xl'; + square?: boolean; + transparent?: boolean; + noCross?: boolean; + rotationOffset?: number; + withColor?: boolean; + onClick?: (e: React.MouseEvent) => void; +}; + const SIZES = { s: 42, m: 48, l: 54, xl: 52, }; @@ -25,16 +34,7 @@ const MAX_PROGRESS = 1; const GROW_DURATION = 600; // 0.6 s const ROTATE_DURATION = 2000; // 2 s -const ProgressSpinner: FC<{ - progress?: number; - size?: 's' | 'm' | 'l' | 'xl'; - square?: boolean; - transparent?: boolean; - noCross?: boolean; - rotationOffset?: number; - withColor?: boolean; - onClick?: (e: React.MouseEvent) => void; -}> = ({ +const ProgressSpinner = ({ progress = 0, size = 'l', square, @@ -43,7 +43,7 @@ const ProgressSpinner: FC<{ rotationOffset, withColor, onClick, -}) => { +}: OwnProps) => { const canvasRef = useRef(); const width = SIZES[size]; const progressRef = useStateRef(progress); diff --git a/src/components/ui/RippleEffect.tsx b/src/components/ui/RippleEffect.tsx index de9dec9ac..1fa2a81c8 100644 --- a/src/components/ui/RippleEffect.tsx +++ b/src/components/ui/RippleEffect.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../lib/teact/teact'; -import type React from '../../lib/teact/teact'; import { memo, useMemo, useState } from '../../lib/teact/teact'; import { debounce } from '../../util/schedulers'; @@ -16,7 +14,7 @@ interface Ripple { const ANIMATION_DURATION_MS = 700; -const RippleEffect: FC = () => { +const RippleEffect = () => { const [ripples, setRipples] = useState([]); const cleanUpDebounced = useMemo(() => { diff --git a/src/components/ui/Select.tsx b/src/components/ui/Select.tsx index 17c04dc99..ea40b558e 100644 --- a/src/components/ui/Select.tsx +++ b/src/components/ui/Select.tsx @@ -1,5 +1,5 @@ import type { ChangeEvent } from 'react'; -import type { ElementRef, FC } from '../../lib/teact/teact'; +import type { ElementRef } from '../../lib/teact/teact'; import type React from '../../lib/teact/teact'; import { memo } from '../../lib/teact/teact'; @@ -17,7 +17,7 @@ type OwnProps = { children: React.ReactNode; }; -const Select: FC = (props) => { +const Select = (props: OwnProps) => { const { id, value, diff --git a/src/components/ui/Spinner.tsx b/src/components/ui/Spinner.tsx index 6ea25cd80..59ea72518 100644 --- a/src/components/ui/Spinner.tsx +++ b/src/components/ui/Spinner.tsx @@ -1,18 +1,18 @@ -import type { FC } from '../../lib/teact/teact'; - import buildClassName from '../../util/buildClassName'; import './Spinner.scss'; -const Spinner: FC<{ +type OwnProps = { color?: 'blue' | 'white' | 'black' | 'green' | 'gray' | 'yellow'; backgroundColor?: 'light' | 'dark'; className?: string; -}> = ({ +}; + +const Spinner = ({ color = 'blue', backgroundColor, className, -}) => { +}: OwnProps) => { return (