feat(board nav): add home and settings buttons

This commit is contained in:
plebeius.eth
2024-03-20 21:35:53 +01:00
parent d51326848b
commit 9096eca4fb
4 changed files with 30 additions and 13 deletions
@@ -15,6 +15,11 @@
text-decoration: var(--internal-link-text-decoration-hover);
}
.navTopRight {
float: right;
text-transform: capitalize;
}
.boardNavMobile {
padding: 2px 4px;
background-color: var(--boardnav-mobile-background-color);
+23 -11
View File
@@ -1,4 +1,5 @@
import { Link, useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import useDefaultSubplebbits from '../../hooks/use-default-subplebbits';
import styles from './board-nav.module.css';
@@ -9,19 +10,30 @@ interface BoardNavProps {
}
const BoardNavDesktop = ({ subplebbits }: BoardNavProps) => {
const { t } = useTranslation();
return (
<div className={styles.boardNavDesktop}>
[
{subplebbits.map((subplebbit: any, index: number) => (
<span key={subplebbit.address}>
{index === 0 ? null : ' '}
<Link to={`/p/${subplebbit.address}`} title={subplebbit.title || ''}>
{subplebbit.address.includes('.') ? subplebbit.address : subplebbit.title || subplebbit.address.slice(0, 10).concat('...')}
</Link>
{index !== subplebbits.length - 1 ? ' /' : null}
</span>
))}
]
<span className={styles.boardList}>
[
{subplebbits.map((subplebbit: any, index: number) => (
<span key={subplebbit.address}>
{index === 0 ? null : ' '}
<Link to={`/p/${subplebbit.address}`} title={subplebbit.title || ''}>
{subplebbit.address.includes('.') ? subplebbit.address : subplebbit.title || subplebbit.address.slice(0, 10).concat('...')}
</Link>
{index !== subplebbits.length - 1 ? ' /' : null}
</span>
))}
]
</span>
<span className={styles.navTopRight}>
[
<Link to='/settings' onClick={(e) => e.preventDefault()}>
{t('settings')}
</Link>
] [<Link to='/'>{t('home')}</Link>]
</span>
</div>
);
};
+1 -1
View File
@@ -26,7 +26,7 @@ const BoardStats = ({ address, createdAt }: BoardStatsProps) => {
<table className={styles.blotter}>
<hr />
{showStats && (
<tbody id='blotter-msgs'>
<tbody>
<tr>
<td>
<Trans
+1 -1
View File
@@ -1,6 +1,6 @@
.debug {
position: fixed;
top: 20px;
top: 50px;
right: 0;
padding: 0.5em;
}