diff --git a/src/assets/Icons/CopyIcon.tsx b/src/assets/Icons/CopyIcon.tsx index 67ede2d..6029cd8 100644 --- a/src/assets/Icons/CopyIcon.tsx +++ b/src/assets/Icons/CopyIcon.tsx @@ -1,10 +1,9 @@ import { useTheme } from '@mui/material'; -import React from 'react'; export const CopyIcon = ({ color, height = 11, width = 10 }) => { const theme = useTheme(); - const setColor = color ? color : theme.palette.text.primary; + return ( { xmlns="http://www.w3.org/2000/svg" > ); diff --git a/src/common/CustomLoader.tsx b/src/common/CustomLoader.tsx index d1ae3b2..84dbfac 100644 --- a/src/common/CustomLoader.tsx +++ b/src/common/CustomLoader.tsx @@ -1,6 +1,6 @@ -import React from 'react'; import './customloader.css'; import { Box, useTheme } from '@mui/material'; + export const CustomLoader = () => { const theme = useTheme(); return ( diff --git a/src/common/CustomSvg.tsx b/src/common/CustomSvg.tsx index c1d8f09..fc805a9 100644 --- a/src/common/CustomSvg.tsx +++ b/src/common/CustomSvg.tsx @@ -1,17 +1,14 @@ -import React from 'react'; - export const CustomSvg = ({ src, color = 'black', size = 24 }) => { - return ( - - {src} - - ); - }; - \ No newline at end of file + return ( + + {src} + + ); +}; diff --git a/src/common/customloader.css b/src/common/customloader.css index dd00558..c16d21d 100644 --- a/src/common/customloader.css +++ b/src/common/customloader.css @@ -36,6 +36,7 @@ left: 56px; animation: lds-ellipsis3 0.6s infinite; } + @keyframes lds-ellipsis1 { 0% { transform: scale(0); diff --git a/src/common/useFetchResources.tsx b/src/common/useFetchResources.tsx index 242f418..8e388a7 100644 --- a/src/common/useFetchResources.tsx +++ b/src/common/useFetchResources.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useRef } from 'react'; +import { useCallback } from 'react'; import { resourceDownloadControllerAtom } from '../atoms/global'; import { getBaseApiReact } from '../App'; import { useSetAtom } from 'jotai'; diff --git a/src/components/Apps/AppsCategoryDesktop.tsx b/src/components/Apps/AppsCategoryDesktop.tsx index 754ba85..39f12ee 100644 --- a/src/components/Apps/AppsCategoryDesktop.tsx +++ b/src/components/Apps/AppsCategoryDesktop.tsx @@ -56,7 +56,7 @@ export const AppsCategoryDesktop = ({ isShow, }) => { const [searchValue, setSearchValue] = useState(''); - const virtuosoRef = useRef(); + const virtuosoRef = useRef(null); const theme = useTheme(); const categoryList = useMemo(() => { diff --git a/src/components/Apps/AppsLibraryDesktop.tsx b/src/components/Apps/AppsLibraryDesktop.tsx index 3490e89..17b9b71 100644 --- a/src/components/Apps/AppsLibraryDesktop.tsx +++ b/src/components/Apps/AppsLibraryDesktop.tsx @@ -102,7 +102,7 @@ export const AppsLibraryDesktop = ({ getQapps, }) => { const [searchValue, setSearchValue] = useState(''); - const virtuosoRef = useRef(); + const virtuosoRef = useRef(null); const theme = useTheme(); const officialApps = useMemo(() => { diff --git a/src/components/Auth/DownloadWallet.tsx b/src/components/Auth/DownloadWallet.tsx index 838ea2c..cbf5e49 100644 --- a/src/components/Auth/DownloadWallet.tsx +++ b/src/components/Auth/DownloadWallet.tsx @@ -63,6 +63,7 @@ export const DownloadWallet = ({ wallet, qortAddress: rawWallet.address0, }); + return { wallet, qortAddress: rawWallet.address0, diff --git a/src/components/Chat/AnnouncementList.tsx b/src/components/Chat/AnnouncementList.tsx index 9c32cc1..5f3c75b 100644 --- a/src/components/Chat/AnnouncementList.tsx +++ b/src/components/Chat/AnnouncementList.tsx @@ -18,7 +18,7 @@ export const AnnouncementList = ({ loadMore, myName, }) => { - const listRef = useRef(); + const listRef = useRef(null); const [messages, setMessages] = useState(initialMessages); useEffect(() => { diff --git a/src/components/Chat/ChatList.tsx b/src/components/Chat/ChatList.tsx index 56acbc7..8362fad 100644 --- a/src/components/Chat/ChatList.tsx +++ b/src/components/Chat/ChatList.tsx @@ -23,7 +23,7 @@ export const ChatList = ({ hasSecretKey, isPrivate, }) => { - const parentRef = useRef(); + const parentRef = useRef(null); const [messages, setMessages] = useState(initialMessages); const [showScrollButton, setShowScrollButton] = useState(false); const [showScrollDownButton, setShowScrollDownButton] = useState(false); diff --git a/src/components/Chat/ChatOptions.tsx b/src/components/Chat/ChatOptions.tsx index 4f92f53..0ec1866 100644 --- a/src/components/Chat/ChatOptions.tsx +++ b/src/components/Chat/ChatOptions.tsx @@ -60,8 +60,8 @@ export const ChatOptions = ({ const [searchValue, setSearchValue] = useState(''); const [selectedMember, setSelectedMember] = useState(0); const theme = useTheme(); - const parentRef = useRef(); - const parentRefMentions = useRef(); + const parentRef = useRef(null); + const parentRefMentions = useRef(null); const [lastMentionTimestamp, setLastMentionTimestamp] = useState(null); const [debouncedValue, setDebouncedValue] = useState(''); // Debounced value const messages = useMemo(() => { diff --git a/src/components/Chat/GroupAnnouncements.tsx b/src/components/Chat/GroupAnnouncements.tsx index 9ac3ded..c91bfaa 100644 --- a/src/components/Chat/GroupAnnouncements.tsx +++ b/src/components/Chat/GroupAnnouncements.tsx @@ -31,6 +31,7 @@ import { import { RequestQueueWithPromise } from '../../utils/queue/queue'; import { CustomizedSnackbars } from '../Snackbar/Snackbar'; import { addDataPublishesFunc, getDataPublishesFunc } from '../Group/Group'; +import { useTranslation } from 'react-i18next'; const uid = new ShortUniqueId({ length: 8 }); @@ -101,6 +102,7 @@ export const decryptPublishes = async (encryptedMessages: any[], secretKey) => { console.log(error); } }; + export const handleUnencryptedPublishes = (publishes) => { let publishesData = []; publishes.forEach((pub) => { @@ -149,6 +151,7 @@ export const GroupAnnouncements = ({ editorRef.current = editorInstance; }; const [, forceUpdate] = React.useReducer((x) => x + 1, 0); + const { t } = useTranslation(['core', 'group']); const triggerRerender = () => { forceUpdate(); // Trigger re-render by updating the state @@ -209,7 +212,6 @@ export const GroupAnnouncements = ({ ) return; setIsLoading(true); - // initWebsocketMessageGroup() hasInitializedWebsocket.current = true; }, [secretKey, isPrivate]); @@ -287,7 +289,10 @@ export const GroupAnnouncements = ({ const fee = await getFee('ARBITRARY'); await show({ - message: 'Would you like to perform a ARBITRARY transaction?', + message: t('group:question.perform_transaction', { + action: 'ARBITRARY', + postProcess: 'capitalize', + }), publishFee: fee.fee + ' QORT', }); @@ -329,7 +334,7 @@ export const GroupAnnouncements = ({ setTempData(selectedGroup); clearEditorContent(); } - // send chat message + // TODO send chat message } catch (error) { if (!error) return; setInfoSnack({ diff --git a/src/components/CoreSyncStatus.tsx b/src/components/CoreSyncStatus.tsx index 06d30de..79e22d2 100644 --- a/src/components/CoreSyncStatus.tsx +++ b/src/components/CoreSyncStatus.tsx @@ -114,7 +114,7 @@ export const CoreSyncStatus = () => {
{ }} >

{t('core:core.information', { postProcess: 'capitalize' })}

+

{t('core:core.version', { postProcess: 'capitalize' })}:{' '} {buildVersion}

+

{message}

+

{t('core:core.block_height', { postProcess: 'capitalize' })}:{' '} {height || ''}

+

{t('core:core.peers', { postProcess: 'capitalize' })}:{' '} {numberOfConnections || ''}

+

{t('auth:node.using_public', { postProcess: 'capitalize' })}:{' '} {isUsingGateway?.toString()}

+

- {t('core:ui.version')}:{' '} + {t('core:ui.version', { postProcess: 'capitalize' })}:{' '} {manifestData.version}

diff --git a/src/components/Desktop/DesktopFooter.tsx b/src/components/Desktop/DesktopFooter.tsx index d85c8a0..f3912ba 100644 --- a/src/components/Desktop/DesktopFooter.tsx +++ b/src/components/Desktop/DesktopFooter.tsx @@ -3,10 +3,8 @@ import Box from '@mui/material/Box'; import { HubsIcon } from '../../assets/Icons/HubsIcon'; import { MessagingIcon } from '../../assets/Icons/MessagingIcon'; import AppIcon from '../../assets/svgs/AppIcon.svg'; - import { HomeIcon } from '../../assets/Icons/HomeIcon'; import { Save } from '../Save/Save'; - import { enabledDevModeAtom } from '../../atoms/global'; import { useAtom } from 'jotai'; diff --git a/src/components/Desktop/DesktopHeader.tsx b/src/components/Desktop/DesktopHeader.tsx index 0b6cff8..af501a4 100644 --- a/src/components/Desktop/DesktopHeader.tsx +++ b/src/components/Desktop/DesktopHeader.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import { useState } from 'react'; import { ButtonBase, Typography, useTheme } from '@mui/material'; import Box from '@mui/material/Box'; import { NotificationIcon2 } from '../../assets/Icons/NotificationIcon2'; @@ -81,18 +81,18 @@ export const DesktopHeader = ({ setGroupSection, isPrivate, }) => { - const [value, setValue] = React.useState(0); + const [value, setValue] = useState(0); const theme = useTheme(); return ( + @@ -219,6 +220,7 @@ export const DesktopHeader = ({ /> + { setOpenManageMembers(true); @@ -226,17 +228,18 @@ export const DesktopHeader = ({ > + { setGroupSection('adminSpace'); diff --git a/src/components/Drawer/Drawer.tsx b/src/components/Drawer/Drawer.tsx index 65f1250..a6491a7 100644 --- a/src/components/Drawer/Drawer.tsx +++ b/src/components/Drawer/Drawer.tsx @@ -1,5 +1,6 @@ import Box from '@mui/material/Box'; import Drawer from '@mui/material/Drawer'; + export const DrawerComponent = ({ open, setOpen, children }) => { const toggleDrawer = (newOpen: boolean) => () => { setOpen(newOpen); diff --git a/src/components/Explore/Explore.tsx b/src/components/Explore/Explore.tsx index 266fdd5..3da3cf5 100644 --- a/src/components/Explore/Explore.tsx +++ b/src/components/Explore/Explore.tsx @@ -40,6 +40,7 @@ export const Explore = ({ setDesktopViewMode }) => { }} src={qTradeLogo} /> + { color: theme.palette.text.primary, }} /> + { color: theme.palette.text.primary, }} /> + { {t('tutorial:initial.general_chat', { postProcess: 'capitalize' })} + { color: theme.palette.text.primary, }} /> + { diff --git a/src/components/GlobalActions/JoinGroup.tsx b/src/components/GlobalActions/JoinGroup.tsx index 6503de4..a56d642 100644 --- a/src/components/GlobalActions/JoinGroup.tsx +++ b/src/components/GlobalActions/JoinGroup.tsx @@ -1,8 +1,7 @@ -import React, { useContext, useEffect, useMemo, useState } from 'react'; +import { useContext, useEffect, useMemo, useState } from 'react'; import { subscribeToEvent, unsubscribeFromEvent } from '../../utils/events'; import { Box, - Button, ButtonBase, CircularProgress, Dialog, @@ -11,13 +10,14 @@ import { Typography, useTheme, } from '@mui/material'; -import { CustomButton, CustomButtonAccept } from '../../styles/App-styles'; +import { CustomButtonAccept } from '../../styles/App-styles'; import { getBaseApiReact, MyContext } from '../../App'; import { getFee } from '../../background'; import { CustomizedSnackbars } from '../Snackbar/Snackbar'; import { FidgetSpinner } from 'react-loader-spinner'; import { useAtom, useSetAtom } from 'jotai'; import { memberGroupsAtom, txListAtom } from '../../atoms/global'; +import { useTranslation } from 'react-i18next'; export const JoinGroup = () => { const { show } = useContext(MyContext); @@ -29,7 +29,9 @@ export const JoinGroup = () => { const [isLoadingInfo, setIsLoadingInfo] = useState(false); const [isOpen, setIsOpen] = useState(false); const theme = useTheme(); + const { t } = useTranslation(['core', 'group']); const [isLoadingJoinGroup, setIsLoadingJoinGroup] = useState(false); + const handleJoinGroup = async (e) => { setGroupInfo(null); const groupId = e?.detail?.groupId; @@ -41,6 +43,7 @@ export const JoinGroup = () => { const groupData = await response.json(); setGroupInfo(groupData); } catch (error) { + console.log(error); } finally { setIsLoadingInfo(false); } @@ -60,15 +63,22 @@ export const JoinGroup = () => { (item) => +item?.groupId === +groupInfo?.groupId ); }, [memberGroups, groupInfo]); + const joinGroup = async (group, isOpen) => { try { const groupId = group.groupId; const fee = await getFee('JOIN_GROUP'); + await show({ - message: 'Would you like to perform an JOIN_GROUP transaction?', + message: t('group:question.perform_transaction', { + action: 'JOIN_GROUP', + postProcess: 'capitalize', + }), publishFee: fee.fee + ' QORT', }); + setIsLoadingJoinGroup(true); + await new Promise((res, rej) => { window .sendMessage('joinGroup', { @@ -78,8 +88,9 @@ export const JoinGroup = () => { if (!response?.error) { setInfoSnack({ type: 'success', - message: - 'Successfully requested to join group. It may take a couple of minutes for the changes to propagate', + message: t('group:message.success.group_join', { + postProcess: 'capitalize', + }), }); if (isOpen) { @@ -87,8 +98,14 @@ export const JoinGroup = () => { { ...response, type: 'joined-group', - label: `Joined Group ${group?.groupName}: awaiting confirmation`, - labelDone: `Joined Group ${group?.groupName}: success!`, + label: t('group:message.success.group_join_label', { + group_name: group?.groupName, + postProcess: 'capitalize', + }), + labelDone: t('group:message.success.group_join_label', { + group_name: group?.groupName, + postProcess: 'capitalize', + }), done: false, groupId, }, @@ -99,15 +116,20 @@ export const JoinGroup = () => { { ...response, type: 'joined-group-request', - label: `Requested to join Group ${group?.groupName}: awaiting confirmation`, - labelDone: `Requested to join Group ${group?.groupName}: success!`, + label: t('group:message.success.group_join_request', { + group_name: group?.groupName, + postProcess: 'capitalize', + }), + labelDone: t('group:message.success.group_join_outcome', { + group_name: group?.groupName, + postProcess: 'capitalize', + }), done: false, groupId, }, ...prev, ]); } - setOpenSnack(true); res(response); return; @@ -123,7 +145,9 @@ export const JoinGroup = () => { .catch((error) => { setInfoSnack({ type: 'error', - message: error.message || 'An error occurred', + message: + error.message || + t('core:message.error.generic', { postProcess: 'capitalize' }), }); setOpenSnack(true); rej(error); @@ -131,10 +155,12 @@ export const JoinGroup = () => { }); setIsLoadingJoinGroup(false); } catch (error) { + console.log(error); } finally { setIsLoadingJoinGroup(false); } }; + return ( <> { {!groupInfo && ( - {' '} {' '} + /> )} { fontWeight: 600, }} > - Group name: {` ${groupInfo?.groupName}`} + {t('group:group.name', { postProcess: 'capitalize' })}:{' '} + {` ${groupInfo?.groupName}`} + - Number of members: {` ${groupInfo?.memberCount}`} + {t('group:group.member_number', { postProcess: 'capitalize' })}:{' '} + {` ${groupInfo?.memberCount}`} + {groupInfo?.description && ( { fontWeight: 600, }} > - *You are already in this group! + {t('group:message.generic.already_in_group', { + postProcess: 'capitalize', + })} )} {!isInGroup && groupInfo?.isOpen === false && ( @@ -217,12 +248,14 @@ export const JoinGroup = () => { fontWeight: 600, }} > - *This is a closed/private group, so you will need to wait until - an admin accepts your request + {t('group:message.generic.closed_group', { + postProcess: 'capitalize', + })} )} + { @@ -242,7 +275,9 @@ export const JoinGroup = () => { opacity: isInGroup ? 0.1 : 1, }} > - Join + {t('core:action.join', { + postProcess: 'capitalize', + })} @@ -255,7 +290,9 @@ export const JoinGroup = () => { }} onClick={() => setIsOpen(false)} > - Close + {t('core:action.close', { + postProcess: 'capitalize', + })} @@ -269,14 +306,14 @@ export const JoinGroup = () => { {isLoadingJoinGroup && ( { const fee = await getFee('CREATE_GROUP'); await show({ - message: t('group:question.create_group', { + message: t('group:question.perform_transaction', { + action: 'CREATE_GROUP', postProcess: 'capitalize', }), publishFee: fee.fee + ' QORT', @@ -330,6 +331,7 @@ export const AddGroup = ({ address, open, setOpen }) => { postProcess: 'capitalize', })} + { onChange={(e) => setName(e.target.value)} /> + { 100% + { postProcess: 'capitalize', })} + + { postProcess: 'capitalize', })} + + { const [groups, setGroups] = useState([]); const [popoverAnchor, setPopoverAnchor] = useState(null); // Track which list item the popover is anchored to const [openPopoverIndex, setOpenPopoverIndex] = useState(null); // Track which list item has the popover open - const listRef = useRef(); + const listRef = useRef(null); const [inputValue, setInputValue] = useState(''); const [filteredItems, setFilteredItems] = useState(groups); const [isLoading, setIsLoading] = useState(false); @@ -113,7 +113,8 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { const fee = await getFee('JOIN_GROUP'); await show({ - message: t('group:question.join_group', { + message: t('group:question.perform_transaction', { + action: 'JOIN_GROUP', postProcess: 'capitalize', }), publishFee: fee.fee + ' QORT', @@ -157,8 +158,14 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { { ...response, type: 'joined-group-request', - label: `Requested to join Group ${group?.groupName}: awaiting confirmation`, - labelDone: `Requested to join Group ${group?.groupName}: success!`, + label: t('group:message.success.group_join_request', { + group_name: group?.groupName, + postProcess: 'capitalize', + }), + labelDone: t('group:message.success.group_join_outcome', { + group_name: group?.groupName, + postProcess: 'capitalize', + }), done: false, groupId, }, diff --git a/src/components/Group/Forum/GroupMail.tsx b/src/components/Group/Forum/GroupMail.tsx index 60bfd12..41f75ef 100644 --- a/src/components/Group/Forum/GroupMail.tsx +++ b/src/components/Group/Forum/GroupMail.tsx @@ -1,26 +1,17 @@ -import React, { - useCallback, - useEffect, - useMemo, - useRef, - useState, -} from 'react'; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { Avatar, Box, Popover, Typography, useTheme } from '@mui/material'; -// import { MAIL_SERVICE_TYPE, THREAD_SERVICE_TYPE } from "../../constants/mail"; import { Thread } from './Thread'; import { AllThreadP, ArrowDownIcon, ComposeContainer, ComposeContainerBlank, - ComposeIcon, ComposeP, GroupContainer, InstanceFooter, InstanceListContainer, InstanceListContainerRow, InstanceListContainerRowCheck, - InstanceListContainerRowCheckIcon, InstanceListContainerRowMain, InstanceListContainerRowMainP, InstanceListHeader, @@ -48,7 +39,6 @@ import { getTempPublish, handleUnencryptedPublishes, } from '../../Chat/GroupAnnouncements'; -import CheckSVG from '../../../assets/svgs/Check.svg'; import ArrowDownSVG from '../../../assets/svgs/ArrowDown.svg'; import { LoadingSnackbar } from '../../Snackbar/LoadingSnackbar'; import { executeEvent } from '../../../utils/events'; @@ -73,9 +63,9 @@ export const GroupMail = ({ hide, isPrivate, }) => { - const [viewedThreads, setViewedThreads] = React.useState({}); + const [viewedThreads, setViewedThreads] = useState({}); const [filterMode, setFilterMode] = useState('Recently active'); - const [currentThread, setCurrentThread] = React.useState(null); + const [currentThread, setCurrentThread] = useState(null); const [recentThreads, setRecentThreads] = useState([]); const [allThreads, setAllThreads] = useState([]); const [members, setMembers] = useState(null); @@ -178,7 +168,10 @@ export const GroupMail = ({ rej(response.error); }) .catch((error) => { - rej(error.message || 'An error occurred'); + rej( + error.message || + t('core:message.error.generic', { postProcess: 'capitalize' }) + ); }); }); } catch (error) { @@ -186,7 +179,7 @@ export const GroupMail = ({ } }; - const getAllThreads = React.useCallback( + const getAllThreads = useCallback( async (groupId: string, mode: string, isInitial?: boolean) => { try { setIsLoading(true); @@ -206,7 +199,7 @@ export const GroupMail = ({ }); const responseData = await response.json(); - let fullArrayMsg = isInitial ? [] : [...allThreads]; + const fullArrayMsg = isInitial ? [] : [...allThreads]; const getMessageForThreads = responseData.map(async (message: any) => { let fullObject: any = null; if (message?.metadata?.description) { @@ -271,13 +264,12 @@ export const GroupMail = ({ } finally { if (isInitial) { setIsLoading(false); - // dispatch(setIsLoadingCustom(null)); } } }, [allThreads, isPrivate] ); - const getMailMessages = React.useCallback( + const getMailMessages = useCallback( async (groupId: string, members: any) => { try { setIsLoading(true); @@ -315,7 +307,7 @@ export const GroupMail = ({ .sort((a, b) => b.created - a.created) .slice(0, 10); - let fullThreadArray: any = []; + const fullThreadArray: any = []; const getMessageForThreads = newArray.map(async (message: any) => { try { const identifierQuery = message.threadId; @@ -327,6 +319,7 @@ export const GroupMail = ({ }, }); const responseData = await response.json(); + if (responseData.length > 0) { const thread = responseData[0]; if (thread?.metadata?.description) { @@ -342,7 +335,7 @@ export const GroupMail = ({ }; fullThreadArray.push(fullObject); } else { - let threadRes = await Promise.race([ + const threadRes = await Promise.race([ getEncryptedResource( { name: thread.name, @@ -377,13 +370,12 @@ export const GroupMail = ({ console.log(error); } finally { setIsLoading(false); - // dispatch(setIsLoadingCustom(null)); } }, [secretKey, isPrivate] ); - const getMessages = React.useCallback(async () => { + const getMessages = useCallback(async () => { // if ( !groupId || members?.length === 0) return; if (!groupId || isPrivate === null) return; @@ -400,7 +392,6 @@ export const GroupMail = ({ if (filterModeRef.current !== filterMode) { firstMount.current = false; } - // if (groupId && !firstMount.current && members.length > 0) { if (groupId && !firstMount.current && isPrivate !== null) { if (filterMode === 'Recently active') { getMessages(); @@ -427,11 +418,6 @@ export const GroupMail = ({ if (groupData && Array.isArray(groupData?.members)) { for (const member of groupData.members) { if (member.member) { - // const res = await getNameInfo(member.member); - // const resAddress = await qortalRequest({ - // action: "GET_ACCOUNT_DATA", - // address: member.member, - // }); const name = res; const publicKey = resAddress.publicKey; if (name) { @@ -465,16 +451,6 @@ export const GroupMail = ({ [filterMode] ); - // useEffect(()=> { - // if(user?.name){ - // const threads = JSON.parse( - // localStorage.getItem(`qmail_threads_viewedtimestamp_${user.name}`) || "{}" - // ); - // setViewedThreads(threads) - - // } - // }, [user?.name, currentThread]) - const handleCloseThreadFilterList = () => { setIsOpenFilterList(false); }; @@ -596,7 +572,7 @@ export const GroupMail = ({ padding: '0px', }} > - + {filterOptions?.map((filter) => { return ( @@ -621,6 +597,7 @@ export const GroupMail = ({ /> )} + {filter} @@ -630,9 +607,10 @@ export const GroupMail = ({ ); })} - + + + + - last message:{' '} + {t('group:last_message', { + postProcess: 'capitalize', + })} + :{' '} {formatDate(thread?.created)} )} + { setTimeout(() => { @@ -834,6 +820,7 @@ export const GroupMail = ({ + { const { t } = useTranslation(['core', 'group']); - const { show } = React.useContext(MyContext); + const { show } = useContext(MyContext); const [isOpen, setIsOpen] = useState(false); const [value, setValue] = useState(''); const [isSending, setIsSending] = useState(false); const [threadTitle, setThreadTitle] = useState(''); - const [openSnack, setOpenSnack] = React.useState(false); - const [infoSnack, setInfoSnack] = React.useState(null); + const [openSnack, setOpenSnack] = useState(false); + const [infoSnack, setInfoSnack] = useState(null); const editorRef = useRef(null); const theme = useTheme(); const setEditorRef = (editorInstance) => { @@ -203,31 +202,37 @@ export const NewThread = ({ // if (!description) missingFields.push('subject') if (missingFields.length > 0) { const missingFieldsString = missingFields.join(', '); - const errMsg = `Missing: ${missingFieldsString}`; - errorMsg = errMsg; // TODO translate + const errMsg = t('group:message.error.missing_field', { + field: missingFieldsString, + postProcess: 'capitalize', + }); + errorMsg = errMsg; } if (errorMsg) { - // dispatch( - // setNotification({ - // msg: errorMsg, - // alertType: "error", - // }) - // ); throw new Error(errorMsg); } const htmlContent = editorRef.current.getHTML(); - if (!htmlContent?.trim() || htmlContent?.trim() === '

') - throw new Error('Please provide a first message to the thread'); + if (!htmlContent?.trim() || htmlContent?.trim() === '

') { + const errMsg = t('group:message.generic.provide_message', { + postProcess: 'capitalize', + }); + throw new Error(errMsg); + } + const fee = await getFee('ARBITRARY'); let feeToShow = fee.fee; + if (!isMessage) { feeToShow = +feeToShow * 2; } await show({ - message: 'Would you like to perform a ARBITRARY transaction?', + message: t('group:question.perform_transaction', { + action: 'ARBITRARY', + postProcess: 'capitalize', + }), publishFee: feeToShow + ' QORT', }); @@ -238,6 +243,7 @@ export const NewThread = ({ delete reply.reply; } } + const mailObject: any = { createdAt: Date.now(), version: 1, @@ -250,7 +256,10 @@ export const NewThread = ({ const secretKey = isPrivate === false ? null : await getSecretKey(false, true); if (!secretKey && isPrivate) { - throw new Error('Cannot get group secret key'); + const errMsg = t('group:message.error.group_secret_key', { + postProcess: 'capitalize', + }); + throw new Error(errMsg); } if (!isMessage) { @@ -273,17 +282,18 @@ export const NewThread = ({ isPrivate === false ? threadToBase64 : await encryptSingleFunc(threadToBase64, secretKey); - let identifierThread = `grp-${groupInfo.groupId}-thread-${idThread}`; + const identifierThread = `grp-${groupInfo.groupId}-thread-${idThread}`; await publishGroupEncryptedResource({ identifier: identifierThread, encryptedData: encryptSingleThread, }); - let identifierPost = `thmsg-${identifierThread}-${idMsg}`; + const identifierPost = `thmsg-${identifierThread}-${idMsg}`; await publishGroupEncryptedResource({ identifier: identifierPost, encryptedData: encryptSingleFirstPost, }); + const dataToSaveToStorage = { name: myName, identifier: identifierThread, @@ -292,6 +302,7 @@ export const NewThread = ({ created: Date.now(), groupId: groupInfo.groupId, }; + const dataToSaveToStoragePost = { name: myName, identifier: identifierPost, @@ -300,6 +311,7 @@ export const NewThread = ({ created: Date.now(), threadId: identifierThread, }; + await saveTempPublish({ data: dataToSaveToStorage, key: 'thread' }); await saveTempPublish({ data: dataToSaveToStoragePost, @@ -307,36 +319,32 @@ export const NewThread = ({ }); setInfoSnack({ type: 'success', - message: - 'Successfully created thread. It may take some time for the publish to propagate', + message: t('group:message.success.thread_creation', { + postProcess: 'capitalize', + }), }); setOpenSnack(true); - // dispatch( - // setNotification({ - // msg: "Message sent", - // alertType: "success", - // }) - // ); if (publishCallback) { publishCallback(); } closeModal(); } else { - if (!currentThread) throw new Error('unable to locate thread Id'); + if (!currentThread) { + const errMsg = t('group:message.error.thread_id', { + postProcess: 'capitalize', + }); + throw new Error(errMsg); + } const idThread = currentThread.threadId; const messageToBase64 = await objectToBase64(mailObject); const encryptSinglePost = isPrivate === false ? messageToBase64 : await encryptSingleFunc(messageToBase64, secretKey); - const idMsg = uid.rnd(); - let identifier = `thmsg-${idThread}-${idMsg}`; - const res = await publishGroupEncryptedResource({ - identifier: identifier, - encryptedData: encryptSinglePost, - }); + const idMsg = uid.rnd(); + const identifier = `thmsg-${idThread}-${idMsg}`; const dataToSaveToStoragePost = { threadId: idThread, name: myName, @@ -349,32 +357,17 @@ export const NewThread = ({ data: dataToSaveToStoragePost, key: 'thread-post', }); - // await qortalRequest(multiplePublishMsg); - // dispatch( - // setNotification({ - // msg: "Message sent", - // alertType: "success", - // }) - // ); setInfoSnack({ type: 'success', - message: - 'Successfully created post. It may take some time for the publish to propagate', + message: t('group:message.success.post_creation', { + postProcess: 'capitalize', + }), }); setOpenSnack(true); if (publishCallback) { publishCallback(); } - // messageCallback({ - // identifier, - // id: identifier, - // name, - // service: MAIL_SERVICE_TYPE, - // created: Date.now(), - // ...mailObject, - // }); } - closeModal(); } catch (error: any) { if (error?.message) { @@ -393,6 +386,7 @@ export const NewThread = ({ const sendMail = () => { publishQDNResource(); }; + return ( setIsOpen(true)} > - {currentThread ? 'New Post' : 'New Thread'} + + {currentThread + ? t('core:action.new.post', { + postProcess: 'capitalize', + }) + : t('core:action.new.thread', { + postProcess: 'capitalize', + })} + - {isMessage ? 'Post Message' : 'New Thread'} + {isMessage + ? t('core:action.post_message', { + postProcess: 'capitalize', + }) + : t('core:action.new.thread', { + postProcess: 'capitalize', + })} +
+ + -
{isSending && ( - {isMessage ? 'Post' : 'Create Thread'} + {isMessage + ? t('core:action.post', { + postProcess: 'capitalize', + }) + : t('core:action.create_thread', { + postProcess: 'capitalize', + })} {isMessage ? ( diff --git a/src/components/Group/Forum/ReadOnlySlate.tsx b/src/components/Group/Forum/ReadOnlySlate.tsx index 5724f92..15e1436 100644 --- a/src/components/Group/Forum/ReadOnlySlate.tsx +++ b/src/components/Group/Forum/ReadOnlySlate.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import { FC, useCallback, useEffect, useMemo, useState } from 'react'; import { createEditor } from 'slate'; import { withReact, @@ -96,7 +96,7 @@ interface ReadOnlySlateProps { content: any; mode?: string; } -const ReadOnlySlate: React.FC = ({ content, mode }) => { +const ReadOnlySlate: FC = ({ content, mode }) => { const [load, setLoad] = useState(false); const editor = useMemo(() => withReact(createEditor()), []); const value = useMemo(() => content, [content]); diff --git a/src/components/Group/Forum/ReusableModal.tsx b/src/components/Group/Forum/ReusableModal.tsx index 1bedccb..9bd25c7 100644 --- a/src/components/Group/Forum/ReusableModal.tsx +++ b/src/components/Group/Forum/ReusableModal.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { FC } from 'react'; import { Box, Modal, useTheme } from '@mui/material'; interface MyModalProps { @@ -9,7 +9,7 @@ interface MyModalProps { customStyles?: any; } -export const ReusableModal: React.FC = ({ +export const ReusableModal: FC = ({ open, onClose, onSubmit, diff --git a/src/components/Group/Forum/ShowMessageWithoutModal.tsx b/src/components/Group/Forum/ShowMessageWithoutModal.tsx index 914b9c5..4b862d4 100644 --- a/src/components/Group/Forum/ShowMessageWithoutModal.tsx +++ b/src/components/Group/Forum/ShowMessageWithoutModal.tsx @@ -118,27 +118,6 @@ export const ShowMessage = ({ message, openNewPostWithQuote, myName }: any) => { width: 'auto', }} > - {/* - - - - {file?.originalFilename || file?.filename} - - */} {message?.attachments?.length > 1 && isFirst && ( { try { setTempPublishedList([]); @@ -328,7 +321,7 @@ export const Thread = ({ }, [messages, secretKey] ); - const getMessages = React.useCallback(async () => { + const getMessages = useCallback(async () => { if ( !currentThread || (!secretKey && isPrivate) || @@ -410,7 +403,7 @@ export const Thread = ({ const interval = useRef(null); - const checkNewMessages = React.useCallback( + const checkNewMessages = useCallback( async (groupInfo: any) => { try { let threadId = groupInfo.threadId; @@ -494,7 +487,7 @@ export const Thread = ({ firstMount.current = true; }; - React.useEffect(() => { + useEffect(() => { subscribeToEvent('threadFetchMode', threadFetchModeFunc); return () => { @@ -656,6 +649,7 @@ export const Thread = ({
+ {t('core:page.previous', { postProcess: 'capitalize' })} + + + + + @@ -347,6 +384,7 @@ export const ManageMembers = ({ /> )} + {value === 1 && ( - + ); }; diff --git a/src/components/Group/QMailMessages.tsx b/src/components/Group/QMailMessages.tsx index 72a23d5..b20f519 100644 --- a/src/components/Group/QMailMessages.tsx +++ b/src/components/Group/QMailMessages.tsx @@ -11,12 +11,12 @@ import MailIcon from '@mui/icons-material/Mail'; import MailOutlineIcon from '@mui/icons-material/MailOutline'; import { executeEvent } from '../../utils/events'; import { CustomLoader } from '../../common/CustomLoader'; - import { mailsAtom, qMailLastEnteredTimestampAtom } from '../../atoms/global'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import ExpandLessIcon from '@mui/icons-material/ExpandLess'; import MarkEmailUnreadIcon from '@mui/icons-material/MarkEmailUnread'; import { useAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; export const isLessThanOneWeekOld = (timestamp) => { // Current time in milliseconds @@ -54,6 +54,7 @@ export const QMailMessages = ({ userName, userAddress }) => { const [loading, setLoading] = useState(true); const theme = useTheme(); + const { t } = useTranslation(['core', 'group']); const getMails = useCallback(async () => { try { @@ -89,7 +90,10 @@ export const QMailMessages = ({ userName, userAddress }) => { rej(response.error); }) .catch((error) => { - rej(error.message || 'An error occurred'); // TODO translate + rej( + error.message || + t('core:message.error.generic', { postProcess: 'capitalize' }) + ); }); }); } catch (error) { @@ -129,20 +133,20 @@ export const QMailMessages = ({ userName, userAddress }) => { return ( setIsExpanded((prev) => !prev)} > @@ -151,8 +155,9 @@ export const QMailMessages = ({ userName, userAddress }) => { fontSize: '1rem', }} > - Latest Q-Mails + {t('group:latest_mails', { postProcess: 'capitalize' })} + { {loading && mails.length === 0 && ( @@ -206,11 +211,11 @@ export const QMailMessages = ({ userName, userAddress }) => { {!loading && mails.length === 0 && ( { color: theme.palette.primary, }} > - Nothing to display + {t('group:message.generic.no_display', { + postProcess: 'capitalize', + })} )} diff --git a/src/components/Group/Settings.tsx b/src/components/Group/Settings.tsx index 930a366..70859d4 100644 --- a/src/components/Group/Settings.tsx +++ b/src/components/Group/Settings.tsx @@ -20,7 +20,6 @@ import ContentCopyIcon from '@mui/icons-material/ContentCopy'; import { Box, Button, - ButtonBase, DialogActions, DialogContent, DialogContentText, @@ -32,7 +31,6 @@ import { useTheme, } from '@mui/material'; import { enabledDevModeAtom } from '../../atoms/global'; - import ThemeManager from '../Theme/ThemeManager'; import { useAtom } from 'jotai'; import { decryptStoredWallet } from '../../utils/decryptWallet'; @@ -41,6 +39,7 @@ import PhraseWallet from '../../utils/generateWallet/phrase-wallet'; import { walletVersion } from '../../background'; import Base58 from '../../deps/Base58'; import { MyContext } from '../../App'; +import { useTranslation } from 'react-i18next'; const LocalNodeSwitch = styled(Switch)(({ theme }) => ({ padding: 8, @@ -87,8 +86,8 @@ const Transition = forwardRef(function Transition( export const Settings = ({ open, setOpen, rawWallet }) => { const [checked, setChecked] = useState(false); const [isEnabledDevMode, setIsEnabledDevMode] = useAtom(enabledDevModeAtom); - const theme = useTheme(); + const { t } = useTranslation(['core', 'group']); const handleChange = (event: ChangeEvent) => { setChecked(event.target.checked); @@ -103,7 +102,7 @@ export const Settings = ({ open, setOpen, rawWallet }) => { if (response?.error) { console.error('Error adding user settings:', response.error); } else { - console.log('User settings added successfully'); // TODO translate + console.log('User settings added successfully'); } }) .catch((error) => { @@ -134,7 +133,10 @@ export const Settings = ({ open, setOpen, rawWallet }) => { rej(response.error); }) .catch((error) => { - rej(error.message || 'An error occurred'); + rej( + error.message || + t('core:message.error.generic', { postProcess: 'capitalize' }) + ); }); }); } catch (error) { @@ -157,7 +159,9 @@ export const Settings = ({ open, setOpen, rawWallet }) => { - General Settings + {t('core:general_settings', { + postProcess: 'capitalize', + })} { { control={ } - label="Disable all push notifications" + label={t('group:action.disable_push_notifications', { + postProcess: 'capitalize', + })} /> {window?.electronAPI && ( { }} /> } - label="Enable dev mode" + label={t('group:action.enable_dev_mode', { + postProcess: 'capitalize', + })} /> )} {isEnabledDevMode && } @@ -220,13 +228,16 @@ const ExportPrivateKey = ({ rawWallet }) => { const [password, setPassword] = useState(''); const [privateKey, setPrivateKey] = useState(''); const [isOpen, setIsOpen] = useState(false); - const [isLoading, setIsLoading] = useState(false); const { setOpenSnackGlobal, setInfoSnackCustom } = useContext(MyContext); + const { t } = useTranslation(['core', 'group']); + const exportPrivateKeyFunc = async () => { try { setInfoSnackCustom({ type: 'info', - message: 'Decrypting wallet...', + message: t('group:message.generic.descrypt_wallet', { + postProcess: 'capitalize', + }), }); setOpenSnackGlobal(true); @@ -247,13 +258,19 @@ const ExportPrivateKey = ({ rawWallet }) => { setInfoSnackCustom({ type: 'error', message: error?.message - ? `Error decrypting wallet: ${error?.message}` - : 'Error decrypting wallet', + ? t('group:message.error.decrypt_wallet', { + errorMessage: error?.message, + postProcess: 'capitalize', + }) + : t('group:message.error.descrypt_wallet', { + postProcess: 'capitalize', + }), }); setOpenSnackGlobal(true); } }; + return ( <> + - Export password + + {t('group:action.export_password', { + postProcess: 'capitalize', + })} + + { }} > - Keep your private key in a secure place. Do not share! + {t('group:message.generic.secure_place', { + postProcess: 'capitalize', + })} + + { navigator.clipboard.writeText(privateKey); setInfoSnackCustom({ type: 'success', - message: 'Copied privated key', + message: t('group:message.generic.private_key_copied', { + postProcess: 'capitalize', + }), }); setOpenSnackGlobal(true); }} > - {`Copy private key `} + {t('group:action.copy_private_key', { + postProcess: 'capitalize', + })}{' '} )} + + diff --git a/src/components/Group/ThingsToDoInitial.tsx b/src/components/Group/ThingsToDoInitial.tsx index 84c806b..94d66ed 100644 --- a/src/components/Group/ThingsToDoInitial.tsx +++ b/src/components/Group/ThingsToDoInitial.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import { useEffect, useMemo, useState } from 'react'; import List from '@mui/material/List'; import ListItem from '@mui/material/ListItem'; import ListItemButton from '@mui/material/ListItemButton'; @@ -17,27 +17,27 @@ export const ThingsToDoInitial = ({ balance, userInfo, }) => { - const [checked1, setChecked1] = React.useState(false); - const [checked2, setChecked2] = React.useState(false); + const [checked1, setChecked1] = useState(false); + const [checked2, setChecked2] = useState(false); const { t } = useTranslation(['core', 'tutorial']); const theme = useTheme(); - React.useEffect(() => { + useEffect(() => { if (balance && +balance >= 6) { setChecked1(true); } }, [balance]); - React.useEffect(() => { + useEffect(() => { if (name) setChecked2(true); }, [name]); - const isLoaded = React.useMemo(() => { + const isLoaded = useMemo(() => { if (userInfo !== null) return true; return false; }, [userInfo]); - const hasDoneNameAndBalanceAndIsLoaded = React.useMemo(() => { + const hasDoneNameAndBalanceAndIsLoaded = useMemo(() => { if (isLoaded && checked1 && checked2) return true; return false; }, [checked1, isLoaded, checked2]); @@ -55,18 +55,18 @@ export const ThingsToDoInitial = ({ return ( + + ([]); const [isLoading, setIsLoading] = useState(false); const theme = useTheme(); + const { t } = useTranslation(['core', 'group']); const [popoverAnchor, setPopoverAnchor] = useState(null); // Track which list item the popover is anchored to const [openPopoverIndex, setOpenPopoverIndex] = useState(null); // Track which list item has the popover open - const listRef = useRef(); + const listRef = useRef(null); const getRequests = async () => { try { @@ -94,9 +96,13 @@ export const UserListOfInvites = ({ const handleJoinGroup = async (groupId, groupName) => { try { - const fee = await getFee('JOIN_GROUP'); // TODO translate + const fee = await getFee('JOIN_GROUP'); + await show({ - message: 'Would you like to perform an JOIN_GROUP transaction?', + message: t('group:question.perform_transaction', { + action: 'JOIN_GROUP', + postProcess: 'capitalize', + }), publishFee: fee.fee + ' QORT', }); @@ -123,8 +129,9 @@ export const UserListOfInvites = ({ res(response); setInfoSnack({ type: 'success', - message: - 'Successfully requested to join group. It may take a couple of minutes for the changes to propagate', + message: t('group:message.success.group_join', { + postProcess: 'capitalize', + }), }); setOpenSnack(true); handlePopoverClose(); @@ -140,13 +147,16 @@ export const UserListOfInvites = ({ .catch((error) => { setInfoSnack({ type: 'error', - message: error.message || 'An error occurred', + message: + error.message || + t('core:message.error.generic', { postProcess: 'capitalize' }), }); setOpenSnack(true); rej(error); }); }); } catch (error) { + console.log(error); } finally { setIsLoading(false); } @@ -182,16 +192,22 @@ export const UserListOfInvites = ({ > - Join {invite?.groupName} + + {t('core:action.join', { + postProcess: 'capitalize', + })}{' '} + {invite?.groupName} + + - Join group + {t('group:action.join_group', { + postProcess: 'capitalize', + })} + handlePopoverOpen(event, index)} > @@ -221,7 +240,9 @@ export const UserListOfInvites = ({ }} /> )} + + -

Invite list

+

+ {t('core:list.invite', { + postProcess: 'capitalize', + })} +

+
diff --git a/src/components/Group/WalletsAppWrapper.tsx b/src/components/Group/WalletsAppWrapper.tsx index 7e44eb6..0b332b8 100644 --- a/src/components/Group/WalletsAppWrapper.tsx +++ b/src/components/Group/WalletsAppWrapper.tsx @@ -1,5 +1,5 @@ -import { Box, ButtonBase, Divider, Typography, useTheme } from '@mui/material'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { Box, ButtonBase, Divider, Typography, useTheme } from '@mui/material'; import CloseIcon from '@mui/icons-material/Close'; import AppViewerContainer from '../Apps/AppViewerContainer'; import { @@ -19,7 +19,6 @@ export const WalletsAppWrapper = () => { const [navigationController, setNavigationController] = useAtom( navigationControllerAtom ); - const [selectedTab, setSelectedTab] = useState({ tabId: '5558589', name: 'Q-Wallets', @@ -60,17 +59,17 @@ export const WalletsAppWrapper = () => { {isOpen && ( { display: 'flex', alignItems: 'center', padding: '5px', - justifyContent: 'space-between', }} > Q-Wallets + { ref={iframeRef} skipAuth={true} /> + { > + { if (selectedTab?.refreshFunc) { diff --git a/src/components/Group/useBlockUsers.tsx b/src/components/Group/useBlockUsers.tsx index e82d0c6..4aa100c 100644 --- a/src/components/Group/useBlockUsers.tsx +++ b/src/components/Group/useBlockUsers.tsx @@ -164,6 +164,7 @@ export const useBlockedAddresses = () => { }); }); } + if (address) { await new Promise((res, rej) => { window diff --git a/src/components/GroupAvatar.tsx b/src/components/GroupAvatar.tsx index 3364b8f..3244d5c 100644 --- a/src/components/GroupAvatar.tsx +++ b/src/components/GroupAvatar.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useContext, useEffect, useState } from 'react'; +import { useCallback, useContext, useEffect, useState } from 'react'; import Logo2 from '../assets/svgs/Logo2.svg'; import { MyContext, getArbitraryEndpointReact, getBaseApiReact } from '../App'; import { diff --git a/src/components/Home/NewUsersCTA.tsx b/src/components/Home/NewUsersCTA.tsx index 44666d6..68e8b06 100644 --- a/src/components/Home/NewUsersCTA.tsx +++ b/src/components/Home/NewUsersCTA.tsx @@ -36,7 +36,7 @@ export const NewUsersCTA = ({ balance }) => { textAlign: 'center', }} > - {t('core:new_user', { postProcess: 'capitalize' })} + {t('core:question.new_user', { postProcess: 'capitalize' })} diff --git a/src/components/Home/QortPrice.tsx b/src/components/Home/QortPrice.tsx index ec74b11..a9bd62a 100644 --- a/src/components/Home/QortPrice.tsx +++ b/src/components/Home/QortPrice.tsx @@ -168,6 +168,7 @@ export const QortPrice = () => { )} + { )} + diff --git a/src/components/Loader.tsx b/src/components/Loader.tsx index 8db908e..dadf8fd 100644 --- a/src/components/Loader.tsx +++ b/src/components/Loader.tsx @@ -1,9 +1,9 @@ -import React from 'react' -import { Box, CircularProgress } from "@mui/material"; +import { Box, CircularProgress } from '@mui/material'; export const Loader = () => { return ( - { height: '100%', position: 'fixed', top: '0px', - left:'0px', + left: '0px', right: '0px', bottom: '0px', zIndex: 10, - background: 'rgba(0, 0, 0, 0.4)' - }}> - + background: 'rgba(0, 0, 0, 0.4)', + }} + > + - ) -} + ); +}; diff --git a/src/components/MainAvatar.tsx b/src/components/MainAvatar.tsx index 04d7172..10370de 100644 --- a/src/components/MainAvatar.tsx +++ b/src/components/MainAvatar.tsx @@ -1,4 +1,4 @@ -import React, { useContext, useEffect, useState } from 'react'; +import { useContext, useEffect, useState } from 'react'; import Logo2 from '../assets/svgs/Logo2.svg'; import { MyContext, getArbitraryEndpointReact, getBaseApiReact } from '../App'; import { diff --git a/src/components/RegisterName.tsx b/src/components/RegisterName.tsx index 4b52a45..adb8198 100644 --- a/src/components/RegisterName.tsx +++ b/src/components/RegisterName.tsx @@ -1,33 +1,22 @@ -import React, { useCallback, useContext, useEffect, useState } from 'react'; +import { useCallback, useEffect, useState } from 'react'; import { - Avatar, Box, Button, - ButtonBase, - Collapse, Dialog, DialogActions, DialogContent, - DialogContentText, DialogTitle, - Input, ListItem, - ListItemAvatar, - ListItemButton, ListItemIcon, ListItemText, List, - MenuItem, - Popover, - Select, TextField, Typography, useTheme, } from '@mui/material'; import { Label } from './Group/AddGroup'; import { Spacer } from '../common/Spacer'; -import { LoadingButton } from '@mui/lab'; -import { getBaseApiReact, MyContext } from '../App'; +import { getBaseApiReact } from '../App'; import { getFee } from '../background'; import RadioButtonCheckedIcon from '@mui/icons-material/RadioButtonChecked'; import { subscribeToEvent, unsubscribeFromEvent } from '../utils/events'; @@ -43,6 +32,7 @@ enum Availability { AVAILABLE = 'available', NOT_AVAILABLE = 'not-available', } + export const RegisterName = ({ setOpenSnack, setInfoSnack, @@ -77,7 +67,6 @@ export const RegisterName = ({ } } catch (error) { console.error(error); - } finally { } }; // Debounce logic @@ -195,21 +184,22 @@ export const RegisterName = ({ aria-describedby="alert-dialog-description" > {'Register name'} + - + // TODO: translate + )} @@ -307,6 +298,7 @@ export const RegisterName = ({ + + +