new user tooltips

This commit is contained in:
PhilReact 2025-01-31 16:50:44 +02:00
parent 8b73020ce7
commit 513fd0375d
5 changed files with 116 additions and 23 deletions

View File

@ -384,7 +384,7 @@ function App() {
const seedPhrase = generatorRef.current.parsedString const seedPhrase = generatorRef.current.parsedString
saveSeedPhraseToDisk(seedPhrase) saveSeedPhraseToDisk(seedPhrase)
} }
const {showTutorial, openTutorialModal, shownTutorialsInitiated, setOpenTutorialModal} = useHandleTutorials() const {showTutorial, openTutorialModal, shownTutorialsInitiated, setOpenTutorialModal, hasSeenGettingStarted} = useHandleTutorials()
const {getIndividualUserInfo} = useHandleUserInfo() const {getIndividualUserInfo} = useHandleUserInfo()
const passwordRef = useRef<HTMLInputElement>(null); const passwordRef = useRef<HTMLInputElement>(null);
@ -1761,7 +1761,8 @@ function App() {
showTutorial, showTutorial,
openTutorialModal, openTutorialModal,
setOpenTutorialModal, setOpenTutorialModal,
downloadResource downloadResource,
hasSeenGettingStarted
}}> }}>
<Tutorials /> <Tutorials />
@ -2318,8 +2319,7 @@ function App() {
height: "154px", height: "154px",
}} }}
> >
<img src={Logo1} className="base-image" /> <img src={Logo1Dark} className="base-image" />
<img src={Logo1Dark} className="hover-image" />
</div> </div>
<Spacer height="38px" /> <Spacer height="38px" />
<TextP <TextP
@ -2381,8 +2381,7 @@ function App() {
height: "154px", height: "154px",
}} }}
> >
<img src={Logo1} className="base-image" /> <img src={Logo1Dark} className="base-image" />
<img src={Logo1Dark} className="hover-image" />
</div> </div>
<Spacer height="38px" /> <Spacer height="38px" />
<TextP <TextP
@ -2478,8 +2477,7 @@ function App() {
height: "154px", height: "154px",
}} }}
> >
<img src={Logo1} className="base-image" /> <img src={Logo1Dark} className="base-image" />
<img src={Logo1Dark} className="hover-image" />
</div> </div>
<Spacer height="35px" /> <Spacer height="35px" />
<Box <Box
@ -2556,8 +2554,7 @@ function App() {
height: "154px", height: "154px",
}} }}
> >
<img src={Logo1} className="base-image" /> <img src={Logo1Dark} className="base-image" />
<img src={Logo1Dark} className="hover-image" />
</div> </div>
<Spacer height="35px" /> <Spacer height="35px" />
<Box <Box
@ -2649,8 +2646,7 @@ function App() {
height: "154px", height: "154px",
}} }}
> >
<img src={Logo1} className="base-image" /> <img src={Logo1Dark} className="base-image" />
<img src={Logo1Dark} className="hover-image" />
</div> </div>
<Spacer height="38px" /> <Spacer height="38px" />
<TextP <TextP

View File

@ -14,7 +14,10 @@ import {
Switch, Switch,
Tooltip, Tooltip,
Typography, Typography,
ButtonBase ButtonBase,
styled,
tooltipClasses,
TooltipProps
} from "@mui/material"; } from "@mui/material";
import Logo1 from "../assets/svgs/Logo1.svg"; import Logo1 from "../assets/svgs/Logo1.svg";
import Logo1Dark from "../assets/svgs/Logo1Dark.svg"; import Logo1Dark from "../assets/svgs/Logo1Dark.svg";
@ -27,6 +30,18 @@ import { GlobalContext } from "../App";
const manifestData = chrome?.runtime?.getManifest(); const manifestData = chrome?.runtime?.getManifest();
export const HtmlTooltip = styled(({ className, ...props }: TooltipProps) => (
<Tooltip {...props} classes={{ popper: className }} />
))(({ theme }) => ({
[`& .${tooltipClasses.tooltip}`]: {
backgroundColor: '#232428',
color: 'white',
maxWidth: 320,
padding: '20px',
fontSize: theme.typography.pxToRem(12),
},
}));
export const NotAuthenticated = ({ export const NotAuthenticated = ({
getRootProps, getRootProps,
getInputProps, getInputProps,
@ -58,7 +73,7 @@ export const NotAuthenticated = ({
const importedApiKeyRef = useRef(null) const importedApiKeyRef = useRef(null)
const currentNodeRef = useRef(null) const currentNodeRef = useRef(null)
const hasLocalNodeRef = useRef(null) const hasLocalNodeRef = useRef(null)
const { showTutorial } = useContext(GlobalContext); const { showTutorial, hasSeenGettingStarted } = useContext(GlobalContext);
const isLocal = cleanUrl(currentNode?.url) === "127.0.0.1:12391"; const isLocal = cleanUrl(currentNode?.url) === "127.0.0.1:12391";
const handleFileChangeApiKey = (event) => { const handleFileChangeApiKey = (event) => {
@ -74,6 +89,8 @@ export const NotAuthenticated = ({
} }
}; };
const checkIfUserHasLocalNode = useCallback(async () => { const checkIfUserHasLocalNode = useCallback(async () => {
try { try {
const url = `http://127.0.0.1:12391/admin/status`; const url = `http://127.0.0.1:12391/admin/status`;
@ -237,18 +254,22 @@ export const NotAuthenticated = ({
height: "154px", height: "154px",
}} }}
> >
<img src={Logo1} className="base-image" /> <img src={Logo1Dark} className="base-image" />
<img src={Logo1Dark} className="hover-image" />
</div> </div>
<Spacer height="30px" /> <Spacer height="30px" />
<TextP <TextP
sx={{ sx={{
textAlign: "center", textAlign: "center",
lineHeight: "15px", lineHeight: 1.2,
fontSize: '18px'
}} }}
> >
WELCOME TO <TextItalic>YOUR</TextItalic> <br></br> WELCOME TO <TextItalic sx={{
<TextSpan> QORTAL WALLET</TextSpan> fontSize: '18px'
}}>YOUR</TextItalic> <br></br>
<TextSpan sx={{
fontSize: '18px'
}}> QORTAL WALLET</TextSpan>
</TextP> </TextP>
<Spacer height="30px" /> <Spacer height="30px" />
<Box <Box
@ -257,10 +278,22 @@ export const NotAuthenticated = ({
gap: "10px", gap: "10px",
alignItems: "center", alignItems: "center",
}} }}
>
<HtmlTooltip
disableHoverListener={hasSeenGettingStarted === true}
placement="left"
title={
<React.Fragment>
<Typography color="inherit" sx={{
fontSize: '16px'
}}>Your wallet is like your digital ID on Qortal, and is how you will login to the Qortal User Interface. It holds your public address and the Qortal name you will eventually choose. Every transaction you make is linked to your ID, and this is where you manage all your QORT and other tradeable cryptocurrencies on Qortal.</Typography>
</React.Fragment>
}
> >
<CustomButton onClick={()=> setExtstate('wallets')}> <CustomButton onClick={()=> setExtstate('wallets')}>
Wallets Wallets
</CustomButton> </CustomButton>
</HtmlTooltip>
</Box> </Box>
<Spacer height="6px" /> <Spacer height="6px" />
@ -270,15 +303,39 @@ export const NotAuthenticated = ({
gap: "10px", gap: "10px",
alignItems: "center", alignItems: "center",
}} }}
>
<HtmlTooltip
disableHoverListener={hasSeenGettingStarted === true}
placement="right"
title={
<React.Fragment>
<Typography color="inherit" sx={{
fontWeight: 'bold',
fontSize: '18px'
}}>New users start here!</Typography>
<Spacer height='10px'/>
<Typography color="inherit" sx={{
fontSize: '16px'
}}>Creating an account means creating a new wallet and digital ID to start using Qortal. Once you have made your account, you can start doing things like obtaining some QORT, buying a name and avatar, publishing videos and blogs, and much more.</Typography>
</React.Fragment>
}
> >
<CustomButton <CustomButton
onClick={() => { onClick={() => {
setExtstate("create-wallet"); setExtstate("create-wallet");
}} }}
sx={{
backgroundColor: hasSeenGettingStarted === false && 'var(--green)',
color: hasSeenGettingStarted === false && 'black',
"&:hover": {
backgroundColor: hasSeenGettingStarted === false && 'var(--green)',
color: hasSeenGettingStarted === false && 'black'
}
}}
> >
Create account Create wallet
</CustomButton> </CustomButton>
</HtmlTooltip>
</Box> </Box>
<Spacer height="15px" /> <Spacer height="15px" />
@ -299,9 +356,15 @@ export const NotAuthenticated = ({
gap: "10px", gap: "10px",
alignItems: "center", alignItems: "center",
flexDirection: "column", flexDirection: "column",
outline: '0.5px solid rgba(255, 255, 255, 0.5)',
padding: '20px 30px',
borderRadius: '5px',
}} }}
> >
<> <>
<Typography sx={{
textDecoration: 'underline'
}}>For advanced users</Typography>
<Box <Box
sx={{ sx={{
display: "flex", display: "flex",
@ -312,6 +375,12 @@ export const NotAuthenticated = ({
}} }}
> >
<FormControlLabel <FormControlLabel
sx={{
"& .MuiFormControlLabel-label": {
fontSize: '14px'
}
}}
control={ control={
<Switch <Switch
sx={{ sx={{

View File

@ -1,4 +1,4 @@
import React, { useEffect, useRef, useState } from "react"; import React, { useContext, useEffect, useRef, useState } from "react";
import List from "@mui/material/List"; import List from "@mui/material/List";
import ListItem from "@mui/material/ListItem"; import ListItem from "@mui/material/ListItem";
import Divider from "@mui/material/Divider"; import Divider from "@mui/material/Divider";
@ -19,6 +19,8 @@ import { decryptStoredWalletFromSeedPhrase } from "./utils/decryptWallet";
import { crypto, walletVersion } from "./constants/decryptWallet"; import { crypto, walletVersion } from "./constants/decryptWallet";
import { LoadingButton } from "@mui/lab"; import { LoadingButton } from "@mui/lab";
import { PasswordField } from "./components"; import { PasswordField } from "./components";
import { GlobalContext } from "./App";
import { HtmlTooltip } from "./ExtStates/NotAuthenticated";
const parsefilenameQortal = (filename)=> { const parsefilenameQortal = (filename)=> {
return filename.startsWith("qortal_backup_") ? filename.slice(14) : filename; return filename.startsWith("qortal_backup_") ? filename.slice(14) : filename;
@ -34,6 +36,7 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => {
const [password, setPassword] = useState(""); const [password, setPassword] = useState("");
const [isOpenSeedModal, setIsOpenSeedModal] = useState(false); const [isOpenSeedModal, setIsOpenSeedModal] = useState(false);
const [isLoadingEncryptSeed, setIsLoadingEncryptSeed] = useState(false); const [isLoadingEncryptSeed, setIsLoadingEncryptSeed] = useState(false);
const { hasSeenGettingStarted } = useContext(GlobalContext);
const { isShow, onCancel, onOk, show, } = useModal(); const { isShow, onCancel, onOk, show, } = useModal();
@ -228,6 +231,17 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => {
bottom: wallets?.length === 0 ? 'unset' : '20px', bottom: wallets?.length === 0 ? 'unset' : '20px',
right: wallets?.length === 0 ? 'unset' : '20px' right: wallets?.length === 0 ? 'unset' : '20px'
}} }}
>
<HtmlTooltip
disableHoverListener={hasSeenGettingStarted === true}
title={
<React.Fragment>
<Typography color="inherit" sx={{
fontSize: '16px'
}}>Already have a Qortal account? Enter your secret backup phrase here to access it. This phrase is one of the ways to recover your account.</Typography>
</React.Fragment>
}
> >
<CustomButton onClick={handleSetSeedValue} sx={{ <CustomButton onClick={handleSetSeedValue} sx={{
padding: '10px' padding: '10px'
@ -235,12 +249,25 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => {
Add seed-phrase Add seed-phrase
</CustomButton> </CustomButton>
</HtmlTooltip>
<HtmlTooltip
disableHoverListener={hasSeenGettingStarted === true}
title={
<React.Fragment>
<Typography color="inherit" sx={{
fontSize: '16px'
}}>Use this option to connect additional Qortal wallets you've already made, in order to login with them afterwards. You will need access to your backup JSON file in order to do so.</Typography>
</React.Fragment>
}
>
<CustomButton sx={{ <CustomButton sx={{
padding: '10px' padding: '10px'
}} {...getRootProps()}> }} {...getRootProps()}>
<input {...getInputProps()} /> <input {...getInputProps()} />
Add wallets Add wallets
</CustomButton> </CustomButton>
</HtmlTooltip>
</Box> </Box>
<Dialog <Dialog

View File

@ -176,6 +176,7 @@ useEffect(()=> {
return { return {
showTutorial, showTutorial,
openTutorialModal, openTutorialModal,
hasSeenGettingStarted: shownTutorials === null ? null : !!(shownTutorials || {})['getting-started'],
setOpenTutorialModal, setOpenTutorialModal,
shownTutorialsInitiated: !!shownTutorials shownTutorialsInitiated: !!shownTutorials
}; };

View File

@ -64,7 +64,7 @@ body {
} }
.image-container:hover .base-image { .image-container:hover .base-image {
opacity: 0; opacity: 0.6;
} }
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {