new user tooltips

This commit is contained in:
PhilReact 2025-01-31 16:50:35 +02:00
parent 99e01c7df7
commit ba47989feb
5 changed files with 115 additions and 25 deletions

View File

@ -357,7 +357,7 @@ function App() {
const {downloadResource} = useFetchResources() const {downloadResource} = useFetchResources()
const holdRefExtState = useRef<extStates>("not-authenticated"); const holdRefExtState = useRef<extStates>("not-authenticated");
const isFocusedRef = useRef<boolean>(true); const isFocusedRef = useRef<boolean>(true);
const {showTutorial, openTutorialModal, shownTutorialsInitiated, setOpenTutorialModal} = useHandleTutorials() const {showTutorial, openTutorialModal, shownTutorialsInitiated, setOpenTutorialModal, hasSeenGettingStarted} = useHandleTutorials()
const { isShow, onCancel, onOk, show, message } = useModal(); const { isShow, onCancel, onOk, show, message } = useModal();
const { const {
isShow: isShowUnsavedChanges, isShow: isShowUnsavedChanges,
@ -1708,7 +1708,8 @@ function App() {
showTutorial, showTutorial,
openTutorialModal, openTutorialModal,
setOpenTutorialModal, setOpenTutorialModal,
downloadResource downloadResource,
hasSeenGettingStarted
}}> }}>
<Tutorials /> <Tutorials />
{extState === "not-authenticated" && ( {extState === "not-authenticated" && (
@ -2277,8 +2278,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
@ -2340,8 +2340,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
@ -2437,8 +2436,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
@ -2539,8 +2537,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
@ -2640,14 +2637,14 @@ 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
sx={{ sx={{
textAlign: "center", textAlign: "center",
lineHeight: "15px", lineHeight: 1.2,
fontSize: '18px'
}} }}
> >
Set up your Qortal account Set up your Qortal account
@ -2686,7 +2683,7 @@ function App() {
If you wish to VIEW THE SEEDPHRASE, click the word 'SEEDPHRASE' in this text. Seedphrases are used to generate the private key for your Qortal account. For security by default, seedphrases are NOT displayed unless specifically chosen. If you wish to VIEW THE SEEDPHRASE, click the word 'SEEDPHRASE' in this text. Seedphrases are used to generate the private key for your Qortal account. For security by default, seedphrases are NOT displayed unless specifically chosen.
</Typography> </Typography>
<Typography sx={{ <Typography sx={{
fontSize: '16px', fontSize: '18px',
marginTop: '15px', marginTop: '15px',
textAlign: 'center' textAlign: 'center'

View File

@ -12,8 +12,8 @@ import {
DialogTitle, DialogTitle,
FormControlLabel, FormControlLabel,
Input, Input,
styled,
Switch, Switch,
Tooltip,
Typography, Typography,
} from "@mui/material"; } from "@mui/material";
import Logo1 from "../assets/svgs/Logo1.svg"; import Logo1 from "../assets/svgs/Logo1.svg";
@ -24,12 +24,24 @@ import { CustomizedSnackbars } from "../components/Snackbar/Snackbar";
import { set } from "lodash"; import { set } from "lodash";
import { cleanUrl, gateways, isUsingLocal } from "../background"; import { cleanUrl, gateways, isUsingLocal } from "../background";
import { GlobalContext } from "../App"; import { GlobalContext } from "../App";
import Tooltip, { TooltipProps, tooltipClasses } from '@mui/material/Tooltip';
const manifestData = { const manifestData = {
version: "0.5.1", version: "0.5.1",
}; };
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),
},
}));
function removeTrailingSlash(url) { function removeTrailingSlash(url) {
return url.replace(/\/+$/, ''); return url.replace(/\/+$/, '');
} }
@ -66,7 +78,7 @@ export const NotAuthenticated = ({
const [customApikey, setCustomApiKey] = React.useState(""); const [customApikey, setCustomApiKey] = React.useState("");
const [customNodeToSaveIndex, setCustomNodeToSaveIndex] = const [customNodeToSaveIndex, setCustomNodeToSaveIndex] =
React.useState(null); React.useState(null);
const { showTutorial } = useContext(GlobalContext); const { showTutorial, hasSeenGettingStarted } = useContext(GlobalContext);
const importedApiKeyRef = useRef(null); const importedApiKeyRef = useRef(null);
const currentNodeRef = useRef(null); const currentNodeRef = useRef(null);
@ -354,18 +366,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" />
@ -375,11 +391,23 @@ 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')}>
{/* <input {...getInputProps()} /> */} {/* <input {...getInputProps()} /> */}
Wallets Wallets
</CustomButton> </CustomButton>
</HtmlTooltip>
{/* <Tooltip title="Authenticate by importing your Qortal JSON file" arrow> {/* <Tooltip title="Authenticate by importing your Qortal JSON file" arrow>
<img src={Info} /> <img src={Info} />
</Tooltip> */} </Tooltip> */}
@ -391,16 +419,41 @@ export const NotAuthenticated = ({
display: "flex", display: "flex",
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" />
@ -421,9 +474,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",
@ -434,6 +493,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 } from "./constants/decryptWallet"; import { crypto } from "./constants/decryptWallet";
import { LoadingButton } from "@mui/lab"; import { LoadingButton } from "@mui/lab";
import { PasswordField } from "./components"; import { PasswordField } from "./components";
import { HtmlTooltip } from "./ExtStates/NotAuthenticated";
import { GlobalContext } from "./App";
const parsefilenameQortal = (filename)=> { const parsefilenameQortal = (filename)=> {
return filename.startsWith("qortal_backup_") ? filename.slice(14) : filename; return filename.startsWith("qortal_backup_") ? filename.slice(14) : filename;
@ -30,6 +32,7 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => {
const [seedValue, setSeedValue] = useState(""); const [seedValue, setSeedValue] = useState("");
const [seedName, setSeedName] = useState(""); const [seedName, setSeedName] = useState("");
const [seedError, setSeedError] = useState(""); const [seedError, setSeedError] = useState("");
const { hasSeenGettingStarted } = useContext(GlobalContext);
const [password, setPassword] = useState(""); const [password, setPassword] = useState("");
const [isOpenSeedModal, setIsOpenSeedModal] = useState(false); const [isOpenSeedModal, setIsOpenSeedModal] = useState(false);
@ -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

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

View File

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