import { Box, Divider, Typography, useTheme } from '@mui/material'; import React from 'react'; import { Spacer } from '../../common/Spacer'; import { ThingsToDoInitial } from './ThingsToDoInitial'; import { GroupJoinRequests } from './GroupJoinRequests'; import { GroupInvites } from './GroupInvites'; import { ListOfGroupPromotions } from './ListOfGroupPromotions'; import { QortPrice } from '../Home/QortPrice'; import ExploreIcon from '@mui/icons-material/Explore'; import { Explore } from '../Explore/Explore'; import { NewUsersCTA } from '../Home/NewUsersCTA'; import { useTranslation } from 'react-i18next'; export const HomeDesktop = ({ refreshHomeDataFunc, myAddress, name, isLoadingGroups, balance, userInfo, groups, setGroupSection, setSelectedGroup, getTimestampEnterChat, setOpenManageMembers, setOpenAddGroup, setMobileViewMode, setDesktopViewMode, desktopViewMode, }) => { const [checked1, setChecked1] = React.useState(false); const [checked2, setChecked2] = React.useState(false); const { t } = useTranslation(['auth', 'core', 'group']); const theme = useTheme(); React.useEffect(() => { if (balance && +balance >= 6) { setChecked1(true); } }, [balance]); React.useEffect(() => { if (name) setChecked2(true); }, [name]); const isLoaded = React.useMemo(() => { if (userInfo !== null) return true; return false; }, [userInfo]); const hasDoneNameAndBalanceAndIsLoaded = React.useMemo(() => { if (isLoaded && checked1 && checked2) return true; return false; }, [checked1, isLoaded, checked2]); return ( 15 ? '16px' : '20px', padding: '10px', }} > {t('core:welcome', { postProcess: 'capitalizeFirst' })} {userInfo?.name ? ( {`, ${userInfo?.name}`} ) : null} {!isLoadingGroups && ( item?.groupId !== '0').length !== 0 } /> {desktopViewMode === 'home' && ( <> {/* */} {hasDoneNameAndBalanceAndIsLoaded && ( <> )} )} )} {!isLoadingGroups && ( <> {' '} {t('tutorial:initial.explore', { postProcess: 'capitalizeFirst', })} {' '} {!hasDoneNameAndBalanceAndIsLoaded && } {hasDoneNameAndBalanceAndIsLoaded && } )} ); };