mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-23 01:53:16 +00:00

commit a5b63aed93e084fae19d9e444e06238a52f24f3a Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Sun Oct 30 10:46:05 2022 -0700 Small fixes commit d64adfc2bf9b9c31dca47ab113c06a1268c347c6 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Sun Oct 30 06:02:06 2022 -0700 wip work on federation settings commit ca35d6b3d2776812b07109e197d2e1d46f9f4e81 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Sun Oct 30 04:05:33 2022 -0700 Refactor confirmation Dialogs commit c660a5b0d1345d4996efb10cb8999987689bede9 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Sat Oct 29 13:36:59 2022 -0700 refactor login (clean separation robot/info. Style navbar. commit b9dc7f7c95a683e3aca024ec6d7857176b4e3a25 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Fri Oct 28 09:54:38 2022 -0700 Add size slider and settings widget commit 20b2b3dcd6838b129741705f1c65d445271e231d Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Fri Oct 28 05:41:48 2022 -0700 Add show more and Dialogs commit da8b70091b5f28139cdec1a8895f4563d64d8e88 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Thu Oct 27 16:26:07 2022 -0700 Add sliding pages commit 6dd90aa1182a7a5e0f0189d1467ba474b68c28c2 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Thu Oct 27 06:34:58 2022 -0700 Add settings forms commit d3d0f3ee1a52bbf1829714050cc798d2542af8f6 Author: Reckless_Satoshi <reckless.satoshi@protonmail.com> Date: Wed Oct 26 04:16:06 2022 -0700 Refactor utils
129 lines
4.1 KiB
TypeScript
129 lines
4.1 KiB
TypeScript
import React, { useEffect, useState } from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { useTheme, styled, Grid, IconButton } from '@mui/material';
|
|
import Tooltip, { TooltipProps, tooltipClasses } from '@mui/material/Tooltip';
|
|
|
|
import { OpenDialogs } from '../MainDialogs';
|
|
|
|
import { BubbleChart, Info, People, PriceChange, School } from '@mui/icons-material';
|
|
|
|
const StyledTooltip = styled(({ className, ...props }: TooltipProps) => (
|
|
<Tooltip {...props} classes={{ popper: className }} />
|
|
))(({ theme }) => ({
|
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
backgroundColor: theme.palette.background.paper,
|
|
color: theme.palette.text.primary,
|
|
boxShadow: theme.shadows[1],
|
|
fontSize: theme.typography.fontSize,
|
|
borderRadius: '2em',
|
|
},
|
|
}));
|
|
|
|
interface MoreTooltipProps {
|
|
open: OpenDialogs;
|
|
nickname: string | null;
|
|
setOpen: (state: OpenDialogs) => void;
|
|
closeAll: OpenDialogs;
|
|
children: JSX.Element;
|
|
}
|
|
|
|
const MoreTooltip = ({
|
|
open,
|
|
setOpen,
|
|
closeAll,
|
|
nickname,
|
|
children,
|
|
}: MoreTooltipProps): JSX.Element => {
|
|
const { t } = useTranslation();
|
|
const theme = useTheme();
|
|
return (
|
|
<StyledTooltip
|
|
open={open.more}
|
|
title={
|
|
<Grid
|
|
container
|
|
direction='column'
|
|
padding={0}
|
|
sx={{ width: '2em', padding: '0em' }}
|
|
justifyContent='center'
|
|
>
|
|
<Grid item sx={{ position: 'relative', right: '0.4em' }}>
|
|
<Tooltip enterTouchDelay={250} placement='left' title={t('RoboSats information')}>
|
|
<IconButton
|
|
sx={{
|
|
color: open.info ? theme.palette.primary.main : theme.palette.text.secondary,
|
|
}}
|
|
onClick={() => setOpen({ ...closeAll, info: !open.info })}
|
|
>
|
|
<Info />
|
|
</IconButton>
|
|
</Tooltip>
|
|
</Grid>
|
|
|
|
<Grid item sx={{ position: 'relative', right: '0.4em' }}>
|
|
<Tooltip enterTouchDelay={250} placement='left' title={t('Learn RoboSats')}>
|
|
<IconButton
|
|
sx={{
|
|
color: open.learn ? theme.palette.primary.main : theme.palette.text.secondary,
|
|
}}
|
|
onClick={() => setOpen({ ...closeAll, learn: !open.learn })}
|
|
>
|
|
<School />
|
|
</IconButton>
|
|
</Tooltip>
|
|
</Grid>
|
|
|
|
<Grid item sx={{ position: 'relative', right: '0.4em' }}>
|
|
<Tooltip
|
|
enterTouchDelay={250}
|
|
placement='left'
|
|
title={t('Community and public support')}
|
|
>
|
|
<IconButton
|
|
sx={{
|
|
color: open.community ? theme.palette.primary.main : theme.palette.text.secondary,
|
|
}}
|
|
onClick={() => setOpen({ ...closeAll, community: !open.community })}
|
|
>
|
|
<People />
|
|
</IconButton>
|
|
</Tooltip>
|
|
</Grid>
|
|
|
|
<Grid item sx={{ position: 'relative', right: '0.4em' }}>
|
|
<Tooltip enterTouchDelay={250} placement='left' title={t('Coordinator summary')}>
|
|
<IconButton
|
|
sx={{
|
|
color: open.coordinator
|
|
? theme.palette.primary.main
|
|
: theme.palette.text.secondary,
|
|
}}
|
|
onClick={() => setOpen({ ...closeAll, coordinator: !open.coordinator })}
|
|
>
|
|
<PriceChange />
|
|
</IconButton>
|
|
</Tooltip>
|
|
</Grid>
|
|
|
|
<Grid item sx={{ position: 'relative', right: '0.4em' }}>
|
|
<Tooltip enterTouchDelay={250} placement='left' title={t('Stats for nerds')}>
|
|
<IconButton
|
|
sx={{
|
|
color: open.stats ? theme.palette.primary.main : theme.palette.text.secondary,
|
|
}}
|
|
onClick={() => setOpen({ ...closeAll, stats: !open.stats })}
|
|
>
|
|
<BubbleChart />
|
|
</IconButton>
|
|
</Tooltip>
|
|
</Grid>
|
|
</Grid>
|
|
}
|
|
>
|
|
{children}
|
|
</StyledTooltip>
|
|
);
|
|
};
|
|
|
|
export default MoreTooltip;
|