diff --git a/frontend/src/basic/Main.tsx b/frontend/src/basic/Main.tsx
index c48cf9eb..223b324f 100644
--- a/frontend/src/basic/Main.tsx
+++ b/frontend/src/basic/Main.tsx
@@ -18,18 +18,6 @@ import { GarageContext, type UseGarageStoreType } from '../contexts/GarageContex
const Router = window.NativeRobosats === undefined ? BrowserRouter : MemoryRouter;
-const MainContent = styled(Box)(({ theme }) => ({
- marginTop: '100px',
- marginBottom: '80px',
- padding: theme.spacing(2),
- overflowY: 'auto',
- overflowX: 'hidden',
- height: 'calc(100vh - 180px)',
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
-}));
-
const Main: React.FC = () => {
const { t } = useTranslation();
const { settings, page, slideDirection, setOpen, windowSize } =
@@ -130,4 +118,19 @@ const Main: React.FC = () => {
);
};
+// Styled components
+const MainContent = styled(Box)(({ theme }) => ({
+ marginTop: '100px',
+ marginBottom: '80px',
+ padding: theme.spacing(2),
+ overflowY: 'auto',
+ overflowX: 'hidden',
+ height: 'calc(100vh - 180px)',
+ display: 'flex',
+ justifyContent: 'center',
+ alignItems: 'center',
+}));
+
export default Main;
+
+
diff --git a/frontend/src/basic/NavBar/NavBar.tsx b/frontend/src/basic/NavBar/NavBar.tsx
index c153bf31..1bd7027f 100644
--- a/frontend/src/basic/NavBar/NavBar.tsx
+++ b/frontend/src/basic/NavBar/NavBar.tsx
@@ -5,9 +5,9 @@ import {
BottomNavigation,
BottomNavigationAction,
Paper,
- styled,
useTheme,
useMediaQuery,
+ styled,
} from '@mui/material';
import SmartToyOutlinedIcon from '@mui/icons-material/SmartToyOutlined';
import StorefrontOutlinedIcon from '@mui/icons-material/StorefrontOutlined';
@@ -20,24 +20,6 @@ import { GarageContext, type UseGarageStoreType } from '../../contexts/GarageCon
import { FederationContext, type UseFederationStoreType } from '../../contexts/FederationContext';
import { type Page, isPage } from '.';
-const StyledBottomNavigation = styled(BottomNavigation)(({ theme }) => ({
- width: '100%',
- maxWidth: '100%',
- padding: theme.spacing(0.5, 0),
- borderRadius: 'inherit',
-}));
-
-const StyledBottomNavigationAction = styled(BottomNavigationAction)(({ theme }) => ({
- minWidth: 'auto',
- padding: theme.spacing(0.5, 0),
- '& .MuiBottomNavigationAction-label': {
- fontSize: '0.75rem',
- },
- '& .MuiSvgIcon-root': {
- fontSize: '1.5rem',
- },
-}));
-
const NavBar = (): JSX.Element => {
const { t } = useTranslation();
const theme = useTheme();
@@ -103,35 +85,7 @@ const NavBar = (): JSX.Element => {
}, [page, setOpen]);
return (
-
+
{
icon={}
/>
-
+
);
};
-export default NavBar;
+// Styled components
+const StyledPaper = styled(Paper)<{ $isMobile: boolean }>(({ theme, $isMobile }) => ({
+ position: 'fixed',
+ bottom: 0,
+ left: 0,
+ right: 0,
+ zIndex: 1000,
+ ...($isMobile
+ ? {
+ boxShadow: 'none',
+ backgroundColor: theme.palette.background.paper,
+ borderTop: `2px solid black`,
+ borderRadius: '0',
+ }
+ : {
+ bottom: theme.spacing(2),
+ left: '50%',
+ transform: 'translateX(-50%)',
+ width: '95%',
+ maxWidth: 600,
+ borderRadius: '8px',
+ boxShadow: '8px 8px 0px 0px rgba(0,0,0,1)',
+ border: `2px solid black`,
+ backgroundColor: theme.palette.background.paper,
+ overflow: 'hidden',
+ }),
+}));
+
+const StyledBottomNavigation = styled(BottomNavigation)(({ theme }) => ({
+ width: '100%',
+ maxWidth: '100%',
+ padding: theme.spacing(0.5, 0),
+ borderRadius: 'inherit',
+}));
+
+const StyledBottomNavigationAction = styled(BottomNavigationAction)(({ theme }) => ({
+ minWidth: 'auto',
+ padding: theme.spacing(0.5, 0),
+ '& .MuiBottomNavigationAction-label': {
+ fontSize: '0.75rem',
+ },
+ '& .MuiSvgIcon-root': {
+ fontSize: '1.5rem',
+ },
+}));
+
+export default NavBar;
\ No newline at end of file
diff --git a/frontend/src/basic/RobotPage/Onboarding.tsx b/frontend/src/basic/RobotPage/Onboarding.tsx
index f0e209dd..e6c565c8 100644
--- a/frontend/src/basic/RobotPage/Onboarding.tsx
+++ b/frontend/src/basic/RobotPage/Onboarding.tsx
@@ -37,91 +37,12 @@ import { genBase62Token } from '../../utils';
import { AppContext, type UseAppStoreType } from '../../contexts/AppContext';
import { GarageContext, type UseGarageStoreType } from '../../contexts/GarageContext';
-const StyledPaper = styled(Paper)(({ theme }) => ({
- backgroundColor: theme.palette.background.paper,
- boxShadow: '8px 8px 0px 0px rgba(0, 0, 0, 0.2)',
- borderRadius: '16px',
- border: '2px solid #000',
- padding: theme.spacing(2),
- color: theme.palette.text.primary,
- width: '100%',
- maxWidth: '500px',
- margin: '0 auto',
-}));
-
-const StyledButton = styled(Button)(({ theme }) => ({
- justifyContent: 'center',
- textAlign: 'center',
- padding: theme.spacing(1),
- borderRadius: '8px',
- border: '2px solid #000',
- boxShadow: '4px 4px 0px 0px rgba(0, 0, 0, 0.2)',
- textTransform: 'none',
- fontWeight: 'bold',
- width: '100%',
- '&:hover': {
- boxShadow: '6px 6px 0px 0px rgba(0, 0, 0, 0.3)',
- },
-}));
-
-const StyledStepConnector = styled(StepConnector)(({ theme }) => ({
- [`&.${stepConnectorClasses.alternativeLabel}`]: {
- top: 22,
- left: 'calc(-50% + 20px)',
- right: 'calc(50% + 20px)',
- },
- [`&.${stepConnectorClasses.active}`]: {
- [`& .${stepConnectorClasses.line}`]: {
- borderColor: theme.palette.primary.main,
- },
- },
- [`&.${stepConnectorClasses.completed}`]: {
- [`& .${stepConnectorClasses.line}`]: {
- borderColor: theme.palette.primary.main,
- },
- },
- [`& .${stepConnectorClasses.line}`]: {
- borderColor: theme.palette.mode === 'dark' ? theme.palette.grey[800] : '#eaeaf0',
- borderTopWidth: 3,
- borderRadius: 1,
- },
-}));
-
-const StyledStepIconRoot = styled('div')<{ ownerState: { active?: boolean; completed?: boolean } }>(
- ({ theme, ownerState }) => ({
- backgroundColor: theme.palette.mode === 'dark' ? theme.palette.grey[700] : '#ccc',
- zIndex: 1,
- color: '#fff',
- width: 44,
- height: 44,
- display: 'flex',
- borderRadius: '50%',
- justifyContent: 'center',
- alignItems: 'center',
- ...(ownerState.active && {
- backgroundColor: theme.palette.primary.main,
- boxShadow: '0 4px 10px 0 rgba(0,0,0,.25)',
- }),
- ...(ownerState.completed && {
- backgroundColor: theme.palette.primary.main,
- }),
- }),
-);
-
-function StyledStepIcon(props: StepIconProps) {
- const { active, completed, className } = props;
-
- const icons: { [index: string]: React.ReactElement } = {
- 1: ,
- 2: ,
- 3: ,
- };
-
- return (
-
- {icons[String(props.icon)]}
-
- );
+interface OnboardingProps {
+ setView: (view: string) => void;
+ inputToken: string;
+ setInputToken: (token: string) => void;
+ badToken: boolean;
+ getGenerateRobot: (token: string) => void;
}
const Onboarding = ({
@@ -161,17 +82,7 @@ const Onboarding = ({
];
return (
-
+
{!slot?.hashId && }
-
+
+
+
{slot?.nickname && (
<>
@@ -293,11 +199,11 @@ const Onboarding = ({
{t('Hi! My name is')}
-
+
{slot.nickname}
-
+
>
)}
@@ -315,7 +221,6 @@ const Onboarding = ({
>
)}
-
{step === '3' && (
<>
@@ -382,8 +287,122 @@ const Onboarding = ({
>
)}
-
+
);
};
+// Styled components
+const StyledPaper = styled(Paper)(({ theme }) => ({
+ backgroundColor: theme.palette.background.paper,
+ boxShadow: '8px 8px 0px 0px rgba(0, 0, 0, 0.2)',
+ borderRadius: '16px',
+ border: '2px solid #000',
+ padding: theme.spacing(2),
+ color: theme.palette.text.primary,
+ width: '100%',
+ maxWidth: '500px',
+ margin: '0 auto',
+}));
+
+const StyledButton = styled(Button)(({ theme }) => ({
+ justifyContent: 'center',
+ textAlign: 'center',
+ padding: theme.spacing(1),
+ borderRadius: '8px',
+ border: '2px solid #000',
+ boxShadow: '4px 4px 0px 0px rgba(0, 0, 0, 0.2)',
+ textTransform: 'none',
+ fontWeight: 'bold',
+ width: '100%',
+ '&:hover': {
+ boxShadow: '6px 6px 0px 0px rgba(0, 0, 0, 0.3)',
+ },
+}));
+
+const OnboardingContainer = styled(Box)(({ theme }) => ({
+ marginTop: theme.spacing(3),
+ marginBottom: theme.spacing(3),
+ display: 'flex',
+ flexDirection: 'column',
+ alignItems: 'center',
+ paddingLeft: theme.spacing(2),
+ paddingRight: theme.spacing(2),
+ width: '100%',
+}));
+
+const RobotAvatarContainer = styled(Box)(({ theme }) => ({
+ width: '150px',
+ height: '150px',
+ border: '2px solid #555',
+ borderRadius: '50%',
+ boxShadow: '0 4px 10px rgba(0,0,0,0.3)',
+}));
+
+const NicknameContainer = styled(Box)(({ theme }) => ({
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+}));
+
+const StyledStepConnector = styled(StepConnector)(({ theme }) => ({
+ [`&.${stepConnectorClasses.alternativeLabel}`]: {
+ top: 22,
+ left: 'calc(-50% + 20px)',
+ right: 'calc(50% + 20px)',
+ },
+ [`&.${stepConnectorClasses.active}`]: {
+ [`& .${stepConnectorClasses.line}`]: {
+ borderColor: theme.palette.primary.main,
+ },
+ },
+ [`&.${stepConnectorClasses.completed}`]: {
+ [`& .${stepConnectorClasses.line}`]: {
+ borderColor: theme.palette.primary.main,
+ },
+ },
+ [`& .${stepConnectorClasses.line}`]: {
+ borderColor: theme.palette.mode === 'dark' ? theme.palette.grey[800] : '#eaeaf0',
+ borderTopWidth: 3,
+ borderRadius: 1,
+ },
+}));
+
+const StyledStepIconRoot = styled('div')<{ ownerState: { active?: boolean; completed?: boolean } }>(
+ ({ theme, ownerState }) => ({
+ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.grey[700] : '#ccc',
+ zIndex: 1,
+ color: '#fff',
+ width: 44,
+ height: 44,
+ display: 'flex',
+ borderRadius: '50%',
+ justifyContent: 'center',
+ alignItems: 'center',
+ ...(ownerState.active && {
+ backgroundColor: theme.palette.primary.main,
+ boxShadow: '0 4px 10px 0 rgba(0,0,0,.25)',
+ }),
+ ...(ownerState.completed && {
+ backgroundColor: theme.palette.primary.main,
+ }),
+ }),
+);
+
+function StyledStepIcon(props: StepIconProps) {
+ const { active, completed, className } = props;
+
+ const icons: { [index: string]: React.ReactElement } = {
+ 1: ,
+ 2: ,
+ 3: ,
+ };
+
+ return (
+
+ {icons[String(props.icon)]}
+
+ );
+}
+
export default Onboarding;
+
diff --git a/frontend/src/basic/RobotPage/Welcome.tsx b/frontend/src/basic/RobotPage/Welcome.tsx
index 948664bf..541598e3 100644
--- a/frontend/src/basic/RobotPage/Welcome.tsx
+++ b/frontend/src/basic/RobotPage/Welcome.tsx
@@ -27,140 +27,67 @@ const Welcome = ({ setView, getGenerateRobot, width }: WelcomeProps): JSX.Elemen
shadow: theme.palette.mode === 'dark' ? '#ffffff' : '#000000',
};
- const StyledButton = styled(Button)(({ theme }) => ({
- justifyContent: 'space-between',
- textAlign: 'left',
- padding: theme.spacing(2),
- height: '100%',
- borderRadius: 0,
- border: `2px solid ${theme.palette.mode === 'dark' ? '#ffffff' : '#000000'}`,
- boxShadow: `8px 8px 0px 0px ${COLORS.shadow}`,
- '&:not(:last-child)': {
- borderBottom: 'none',
- },
- '&:hover': {
- boxShadow: `12px 12px 0px 0px ${COLORS.shadow}`,
- },
- }));
-
return (
-
-
+
+
-
-
-
+
+
+
A Simple and Private ⚡ Lightning P2P Exchange
-
-
+
+
}
- onClick={() => {
- setView('onboarding');
- }}
+ onClick={() => setView('onboarding')}
>
-
+
Create a new robot and
learn to use RoboSats.
Start
-
+
}
- onClick={() => {
- setView('recovery');
- }}
+ onClick={() => setView('recovery')}
>
-
+
Recover an existing
Robot using your token.
Recover
-
+
{
setView('profile');
getGenerateRobot(genBase62Token(36));
@@ -170,9 +97,93 @@ const Welcome = ({ setView, getGenerateRobot, width }: WelcomeProps): JSX.Elemen
▶ Fast Generate Robot
-
-
+
+
);
};
-export default Welcome;
+// Styled components
+const WelcomeContainer = styled(Box)(({ theme }) => ({
+ width: '100%',
+ maxWidth: 800,
+ margin: '0 auto',
+ display: 'flex',
+ flexDirection: 'column',
+ marginBottom: theme.spacing(8),
+ [theme.breakpoints.up('md')]: {
+ flexDirection: 'row',
+ },
+}));
+
+const LogoSection = styled(Box)<{ colors: typeof COLORS }>(({ theme, colors }) => ({
+ flexGrow: 1,
+ flexBasis: 0,
+ backgroundColor: colors.background,
+ border: `2px solid ${colors.textPrimary}`,
+ borderRight: 'none',
+ borderRadius: '8px 8px 0 0',
+ boxShadow: `8px 8px 0px 0px ${colors.shadow}`,
+ display: 'flex',
+ flexDirection: 'column',
+ justifyContent: 'center',
+ alignItems: 'center',
+ padding: theme.spacing(4),
+ [theme.breakpoints.up('md')]: {
+ borderRadius: '8px 0 0 8px',
+ },
+}));
+
+const LogoBox = styled(Box)({
+ width: '80%',
+ maxWidth: '400px',
+ height: 'auto',
+});
+
+const StyledRoboSatsTextIcon = styled(RoboSatsTextIcon)({
+ fill: 'url(#linearColors)',
+ width: '100%',
+ height: 'auto',
+});
+
+const ButtonsSection = styled(Box)(({ theme }) => ({
+ flexGrow: 1,
+ flexBasis: 0,
+ display: 'flex',
+ flexDirection: 'column',
+ backgroundColor: 'transparent',
+}));
+
+const StyledButton = styled(Button)<{
+ $buttonColor: string;
+ $textColor: string;
+ $shadowColor: string;
+ $borderRadius: { xs: string; md: string };
+}>(({ theme, $buttonColor, $textColor, $shadowColor, $borderRadius }) => ({
+ justifyContent: 'space-between',
+ textAlign: 'left',
+ padding: theme.spacing(2),
+ height: '100%',
+ borderRadius: 0,
+ border: `2px solid ${theme.palette.mode === 'dark' ? '#ffffff' : '#000000'}`,
+ boxShadow: `8px 8px 0px 0px ${$shadowColor}`,
+ '&:not(:last-child)': {
+ borderBottom: 'none',
+ },
+ '&:hover': {
+ backgroundColor: $buttonColor,
+ boxShadow: `12px 12px 0px 0px ${$shadowColor}`,
+ },
+ backgroundColor: $buttonColor,
+ color: $textColor,
+ borderRadius: $borderRadius.xs,
+ [theme.breakpoints.up('md')]: {
+ borderRadius: $borderRadius.md,
+ },
+}));
+
+const ButtonContent = styled(Box)({
+ display: 'flex',
+ flexDirection: 'column',
+});
+
+export default Welcome;
\ No newline at end of file
diff --git a/frontend/src/basic/RobotPage/index.tsx b/frontend/src/basic/RobotPage/index.tsx
index 9bd1f64d..5015c849 100644
--- a/frontend/src/basic/RobotPage/index.tsx
+++ b/frontend/src/basic/RobotPage/index.tsx
@@ -9,6 +9,7 @@ import {
Typography,
useTheme,
AlertTitle,
+ styled,
} from '@mui/material';
import { useParams } from 'react-router-dom';
@@ -85,12 +86,7 @@ const RobotPage = (): JSX.Element => {
if (settings.useProxy && !(window.NativeRobosats === undefined) && !(torStatus === 'ON')) {
return (
-
+
@@ -105,8 +101,8 @@ const RobotPage = (): JSX.Element => {
-
-
+
+
{
left: '0.7em',
}}
/>
-
+
@@ -128,39 +124,17 @@ const RobotPage = (): JSX.Element => {
-
+
);
} else {
return (
-
-
- {view === 'welcome' ? (
+
+
+ {view === 'welcome' && (
- ) : null}
+ )}
- {view === 'onboarding' ? (
+ {view === 'onboarding' && (
{
setInputToken={setInputToken}
getGenerateRobot={getGenerateRobot}
/>
- ) : null}
+ )}
- {view === 'profile' ? (
+ {view === 'profile' && (
{
setInputToken={setInputToken}
getGenerateRobot={getGenerateRobot}
/>
- ) : null}
+ )}
- {view === 'recovery' ? (
+ {view === 'recovery' && (
{
setInputToken={setInputToken}
getRecoverRobot={getGenerateRobot}
/>
- ) : null}
-
-
+ )}
+
+
);
}
};
+// Styled components
+const StyledConnectingBox = styled(Box)({
+ width: '100vw',
+ height: 'auto',
+});
+
+const StyledTorIconBox = styled(Box)({
+ position: 'fixed',
+ top: '4.6em',
+});
+
+const StyledMainBox = styled(Box)({
+ width: '100vw',
+ height: 'auto',
+ display: 'flex',
+ justifyContent: 'center',
+ alignItems: 'center',
+ padding: '2em',
+});
+
+const StyledPaper = styled(Paper)(({ theme }) => ({
+ width: '80vw',
+ maxWidth: '1200px',
+ maxHeight: '85vh',
+ overflow: 'auto',
+ overflowX: 'clip',
+ backgroundColor: 'transparent',
+ border: 'none',
+ boxShadow: 'none',
+ padding: '1em',
+}));
+
export default RobotPage;
diff --git a/frontend/src/basic/TopNavBar/TopNavBar.tsx b/frontend/src/basic/TopNavBar/TopNavBar.tsx
index abe0fdd4..de41ac63 100644
--- a/frontend/src/basic/TopNavBar/TopNavBar.tsx
+++ b/frontend/src/basic/TopNavBar/TopNavBar.tsx
@@ -23,30 +23,166 @@ import RobotAvatar from '../../components/RobotAvatar';
import { RoboSatsTextIcon } from '../../components/Icons';
import { useTranslation } from 'react-i18next';
+
+const TopNavBar = (): JSX.Element => {
+ const theme = useTheme();
+ const { t } = useTranslation();
+ const { setOpen, open } = useContext(AppContext);
+ const { garage } = useContext(GarageContext);
+ const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
+
+ const [drawerOpen, setDrawerOpen] = useState(false);
+
+ const slot = garage.getSlot();
+
+ const navItems = [
+ { label: 'Robosats Info', key: 'info' },
+ { label: 'Learn Robosats', key: 'learn' },
+ { label: 'Community', key: 'community' },
+ { label: 'Exchange Summary', key: 'exchange' },
+ ];
+
+ const toggleDrawer = (open: boolean) => () => {
+ setDrawerOpen(open);
+ };
+
+ const handleLogoClick = () => {
+ setOpen({ ...closeAll, client: !open.client });
+ };
+
+ return (
+ <>
+
+
+
+ {isMobile ? (
+ <>
+
+ {drawerOpen ? (
+
+ ) : (
+
+ )}
+
+
+ {
+ setOpen({ ...closeAll, profile: !open.profile });
+ }}
+ style={{ visibility: slot?.hashId ? 'visible' : 'hidden' }}
+ >
+ {slot?.hashId ? (
+
+ ) : (
+
+ )}
+
+
+
+
+
+
+
+
+ {navItems.map((item) => (
+ setOpen({ ...closeAll, [item.key]: !open[item.key] })}
+ >
+
+
+ ))}
+
+
+ >
+ ) : (
+ <>
+
+
+ {navItems.map((item) => (
+ setOpen({ ...closeAll, [item.key]: !open[item.key] })}
+ >
+ {t(item.label)}
+
+ ))}
+
+ {
+ setOpen({ ...closeAll, profile: !open.profile });
+ }}
+ style={{ visibility: slot?.hashId ? 'visible' : 'hidden' }}
+ >
+ {slot?.hashId ? (
+
+ ) : (
+
+ )}
+
+ >
+ )}
+
+
+ >
+ );
+};
+
+// Styled components
const NAVBAR_HEIGHT = '64px';
-const StyledAppBar = styled(AppBar)(({ theme, isMobile, drawerOpen }) => ({
- height: NAVBAR_HEIGHT,
- display: 'flex',
- justifyContent: 'center',
- boxShadow: isMobile ? 'none' : '8px 8px 0px 0px rgba(0,0,0,1)',
- backgroundColor: theme.palette.background.paper,
- borderBottom: isMobile ? `2px solid ${theme.palette.mode === 'dark' ? '#fff' : '#000'}` : '',
- border: !isMobile ? `2px solid ${theme.palette.mode === 'dark' ? '#fff' : '#000'}` : '',
- borderRadius: isMobile ? '0' : '1vw',
- padding: isMobile ? '0' : '1vh',
- top: isMobile ? 0 : theme.spacing(2),
- left: '50%',
- transform: 'translateX(-50%)',
- width: isMobile ? '100%' : 'calc(100% - 64px)',
- position: 'fixed',
- zIndex: 1100,
- ...(drawerOpen &&
- isMobile && {
- background: 'none',
- backgroundColor: theme.palette.background.paper,
- }),
-}));
+const StyledAppBar = styled(AppBar)<{ $isMobile: boolean; $drawerOpen: boolean }>(
+ ({ theme, $isMobile, $drawerOpen }) => ({
+ height: NAVBAR_HEIGHT,
+ display: 'flex',
+ justifyContent: 'center',
+ boxShadow: $isMobile ? 'none' : '8px 8px 0px 0px rgba(0,0,0,1)',
+ backgroundColor: theme.palette.background.paper,
+ borderBottom: $isMobile ? `2px solid ${theme.palette.mode === 'dark' ? '#fff' : '#000'}` : '',
+ border: !$isMobile ? `2px solid ${theme.palette.mode === 'dark' ? '#fff' : '#000'}` : '',
+ borderRadius: $isMobile ? '0' : '1vw',
+ padding: $isMobile ? '0' : '1vh',
+ top: $isMobile ? 0 : theme.spacing(2),
+ left: '50%',
+ transform: 'translateX(-50%)',
+ width: $isMobile ? '100%' : 'calc(100% - 64px)',
+ position: 'fixed',
+ zIndex: 1100,
+ ...($drawerOpen &&
+ $isMobile && {
+ background: 'none',
+ backgroundColor: theme.palette.background.paper,
+ }),
+ })
+);
const StyledToolbar = styled(Toolbar)(({ theme }) => ({
display: 'flex',
@@ -81,170 +217,54 @@ const MobileToolbarContent = styled(Box)(({ theme }) => ({
marginLeft: theme.spacing(2),
}));
-const TopNavBar = (): JSX.Element => {
- const theme = useTheme();
- const { t } = useTranslation();
- const { setOpen, open } = useContext(AppContext);
- const { garage } = useContext(GarageContext);
- const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
+const StyledIcon = styled('svg')<{ $isDark: boolean }>(({ $isDark }) => ({
+ color: $isDark ? '#fff' : '#000',
+}));
- const [drawerOpen, setDrawerOpen] = useState(false);
+const StyledRobotAvatar = styled(RobotAvatar)({
+ width: '2.5em',
+ height: '2.5em',
+});
- const slot = garage.getSlot();
+const StyledAccountIcon = styled(AccountCircleIcon)({
+ fontSize: '1.5em',
+});
- const navItems = [
- { label: 'Robosats Info', key: 'info' },
- { label: 'Learn Robosats', key: 'learn' },
- { label: 'Community', key: 'community' },
- { label: 'Exchange Summary', key: 'exchange' },
- ];
+const StyledDrawer = styled(Drawer)(({ theme }) => ({
+ '& .MuiDrawer-paper': {
+ marginTop: NAVBAR_HEIGHT,
+ borderLeft: '2px solid black',
+ borderRight: '2px solid black',
+ borderBottom: '2px solid black',
+ width: '100%',
+ maxWidth: '300px',
+ },
+}));
- const toggleDrawer = (open: boolean) => () => {
- setDrawerOpen(open);
- };
+const StyledListItem = styled(ListItem)(({ theme }) => ({
+ borderBottom: `1px solid ${theme.palette.divider}`,
+ padding: theme.spacing(2),
+}));
- const handleLogoClick = () => {
- setOpen({ ...closeAll, client: !open.client });
- };
+const StyledLogoListItem = styled(ListItem)(({ theme }) => ({
+ borderBottom: `1px solid ${theme.palette.divider}`,
+ padding: theme.spacing(2),
+ justifyContent: 'center',
+}));
- return (
- <>
-
-
-
- {isMobile ? (
- <>
-
- {drawerOpen ? (
-
- ) : (
-
- )}
-
-
- {
- setOpen({ ...closeAll, profile: !open.profile });
- }}
- style={{ visibility: slot?.hashId ? 'visible' : 'hidden' }}
- >
- {slot?.hashId ? (
-
- ) : (
-
- )}
-
-
-
-
-
-
-
-
- {navItems.map((item) => (
- setOpen({ ...closeAll, [item.key]: !open[item.key] })}
- sx={{
- borderBottom: `1px solid ${theme.palette.divider}`,
- padding: theme.spacing(2),
- }}
- >
-
-
- ))}
-
-
- >
- ) : (
- <>
-
-
- {navItems.map((item) => (
- setOpen({ ...closeAll, [item.key]: !open[item.key] })}
- >
- {t(item.label)}
-
- ))}
-
- {
- setOpen({ ...closeAll, profile: !open.profile });
- }}
- style={{ visibility: slot?.hashId ? 'visible' : 'hidden' }}
- >
- {slot?.hashId ? (
-
- ) : (
-
- )}
-
- >
- )}
-
-
- >
- );
-};
+const StyledDesktopRoboSatsTextIcon = styled(RoboSatsTextIcon)(({ theme }) => ({
+ height: '1.5em',
+ width: 'auto',
+ cursor: 'pointer',
+ marginLeft: theme.spacing(-1),
+ fill: 'url(#linearColors)',
+}));
-export default TopNavBar;
+const StyledDrawerRoboSatsTextIcon = styled(RoboSatsTextIcon)(({ theme }) => ({
+ height: '2em',
+ width: 'auto',
+ cursor: 'pointer',
+ fill: 'url(#linearColors)',
+}));
+
+export default TopNavBar;
\ No newline at end of file