From 9fcbd8aaffcfd9cb08faa6fb26bc549cdd730e0a Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Sat, 24 May 2025 11:27:14 +0200 Subject: [PATCH] Rename context name --- src/App.tsx | 7 ++++--- src/Wallets.tsx | 4 ++-- src/components/Apps/AppPublish.tsx | 4 ++-- src/components/Apps/AppRating.tsx | 4 ++-- src/components/Apps/AppsDesktop.tsx | 4 ++-- src/components/Apps/AppsDevModeHome.tsx | 4 ++-- src/components/Apps/AppsPrivate.tsx | 4 ++-- src/components/Chat/AdminSpaceInner.tsx | 4 ++-- src/components/Chat/ChatGroup.tsx | 4 ++-- src/components/Chat/CreateCommonSecret.tsx | 4 ++-- src/components/Chat/GroupAnnouncements.tsx | 4 ++-- src/components/Chat/GroupAvatar.tsx | 4 ++-- src/components/Chat/MessageItem.tsx | 4 ++-- src/components/Embeds/AttachmentEmbed.tsx | 4 ++-- src/components/Embeds/PollEmbed.tsx | 4 ++-- src/components/Embeds/VideoPlayer.tsx | 4 ++-- src/components/GlobalActions/JoinGroup.tsx | 4 ++-- src/components/Group/AddGroup.tsx | 4 ++-- src/components/Group/AddGroupList.tsx | 4 ++-- src/components/Group/BlockedUsersModal.tsx | 4 ++-- src/components/Group/Forum/NewThread.tsx | 8 ++++++-- src/components/Group/ListOfGroupPromotions.tsx | 4 ++-- src/components/Group/ManageMembers.tsx | 4 ++-- src/components/Group/Settings.tsx | 5 +++-- src/components/Group/UserListOfInvites.tsx | 4 ++-- src/components/MainAvatar.tsx | 8 ++++++-- src/components/NotAuthenticated.tsx | 5 +++-- src/components/Save/Save.tsx | 4 ++-- src/components/Tutorials/Tutorials.tsx | 5 +++-- src/components/WrapperUserAction.tsx | 4 ++-- src/hooks/useHandlePrivateApps.tsx | 4 ++-- src/hooks/useQortalMessageListener.tsx | 4 ++-- 32 files changed, 77 insertions(+), 65 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index d756f44..777454d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -236,7 +236,8 @@ const defaultValuesGlobal = { setOpenTutorialModal: () => {}, }; -export const MyContext = createContext(defaultValues); +export const QORTAL_APP_CONTEXT = + createContext(defaultValues); export let globalApiKey: string | null = null; @@ -2016,7 +2017,7 @@ function App() { > - + {extState === 'not-authenticated' && ( - + {extState === 'create-wallet' && walletToBeDownloaded && ( { @@ -44,7 +44,7 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { const [seedValue, setSeedValue] = useState(''); const [seedName, setSeedName] = useState(''); const [seedError, setSeedError] = useState(''); - const { hasSeenGettingStarted } = useContext(MyContext); + const { hasSeenGettingStarted } = useContext(QORTAL_APP_CONTEXT); const [password, setPassword] = useState(''); const [isOpenSeedModal, setIsOpenSeedModal] = useState(false); const [isLoadingEncryptSeed, setIsLoadingEncryptSeed] = useState(false); diff --git a/src/components/Apps/AppPublish.tsx b/src/components/Apps/AppPublish.tsx index 7dfcf3c..7800c55 100644 --- a/src/components/Apps/AppPublish.tsx +++ b/src/components/Apps/AppPublish.tsx @@ -16,7 +16,7 @@ import { useTheme, } from '@mui/material'; import { styled } from '@mui/system'; -import { MyContext, getBaseApiReact } from '../../App'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; import { Spacer } from '../../common/Spacer'; import { executeEvent } from '../../utils/events'; import { useDropzone } from 'react-dropzone'; @@ -65,7 +65,7 @@ export const AppPublish = ({ names, categories }) => { const [category, setCategory] = useState(''); const [appType, setAppType] = useState('APP'); const [file, setFile] = useState(null); - const { show } = useContext(MyContext); + const { show } = useContext(QORTAL_APP_CONTEXT); const theme = useTheme(); const { t } = useTranslation(['auth', 'core', 'group']); const [tag1, setTag1] = useState(''); diff --git a/src/components/Apps/AppRating.tsx b/src/components/Apps/AppRating.tsx index 17d2cf0..9d63213 100644 --- a/src/components/Apps/AppRating.tsx +++ b/src/components/Apps/AppRating.tsx @@ -1,7 +1,7 @@ import { Box, Rating } from '@mui/material'; import { useCallback, useContext, useEffect, useRef, useState } from 'react'; import { getFee } from '../../background'; -import { MyContext, getBaseApiReact } from '../../App'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; import { CustomizedSnackbars } from '../Snackbar/Snackbar'; import { StarFilledIcon } from '../../assets/Icons/StarFilled'; import { StarEmptyIcon } from '../../assets/Icons/StarEmpty'; @@ -11,7 +11,7 @@ import { useTranslation } from 'react-i18next'; export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { const [value, setValue] = useState(0); - const { show } = useContext(MyContext); + const { show } = useContext(QORTAL_APP_CONTEXT); const [hasPublishedRating, setHasPublishedRating] = useState( null ); diff --git a/src/components/Apps/AppsDesktop.tsx b/src/components/Apps/AppsDesktop.tsx index 216f5e7..0ef5366 100644 --- a/src/components/Apps/AppsDesktop.tsx +++ b/src/components/Apps/AppsDesktop.tsx @@ -1,7 +1,7 @@ import React, { useContext, useEffect, useMemo, useRef, useState } from 'react'; import { AppsHomeDesktop } from './AppsHomeDesktop'; import { Spacer } from '../../common/Spacer'; -import { MyContext, getBaseApiReact } from '../../App'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; import { AppInfo } from './AppInfo'; import { executeEvent, @@ -48,7 +48,7 @@ export const AppsDesktop = ({ const [categories, setCategories] = useState([]); const iframeRefs = useRef({}); const [isEnabledDevMode, setIsEnabledDevMode] = useAtom(enabledDevModeAtom); - const { showTutorial } = useContext(MyContext); + const { showTutorial } = useContext(QORTAL_APP_CONTEXT); const theme = useTheme(); const { t } = useTranslation(['auth', 'core', 'group']); diff --git a/src/components/Apps/AppsDevModeHome.tsx b/src/components/Apps/AppsDevModeHome.tsx index 74bce21..d21618b 100644 --- a/src/components/Apps/AppsDevModeHome.tsx +++ b/src/components/Apps/AppsDevModeHome.tsx @@ -19,7 +19,7 @@ import { Input, } from '@mui/material'; import { Add } from '@mui/icons-material'; -import { MyContext, getBaseApiReact } from '../../App'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; import { executeEvent } from '../../utils/events'; import { Spacer } from '../../common/Spacer'; import { useModal } from '../../common/useModal'; @@ -48,7 +48,7 @@ export const AppsDevModeHome = ({ setOpenSnackGlobal, infoSnackCustom, setInfoSnackCustom, - } = useContext(MyContext); + } = useContext(QORTAL_APP_CONTEXT); const handleSelectFile = async (existingFilePath) => { const filePath = existingFilePath || (await window.electron.selectFile()); diff --git a/src/components/Apps/AppsPrivate.tsx b/src/components/Apps/AppsPrivate.tsx index 604a8f5..64d5045 100644 --- a/src/components/Apps/AppsPrivate.tsx +++ b/src/components/Apps/AppsPrivate.tsx @@ -31,7 +31,7 @@ import { } from './Apps-styles'; import AddIcon from '@mui/icons-material/Add'; import ImageUploader from '../../common/ImageUploader'; -import { MyContext } from '../../App'; +import { QORTAL_APP_CONTEXT } from '../../App'; import { fileToBase64 } from '../../utils/fileReading'; import { objectToBase64 } from '../../qdn/encryption/group-encryption'; import { getFee } from '../../background'; @@ -59,7 +59,7 @@ export const AppsPrivate = ({ myName }) => { const [isOpenPrivateModal, setIsOpenPrivateModal] = useState(false); const { show, setInfoSnackCustom, setOpenSnackGlobal } = - useContext(MyContext); + useContext(QORTAL_APP_CONTEXT); const [memberGroups] = useAtom(memberGroupsAtom); const theme = useTheme(); diff --git a/src/components/Chat/AdminSpaceInner.tsx b/src/components/Chat/AdminSpaceInner.tsx index 0312e5d..0a68048 100644 --- a/src/components/Chat/AdminSpaceInner.tsx +++ b/src/components/Chat/AdminSpaceInner.tsx @@ -1,6 +1,6 @@ import { useCallback, useContext, useEffect, useState } from 'react'; import { - MyContext, + QORTAL_APP_CONTEXT, getArbitraryEndpointReact, getBaseApiReact, } from '../../App'; @@ -73,7 +73,7 @@ export const AdminSpaceInner = ({ useState(null); const [isLoadingPublishKey, setIsLoadingPublishKey] = useState(false); const { show, setInfoSnackCustom, setOpenSnackGlobal } = - useContext(MyContext); + useContext(QORTAL_APP_CONTEXT); const { t } = useTranslation(['auth', 'core', 'group']); const getAdminGroupSecretKey = useCallback(async () => { diff --git a/src/components/Chat/ChatGroup.tsx b/src/components/Chat/ChatGroup.tsx index 1e65eb7..fcd6bbd 100644 --- a/src/components/Chat/ChatGroup.tsx +++ b/src/components/Chat/ChatGroup.tsx @@ -19,7 +19,7 @@ import { LoadingSnackbar } from '../Snackbar/LoadingSnackbar'; import { getBaseApiReact, getBaseApiReactSocket, - MyContext, + QORTAL_APP_CONTEXT, pauseAllQueues, resumeAllQueues, } from '../../App'; @@ -71,7 +71,7 @@ export const ChatGroup = ({ hideView, isPrivate, }) => { - const { isUserBlocked, show } = useContext(MyContext); + const { isUserBlocked, show } = useContext(QORTAL_APP_CONTEXT); const [messages, setMessages] = useState([]); const [chatReferences, setChatReferences] = useState({}); const [isSending, setIsSending] = useState(false); diff --git a/src/components/Chat/CreateCommonSecret.tsx b/src/components/Chat/CreateCommonSecret.tsx index bb5834e..e7472f6 100644 --- a/src/components/Chat/CreateCommonSecret.tsx +++ b/src/components/Chat/CreateCommonSecret.tsx @@ -3,7 +3,7 @@ import { Box, Button, Typography, useTheme } from '@mui/material'; import { CustomizedSnackbars } from '../Snackbar/Snackbar'; import { LoadingButton } from '@mui/lab'; import { - MyContext, + QORTAL_APP_CONTEXT, getArbitraryEndpointReact, getBaseApiReact, pauseAllQueues, @@ -32,7 +32,7 @@ export const CreateCommonSecret = ({ setIsForceShowCreationKeyPopup, isForceShowCreationKeyPopup, }) => { - const { show } = useContext(MyContext); + const { show } = useContext(QORTAL_APP_CONTEXT); const setTxList = useSetAtom(txListAtom); const [openSnack, setOpenSnack] = useState(false); diff --git a/src/components/Chat/GroupAnnouncements.tsx b/src/components/Chat/GroupAnnouncements.tsx index 0ece390..a9d1e0a 100644 --- a/src/components/Chat/GroupAnnouncements.tsx +++ b/src/components/Chat/GroupAnnouncements.tsx @@ -24,7 +24,7 @@ import { AnnouncementList } from './AnnouncementList'; import CampaignIcon from '@mui/icons-material/Campaign'; import { AnnouncementDiscussion } from './AnnouncementDiscussion'; import { - MyContext, + QORTAL_APP_CONTEXT, getArbitraryEndpointReact, getBaseApiReact, pauseAllQueues, @@ -142,7 +142,7 @@ export const GroupAnnouncements = ({ const [selectedAnnouncement, setSelectedAnnouncement] = useState(null); const [isFocusedParent, setIsFocusedParent] = useState(false); - const { show } = useContext(MyContext); + const { show } = useContext(QORTAL_APP_CONTEXT); const [openSnack, setOpenSnack] = useState(false); const [infoSnack, setInfoSnack] = useState(null); const hasInitialized = useRef(false); diff --git a/src/components/Chat/GroupAvatar.tsx b/src/components/Chat/GroupAvatar.tsx index 13a0745..5c28899 100644 --- a/src/components/Chat/GroupAvatar.tsx +++ b/src/components/Chat/GroupAvatar.tsx @@ -1,7 +1,7 @@ import { useCallback, useContext, useEffect, useState } from 'react'; import Logo2 from '../../assets/svgs/Logo2.svg'; import { - MyContext, + QORTAL_APP_CONTEXT, getArbitraryEndpointReact, getBaseApiReact, } from '../../App'; @@ -32,7 +32,7 @@ export const GroupAvatar = ({ const [hasAvatar, setHasAvatar] = useState(false); const [avatarFile, setAvatarFile] = useState(null); const [tempAvatar, setTempAvatar] = useState(null); - const { show } = useContext(MyContext); + const { show } = useContext(QORTAL_APP_CONTEXT); const { t } = useTranslation(['auth', 'core', 'group']); const [anchorEl, setAnchorEl] = useState(null); const [isLoading, setIsLoading] = useState(false); diff --git a/src/components/Chat/MessageItem.tsx b/src/components/Chat/MessageItem.tsx index a2e7fd5..a429846 100644 --- a/src/components/Chat/MessageItem.tsx +++ b/src/components/Chat/MessageItem.tsx @@ -22,7 +22,7 @@ import { useTheme, } from '@mui/material'; import { formatTimestamp } from '../../utils/time'; -import { MyContext, getBaseApiReact } from '../../App'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; import { generateHTML } from '@tiptap/react'; import Highlight from '@tiptap/extension-highlight'; import Mention from '@tiptap/extension-mention'; @@ -113,7 +113,7 @@ export const MessageItem = memo( onEdit, isPrivate, }) => { - const { getIndividualUserInfo } = useContext(MyContext); + const { getIndividualUserInfo } = useContext(QORTAL_APP_CONTEXT); const [anchorEl, setAnchorEl] = useState(null); const [selectedReaction, setSelectedReaction] = useState(null); const [userInfo, setUserInfo] = useState(null); diff --git a/src/components/Embeds/AttachmentEmbed.tsx b/src/components/Embeds/AttachmentEmbed.tsx index 5a30d2d..d7458a7 100644 --- a/src/components/Embeds/AttachmentEmbed.tsx +++ b/src/components/Embeds/AttachmentEmbed.tsx @@ -1,5 +1,5 @@ import { useContext, useState } from 'react'; -import { MyContext, getBaseApiReact } from '../../App'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; import { Card, CardContent, @@ -36,7 +36,7 @@ export const AttachmentCard = ({ selectedGroupId, }) => { const [isOpen, setIsOpen] = useState(true); - const { downloadResource } = useContext(MyContext); + const { downloadResource } = useContext(QORTAL_APP_CONTEXT); const theme = useTheme(); const { t } = useTranslation(['auth', 'core', 'group']); diff --git a/src/components/Embeds/PollEmbed.tsx b/src/components/Embeds/PollEmbed.tsx index cffe724..bc246ba 100644 --- a/src/components/Embeds/PollEmbed.tsx +++ b/src/components/Embeds/PollEmbed.tsx @@ -1,5 +1,5 @@ import { useContext, useEffect, useState } from 'react'; -import { MyContext } from '../../App'; +import { QORTAL_APP_CONTEXT } from '../../App'; import { Card, CardContent, @@ -37,7 +37,7 @@ export const PollCard = ({ const [ownerName, setOwnerName] = useState(''); const [showResults, setShowResults] = useState(false); const [isOpen, setIsOpen] = useState(false); - const { show, userInfo } = useContext(MyContext); + const { show, userInfo } = useContext(QORTAL_APP_CONTEXT); const [isLoadingSubmit, setIsLoadingSubmit] = useState(false); const theme = useTheme(); const { t } = useTranslation(['auth', 'core', 'group']); diff --git a/src/components/Embeds/VideoPlayer.tsx b/src/components/Embeds/VideoPlayer.tsx index 958b2ad..ab9d3a6 100644 --- a/src/components/Embeds/VideoPlayer.tsx +++ b/src/components/Embeds/VideoPlayer.tsx @@ -21,7 +21,7 @@ import { } from '@mui/icons-material'; import { styled } from '@mui/system'; import { Refresh } from '@mui/icons-material'; -import { MyContext, getBaseApiReact } from '../../App'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; import { resourceKeySelector } from '../../atoms/global'; import { useAtomValue } from 'jotai'; @@ -88,7 +88,7 @@ export const VideoPlayer: FC = ({ }, [service, name, identifier]); const download = useAtomValue(resourceKeySelector(keyIdentifier)); - const { downloadResource } = useContext(MyContext); + const { downloadResource } = useContext(QORTAL_APP_CONTEXT); const videoRef = useRef(null); const [playing, setPlaying] = useState(false); const [volume, setVolume] = useState(1); diff --git a/src/components/GlobalActions/JoinGroup.tsx b/src/components/GlobalActions/JoinGroup.tsx index de3fd22..48ea442 100644 --- a/src/components/GlobalActions/JoinGroup.tsx +++ b/src/components/GlobalActions/JoinGroup.tsx @@ -11,7 +11,7 @@ import { useTheme, } from '@mui/material'; import { CustomButtonAccept } from '../../styles/App-styles'; -import { getBaseApiReact, MyContext } from '../../App'; +import { getBaseApiReact, QORTAL_APP_CONTEXT } from '../../App'; import { getFee } from '../../background'; import { CustomizedSnackbars } from '../Snackbar/Snackbar'; import { FidgetSpinner } from 'react-loader-spinner'; @@ -20,7 +20,7 @@ import { memberGroupsAtom, txListAtom } from '../../atoms/global'; import { useTranslation } from 'react-i18next'; export const JoinGroup = () => { - const { show } = useContext(MyContext); + const { show } = useContext(QORTAL_APP_CONTEXT); const setTxList = useSetAtom(txListAtom); const [memberGroups] = useAtom(memberGroupsAtom); const [openSnack, setOpenSnack] = useState(false); diff --git a/src/components/Group/AddGroup.tsx b/src/components/Group/AddGroup.tsx index 1916aaa..2e0ca92 100644 --- a/src/components/Group/AddGroup.tsx +++ b/src/components/Group/AddGroup.tsx @@ -35,7 +35,7 @@ import { AddGroupList } from './AddGroupList'; import { UserListOfInvites } from './UserListOfInvites'; import { CustomizedSnackbars } from '../Snackbar/Snackbar'; import { getFee } from '../../background'; -import { MyContext } from '../../App'; +import { QORTAL_APP_CONTEXT } from '../../App'; import { subscribeToEvent, unsubscribeFromEvent } from '../../utils/events'; import { useTranslation } from 'react-i18next'; import { useSetAtom } from 'jotai'; @@ -59,7 +59,7 @@ const Transition = forwardRef(function Transition( }); export const AddGroup = ({ address, open, setOpen }) => { - const { show } = useContext(MyContext); + const { show } = useContext(QORTAL_APP_CONTEXT); const setTxList = useSetAtom(txListAtom); const [openAdvance, setOpenAdvance] = useState(false); diff --git a/src/components/Group/AddGroupList.tsx b/src/components/Group/AddGroupList.tsx index eaa7f4d..e9316d8 100644 --- a/src/components/Group/AddGroupList.tsx +++ b/src/components/Group/AddGroupList.tsx @@ -23,7 +23,7 @@ import { List, } from 'react-virtualized'; import _ from 'lodash'; -import { MyContext, getBaseApiReact } from '../../App'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; import { LoadingButton } from '@mui/lab'; import { getFee } from '../../background'; import LockIcon from '@mui/icons-material/Lock'; @@ -39,7 +39,7 @@ const cache = new CellMeasurerCache({ }); export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { - const { show } = useContext(MyContext); + const { show } = useContext(QORTAL_APP_CONTEXT); const [memberGroups] = useAtom(memberGroupsAtom); const setTxList = useSetAtom(txListAtom); const { t } = useTranslation(['auth', 'core', 'group']); diff --git a/src/components/Group/BlockedUsersModal.tsx b/src/components/Group/BlockedUsersModal.tsx index 99c9191..c8145b3 100644 --- a/src/components/Group/BlockedUsersModal.tsx +++ b/src/components/Group/BlockedUsersModal.tsx @@ -11,7 +11,7 @@ import { useTheme, } from '@mui/material'; import { useContext, useEffect, useState } from 'react'; -import { getBaseApiReact, MyContext } from '../../App'; +import { getBaseApiReact, QORTAL_APP_CONTEXT } from '../../App'; import { Spacer } from '../../common/Spacer'; import { executeEvent, @@ -42,7 +42,7 @@ export const BlockedUsersModal = () => { addToBlockList, setOpenSnackGlobal, setInfoSnackCustom, - } = useContext(MyContext); + } = useContext(QORTAL_APP_CONTEXT); const [blockedUsers, setBlockedUsers] = useState({ addresses: {}, diff --git a/src/components/Group/Forum/NewThread.tsx b/src/components/Group/Forum/NewThread.tsx index 763ecb6..b9d8048 100644 --- a/src/components/Group/Forum/NewThread.tsx +++ b/src/components/Group/Forum/NewThread.tsx @@ -17,7 +17,11 @@ import { ReusableModal } from './ReusableModal'; import { Spacer } from '../../../common/Spacer'; import { CreateThreadIcon } from '../../../assets/Icons/CreateThreadIcon'; import { SendNewMessage } from '../../../assets/Icons/SendNewMessage'; -import { MyContext, pauseAllQueues, resumeAllQueues } from '../../../App'; +import { + QORTAL_APP_CONTEXT, + pauseAllQueues, + resumeAllQueues, +} from '../../../App'; import { getFee } from '../../../background'; import TipTap from '../../Chat/TipTap'; import { MessageDisplay } from '../../Chat/MessageDisplay'; @@ -141,7 +145,7 @@ export const NewThread = ({ isPrivate, }: NewMessageProps) => { const { t } = useTranslation(['auth', 'core', 'group']); - const { show } = useContext(MyContext); + const { show } = useContext(QORTAL_APP_CONTEXT); const [isOpen, setIsOpen] = useState(false); const [value, setValue] = useState(''); const [isSending, setIsSending] = useState(false); diff --git a/src/components/Group/ListOfGroupPromotions.tsx b/src/components/Group/ListOfGroupPromotions.tsx index bf6ba8b..8c772cd 100644 --- a/src/components/Group/ListOfGroupPromotions.tsx +++ b/src/components/Group/ListOfGroupPromotions.tsx @@ -21,7 +21,7 @@ import { LoadingButton } from '@mui/lab'; import LockIcon from '@mui/icons-material/Lock'; import NoEncryptionGmailerrorredIcon from '@mui/icons-material/NoEncryptionGmailerrorred'; import { - MyContext, + QORTAL_APP_CONTEXT, getArbitraryEndpointReact, getBaseApiReact, } from '../../App'; @@ -88,7 +88,7 @@ export const ListOfGroupPromotions = () => { const [fee, setFee] = useState(null); const [isLoadingJoinGroup, setIsLoadingJoinGroup] = useState(false); const [isLoadingPublish, setIsLoadingPublish] = useState(false); - const { show } = useContext(MyContext); + const { show } = useContext(QORTAL_APP_CONTEXT); const setTxList = useSetAtom(txListAtom); const theme = useTheme(); const { t } = useTranslation(['auth', 'core', 'group']); diff --git a/src/components/Group/ManageMembers.tsx b/src/components/Group/ManageMembers.tsx index e64eeab..9fd3150 100644 --- a/src/components/Group/ManageMembers.tsx +++ b/src/components/Group/ManageMembers.tsx @@ -25,7 +25,7 @@ import { ListOfBans } from './ListOfBans'; import { ListOfJoinRequests } from './ListOfJoinRequests'; import { Box, ButtonBase, Card, Tab, Tabs, useTheme } from '@mui/material'; import { CustomizedSnackbars } from '../Snackbar/Snackbar'; -import { MyContext, getBaseApiReact } from '../../App'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; import { getGroupMembers, getNames } from './Group'; import { LoadingSnackbar } from '../Snackbar/LoadingSnackbar'; import { getFee } from '../../background'; @@ -72,7 +72,7 @@ export const ManageMembers = ({ }; const theme = useTheme(); const { t } = useTranslation(['auth', 'core', 'group']); - const { show } = useContext(MyContext); + const { show } = useContext(QORTAL_APP_CONTEXT); const setTxList = useSetAtom(txListAtom); const handleClose = () => { diff --git a/src/components/Group/Settings.tsx b/src/components/Group/Settings.tsx index c285fa0..058adde 100644 --- a/src/components/Group/Settings.tsx +++ b/src/components/Group/Settings.tsx @@ -38,7 +38,7 @@ import { Spacer } from '../../common/Spacer'; import PhraseWallet from '../../utils/generateWallet/phrase-wallet'; import { walletVersion } from '../../background'; import Base58 from '../../deps/Base58'; -import { MyContext } from '../../App'; +import { QORTAL_APP_CONTEXT } from '../../App'; import { useTranslation } from 'react-i18next'; const LocalNodeSwitch = styled(Switch)(({ theme }) => ({ @@ -233,7 +233,8 @@ const ExportPrivateKey = ({ rawWallet }) => { const [password, setPassword] = useState(''); const [privateKey, setPrivateKey] = useState(''); const [isOpen, setIsOpen] = useState(false); - const { setOpenSnackGlobal, setInfoSnackCustom } = useContext(MyContext); + const { setOpenSnackGlobal, setInfoSnackCustom } = + useContext(QORTAL_APP_CONTEXT); const { t } = useTranslation(['auth', 'core', 'group']); const exportPrivateKeyFunc = async () => { diff --git a/src/components/Group/UserListOfInvites.tsx b/src/components/Group/UserListOfInvites.tsx index 3b32f54..064296a 100644 --- a/src/components/Group/UserListOfInvites.tsx +++ b/src/components/Group/UserListOfInvites.tsx @@ -14,7 +14,7 @@ import { CellMeasurerCache, List, } from 'react-virtualized'; -import { MyContext, getBaseApiReact } from '../../App'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; import { LoadingButton } from '@mui/lab'; import { getFee } from '../../background'; import LockIcon from '@mui/icons-material/Lock'; @@ -55,7 +55,7 @@ export const UserListOfInvites = ({ setInfoSnack, setOpenSnack, }) => { - const { show } = useContext(MyContext); + const { show } = useContext(QORTAL_APP_CONTEXT); const setTxList = useSetAtom(txListAtom); const [invites, setInvites] = useState([]); diff --git a/src/components/MainAvatar.tsx b/src/components/MainAvatar.tsx index 2c40dc5..26ce2e1 100644 --- a/src/components/MainAvatar.tsx +++ b/src/components/MainAvatar.tsx @@ -1,6 +1,10 @@ import { useContext, useEffect, useState } from 'react'; import Logo2 from '../assets/svgs/Logo2.svg'; -import { MyContext, getArbitraryEndpointReact, getBaseApiReact } from '../App'; +import { + QORTAL_APP_CONTEXT, + getArbitraryEndpointReact, + getBaseApiReact, +} from '../App'; import { Avatar, Box, @@ -22,7 +26,7 @@ export const MainAvatar = ({ myName, balance, setOpenSnack, setInfoSnack }) => { const [hasAvatar, setHasAvatar] = useState(false); const [avatarFile, setAvatarFile] = useState(null); const [tempAvatar, setTempAvatar] = useState(null); - const { show } = useContext(MyContext); + const { show } = useContext(QORTAL_APP_CONTEXT); const [anchorEl, setAnchorEl] = useState(null); const [isLoading, setIsLoading] = useState(false); diff --git a/src/components/NotAuthenticated.tsx b/src/components/NotAuthenticated.tsx index a87fdce..c9be445 100644 --- a/src/components/NotAuthenticated.tsx +++ b/src/components/NotAuthenticated.tsx @@ -32,7 +32,7 @@ import Tooltip, { TooltipProps, tooltipClasses } from '@mui/material/Tooltip'; import ThemeSelector from './Theme/ThemeSelector'; import { useTranslation } from 'react-i18next'; import LanguageSelector from './Language/LanguageSelector'; -import { MyContext } from '../App'; +import { QORTAL_APP_CONTEXT } from '../App'; export const manifestData = { version: '0.5.4', @@ -81,7 +81,8 @@ export const NotAuthenticated = ({ const [showSelectApiKey, setShowSelectApiKey] = useState(false); const [enteredApiKey, setEnteredApiKey] = useState(''); const [customNodeToSaveIndex, setCustomNodeToSaveIndex] = useState(null); - const { showTutorial, hasSeenGettingStarted } = useContext(MyContext); + const { showTutorial, hasSeenGettingStarted } = + useContext(QORTAL_APP_CONTEXT); const theme = useTheme(); const { t } = useTranslation(['auth', 'core']); diff --git a/src/components/Save/Save.tsx b/src/components/Save/Save.tsx index c89b625..dd9c148 100644 --- a/src/components/Save/Save.tsx +++ b/src/components/Save/Save.tsx @@ -18,7 +18,7 @@ import { useTheme, } from '@mui/material'; import { objectToBase64 } from '../../qdn/encryption/group-encryption'; -import { MyContext } from '../../App'; +import { QORTAL_APP_CONTEXT } from '../../App'; import { getFee } from '../../background'; import { CustomizedSnackbars } from '../Snackbar/Snackbar'; import { SaveIcon } from '../../assets/Icons/SaveIcon'; @@ -82,7 +82,7 @@ export const Save = ({ isDesktop, disableWidth, myName }) => { const [oldPinnedApps, setOldPinnedApps] = useAtom(oldPinnedAppsAtom); const [anchorEl, setAnchorEl] = useState(null); - const { show } = useContext(MyContext); + const { show } = useContext(QORTAL_APP_CONTEXT); const theme = useTheme(); const { t } = useTranslation(['auth', 'core', 'group']); diff --git a/src/components/Tutorials/Tutorials.tsx b/src/components/Tutorials/Tutorials.tsx index d480b1c..068c3ad 100644 --- a/src/components/Tutorials/Tutorials.tsx +++ b/src/components/Tutorials/Tutorials.tsx @@ -1,5 +1,5 @@ import { useContext, useState } from 'react'; -import { MyContext } from '../../App'; +import { QORTAL_APP_CONTEXT } from '../../App'; import { Button, Dialog, @@ -16,7 +16,8 @@ import { VideoPlayer } from '../Embeds/VideoPlayer'; import { useTranslation } from 'react-i18next'; export const Tutorials = () => { - const { openTutorialModal, setOpenTutorialModal } = useContext(MyContext); + const { openTutorialModal, setOpenTutorialModal } = + useContext(QORTAL_APP_CONTEXT); const [multiNumber, setMultiNumber] = useState(0); const theme = useTheme(); const { t } = useTranslation(['core', 'tutorial']); diff --git a/src/components/WrapperUserAction.tsx b/src/components/WrapperUserAction.tsx index 591c200..490333d 100644 --- a/src/components/WrapperUserAction.tsx +++ b/src/components/WrapperUserAction.tsx @@ -7,7 +7,7 @@ import { useTheme, } from '@mui/material'; import { executeEvent } from '../utils/events'; -import { MyContext } from '../App'; +import { QORTAL_APP_CONTEXT } from '../App'; import { useAtom } from 'jotai'; import { isRunningPublicNodeAtom } from '../atoms/global'; import { useTranslation } from 'react-i18next'; @@ -175,7 +175,7 @@ const BlockUser = ({ address, name, handleClose }) => { const [isAlreadyBlocked, setIsAlreadyBlocked] = useState(null); const [isLoading, setIsLoading] = useState(false); const { isUserBlocked, addToBlockList, removeBlockFromList } = - useContext(MyContext); + useContext(QORTAL_APP_CONTEXT); const theme = useTheme(); const { t } = useTranslation(['auth', 'core', 'group']); diff --git a/src/hooks/useHandlePrivateApps.tsx b/src/hooks/useHandlePrivateApps.tsx index fdeee79..e1d8288 100644 --- a/src/hooks/useHandlePrivateApps.tsx +++ b/src/hooks/useHandlePrivateApps.tsx @@ -1,6 +1,6 @@ import { useContext, useState } from 'react'; import { executeEvent } from '../utils/events'; -import { getBaseApiReact, MyContext } from '../App'; +import { getBaseApiReact, QORTAL_APP_CONTEXT } from '../App'; import { createEndpoint } from '../background'; import { settingsLocalLastUpdatedAtom, @@ -19,7 +19,7 @@ export const useHandlePrivateApps = () => { setOpenSnackGlobal, infoSnackCustom, setInfoSnackCustom, - } = useContext(MyContext); + } = useContext(QORTAL_APP_CONTEXT); const setSortablePinnedApps = useSetAtom(sortablePinnedAppsAtom); const setSettingsLocalLastUpdated = useSetAtom(settingsLocalLastUpdatedAtom); const { t } = useTranslation(['auth', 'core', 'group']); diff --git a/src/hooks/useQortalMessageListener.tsx b/src/hooks/useQortalMessageListener.tsx index 1a8670b..acda0ca 100644 --- a/src/hooks/useQortalMessageListener.tsx +++ b/src/hooks/useQortalMessageListener.tsx @@ -4,7 +4,7 @@ import { navigationControllerAtom } from '../atoms/global'; import { Filesystem, Directory } from '@capacitor/filesystem'; import { saveFile } from '../qortalRequests/get'; import { mimeToExtensionMap } from '../utils/memeTypes'; -import { MyContext } from '../App'; +import { QORTAL_APP_CONTEXT } from '../App'; import FileSaver from 'file-saver'; import { useSetAtom } from 'jotai'; @@ -526,7 +526,7 @@ export const useQortalMessageListener = ( setOpenSnackGlobal, infoSnackCustom, setInfoSnackCustom, - } = useContext(MyContext); + } = useContext(QORTAL_APP_CONTEXT); useEffect(() => { if (tabId && !isNaN(history?.currentIndex)) {