Extracting stuff for now

This commit is contained in:
Lim Chee Aun 2024-03-05 23:30:12 +08:00
parent b7ed27ef70
commit 3f4832965d

View file

@ -61,6 +61,22 @@ const RANGES = [
{ label: 'beyond 12 hours', value: 13 }, { label: 'beyond 12 hours', value: 13 },
]; ];
const FILTER_LABELS = [
'Original',
'Replies',
'Boosts',
'Followed tags',
'Groups',
'Filtered',
];
const FILTER_SORTS = [
'createdAt',
'repliesCount',
'favouritesCount',
'reblogsCount',
'density',
];
const FILTER_GROUPS = [null, 'account'];
const FILTER_VALUES = { const FILTER_VALUES = {
Filtered: 'filtered', Filtered: 'filtered',
Groups: 'group', Groups: 'group',
@ -1040,14 +1056,7 @@ function Catchup() {
/> />
All <span class="count">{posts.length}</span> All <span class="count">{posts.length}</span>
</label> </label>
{[ {FILTER_LABELS.map(
'Original',
'Replies',
'Boosts',
'Followed tags',
'Groups',
'Filtered',
].map(
(label) => (label) =>
!!filterCounts[label] && ( !!filterCounts[label] && (
<label <label
@ -1135,14 +1144,7 @@ function Catchup() {
<div class="catchup-filters"> <div class="catchup-filters">
<span class="filter-label">Sort</span>{' '} <span class="filter-label">Sort</span>{' '}
<fieldset class="radio-field-group"> <fieldset class="radio-field-group">
{[ {FILTER_SORTS.map((key) => (
'createdAt',
'repliesCount',
'favouritesCount',
'reblogsCount',
'density',
// 'account',
].map((key) => (
<label <label
class="filter-sort" class="filter-sort"
key={key} key={key}
@ -1198,7 +1200,7 @@ function Catchup() {
</fieldset> */} </fieldset> */}
<span class="filter-label">Group</span>{' '} <span class="filter-label">Group</span>{' '}
<fieldset class="radio-field-group"> <fieldset class="radio-field-group">
{[null, 'account'].map((key) => ( {FILTER_GROUPS.map((key) => (
<label class="filter-group" key={key || 'none'}> <label class="filter-group" key={key || 'none'}>
<input <input
type="radio" type="radio"