-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Description --- Adds improvements to the taribot component and messages depending on the states of the miners / base node. Fixed a bug that caused the settings dialog to rerender while mining is on. Various other small ui improvements. Motivation and Context --- Taribot & ui improvements How Has This Been Tested? --- Manually
- Loading branch information
Showing
29 changed files
with
533 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
ui/frontend/src/containers/BaseNodeContainer/BaseNodeHelp/BaseNodeHelp.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { useEffect, useState } from 'react'; | ||
import { Typography } from '@mui/material'; | ||
import SvgStar from '../../../styles/Icons/Star'; | ||
import typography from '../../../styles/styles/typography'; | ||
import { useTheme } from '@mui/material/styles'; | ||
import t from '../../../locales'; | ||
import { BaseNodeHelpMessage } from './Messages'; | ||
import { HelpTextBox } from '../styles'; | ||
import useAppStateStore from '../../../store/appStateStore'; | ||
import { BaseNodeStatus } from '../../../store/types'; | ||
|
||
function BaseNodeHelp() { | ||
const theme = useTheme(); | ||
const [message, setMessage] = useState<string>(''); | ||
const { containers } = useAppStateStore((state) => ({ | ||
containers: state.containers, | ||
})); | ||
|
||
useEffect(() => { | ||
switch (true) { | ||
case containers.baseNode?.status === BaseNodeStatus.ACTIVE: | ||
setMessage(t.baseNode.helpMessages.alreadyRunning); | ||
break; | ||
default: | ||
setMessage(t.baseNode.helpMessages.howItWorks.tip.text); | ||
break; | ||
} | ||
}, [containers?.baseNode?.status]); | ||
|
||
return ( | ||
<HelpTextBox> | ||
<SvgStar | ||
style={{ | ||
height: '24px', | ||
width: '24px', | ||
marginRight: theme.spacing(1), | ||
}} | ||
/> | ||
<Typography | ||
style={{ marginTop: theme.spacing(0.5) }} | ||
variant="h3" | ||
sx={typography.defaultHeavy} | ||
> | ||
{message}{' '} | ||
<span style={typography.defaultUnder}> | ||
{t.baseNode.helpMessages.howItWorks.tip.cta} | ||
</span> | ||
</Typography> | ||
<BaseNodeHelpMessage /> | ||
</HelpTextBox> | ||
); | ||
} | ||
|
||
export default BaseNodeHelp; |
51 changes: 51 additions & 0 deletions
51
ui/frontend/src/containers/BaseNodeContainer/BaseNodeHelp/Messages.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { MessageBox } from '../../TBotContainer/styles'; | ||
import { useSnackbar } from 'notistack'; | ||
import { Button, Typography, List, ListItem } from '@mui/material'; | ||
import { StyledIconButton } from '../../../components/StyledComponents'; | ||
import SvgQuestion from '../../../styles/Icons/Question'; | ||
import typography from '../../../styles/styles/typography'; | ||
import t from '../../../locales'; | ||
|
||
export const BaseNodeHelpMessage = () => { | ||
const { closeSnackbar, enqueueSnackbar } = useSnackbar(); | ||
const key = 'basenode-start-help'; | ||
const handleClick = () => { | ||
enqueueSnackbar( | ||
<MessageBox> | ||
<Typography sx={typography.defaultMedium}> | ||
{t.baseNode.helpMessages.howItWorks.allowsYou} | ||
</Typography> | ||
<List> | ||
<ListItem> | ||
{t.baseNode.helpMessages.howItWorks.affordances[0]} | ||
</ListItem> | ||
<ListItem> | ||
{t.baseNode.helpMessages.howItWorks.affordances[1]} | ||
</ListItem> | ||
<ListItem> | ||
{t.baseNode.helpMessages.howItWorks.affordances[2]} | ||
</ListItem> | ||
</List> | ||
<Typography sx={typography.defaultMedium}> | ||
<span style={typography.defaultHeavy}> | ||
{t.baseNode.helpMessages.howItWorks.thankYou} | ||
</span>{' '} | ||
{t.baseNode.helpMessages.howItWorks.yourContribution} | ||
</Typography> | ||
<Button variant="contained" onClick={() => closeSnackbar(key)}> | ||
{t.common.phrases.gotIt} | ||
</Button> | ||
</MessageBox>, | ||
{ | ||
key: key, | ||
persist: false, | ||
} | ||
); | ||
}; | ||
|
||
return ( | ||
<StyledIconButton onClick={handleClick}> | ||
<SvgQuestion /> | ||
</StyledIconButton> | ||
); | ||
}; |
88 changes: 9 additions & 79 deletions
88
ui/frontend/src/containers/BaseNodeContainer/BaseNodeTab.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.