mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix bugs
This commit is contained in:
@@ -17,10 +17,22 @@ interface BoardButtonsProps {
|
||||
|
||||
const CatalogButton = ({ address, isInAllView, isInSubscriptionsView }: BoardButtonsProps) => {
|
||||
const { t } = useTranslation();
|
||||
const link = isInAllView ? `/p/all/catalog` : isInSubscriptionsView ? `/p/subscriptions/catalog` : `/p/${address}/catalog`;
|
||||
const params = useParams();
|
||||
|
||||
const createCatalogLink = () => {
|
||||
if (isInAllView) {
|
||||
if (params?.timeFilterName) return `/p/all/catalog/${params.timeFilterName}`;
|
||||
return `/p/all/catalog`;
|
||||
} else if (isInSubscriptionsView) {
|
||||
if (params?.timeFilterName) return `/p/subscriptions/catalog/${params.timeFilterName}`;
|
||||
return `/p/subscriptions/catalog`;
|
||||
}
|
||||
return `/p/${address}/catalog`;
|
||||
};
|
||||
|
||||
return (
|
||||
<button className='button'>
|
||||
<Link to={link}>{t('catalog')}</Link>
|
||||
<Link to={createCatalogLink()}>{t('catalog')}</Link>
|
||||
</button>
|
||||
);
|
||||
};
|
||||
@@ -38,10 +50,22 @@ const SubscribeButton = ({ address }: BoardButtonsProps) => {
|
||||
|
||||
const ReturnButton = ({ address, isInAllView, isInSubscriptionsView }: BoardButtonsProps) => {
|
||||
const { t } = useTranslation();
|
||||
const link = isInAllView ? `/p/all` : isInSubscriptionsView ? `/p/subscriptions` : `/p/${address}`;
|
||||
const params = useParams();
|
||||
|
||||
const createReturnLink = () => {
|
||||
if (isInAllView) {
|
||||
if (params?.timeFilterName) return `/p/all/${params.timeFilterName}`;
|
||||
return `/p/all`;
|
||||
} else if (isInSubscriptionsView) {
|
||||
if (params?.timeFilterName) return `/p/subscriptions/${params.timeFilterName}`;
|
||||
return `/p/subscriptions`;
|
||||
}
|
||||
return `/p/${address}`;
|
||||
};
|
||||
|
||||
return (
|
||||
<button className='button'>
|
||||
<Link to={link}>{t('return')}</Link>
|
||||
<Link to={createReturnLink()}>{t('return')}</Link>
|
||||
</button>
|
||||
);
|
||||
};
|
||||
@@ -66,7 +90,7 @@ const SortOptions = () => {
|
||||
};
|
||||
return (
|
||||
<>
|
||||
{t('sort_by')}:
|
||||
<span className='capitalize'>{t('sort_by')}</span>:
|
||||
<select value={sortType} onChange={handleSortChange}>
|
||||
<option value='active'>{t('bump_order')}</option>
|
||||
<option value='new'>{t('creation_date')}</option>
|
||||
|
||||
Reference in New Issue
Block a user