fix: composition for links and buttons

This commit is contained in:
enes 2024-07-26 16:03:45 +02:00
parent 3c22429941
commit 804bb6c9ac
2 changed files with 43 additions and 50 deletions

View File

@ -1,5 +1,5 @@
import { Box, Button, Container, Link } from '@mui/material'
import { Link as RouterLink } from 'react-router-dom'
import { Box, Button, Container, Link as LinkMui } from '@mui/material'
import { Link } from 'react-router-dom'
import styles from './style.module.scss'
export const Footer = () => (
@ -24,19 +24,19 @@ export const Footer = () => (
}}
gap={'50px'}
>
<Link
<LinkMui
sx={{
justifySelf: {
xs: 'center',
md: 'start'
}
}}
component={RouterLink}
component={Link}
to={'/'}
className={styles.logo}
>
<img src="/logo.svg" alt="Logo" />
</Link>
</LinkMui>
<Box
display={'grid'}
sx={{
@ -58,21 +58,15 @@ export const Footer = () => (
component={'nav'}
className={styles.nav}
>
<RouterLink to={'/'}>
<Button variant={'text'} focusRipple={false}>
Home
</Button>
</RouterLink>
<RouterLink to={'/#'}>
<Button variant={'text'} focusRipple={false}>
Documentation
</Button>
</RouterLink>
<RouterLink to={'/#'}>
<Button variant={'text'} focusRipple={false}>
Source
</Button>
</RouterLink>
<Button component={Link} to={'/'} variant={'text'}>
Home
</Button>
<Button component={Link} to={'/#'} variant={'text'}>
Documentation
</Button>
<Button component={Link} to={'/#'} variant={'text'}>
Source
</Button>
</Box>
<Box
className={styles.links}
@ -83,33 +77,31 @@ export const Footer = () => (
}
}}
>
<Link
<Button
component={LinkMui}
href="https://snort.social/npub1yay8e9sqk94jfgdlkpgeelj2t5ddsj2eu0xwt4kh4xw5ses2rauqnstrdv"
target="_blank"
sx={{
minWidth: '45px',
padding: '10px'
}}
variant={'contained'}
>
<Button
sx={{
minWidth: '45px',
padding: '10px'
}}
variant={'contained'}
>
<img
src="https://image.nostr.build/fb557f1b6d58c7bbcdf4d1edb1b48090c76ff1d1384b9d1aae13d652e7a3cfe4.gif"
width="25"
alt="nostr logo"
height="25"
/>
</Button>
</Link>
<img
src="https://image.nostr.build/fb557f1b6d58c7bbcdf4d1edb1b48090c76ff1d1384b9d1aae13d652e7a3cfe4.gif"
width="25"
alt="nostr logo"
height="25"
/>
</Button>
</Box>
</Box>
</Container>
<div className={`${styles.borderTop} ${styles.credits}`}>
Built by&nbsp;
<Link href="https://nostrdev.com/" target="_blank">
<LinkMui href="https://nostrdev.com/" target="_blank">
Nostr Dev
</Link>{' '}
</LinkMui>{' '}
2024.
</div>
</footer>

View File

@ -45,23 +45,24 @@ export const Modal = () => {
>
<Box className={styles.modal}>
<Typography id="modal-title" variant="h2">
Login
{tabs.find((t) => activeTab === t.to)?.title}
</Typography>
<Box component={'ul'}>
{tabs.map((t) => {
return (
<Link to={t.to} key={t.to}>
<Button
variant={
activeTab === t.to || t.to === appPublicRoutes.nostr
? 'contained'
: 'text'
}
>
{t.label}
</Button>
</Link>
<Button
component={Link}
to={t.to}
key={t.to}
variant={
activeTab === t.to || t.to === appPublicRoutes.nostr
? 'contained'
: 'text'
}
>
{t.label}
</Button>
)
})}
</Box>