diff --git a/src/app.css b/src/app.css index 292ff984..6e8e36b4 100644 --- a/src/app.css +++ b/src/app.css @@ -2134,11 +2134,18 @@ ul.link-list li a .icon { border-radius: 999px; color: var(--text-color); background-color: var(--bg-color); + background-image: none; border: 2px solid transparent; margin: 0; - appearance: none; + /* appearance: none; */ line-height: 1; font-size: 90%; + display: flex; + gap: 8px; + + > .icon { + color: var(--link-color); + } &:placeholder-shown { color: var(--text-insignificant-color); @@ -2157,6 +2164,7 @@ ul.link-list li a .icon { :is(input, select) { background-color: transparent; + background-image: none; border: 0; padding: 0; margin: 0; @@ -2167,6 +2175,12 @@ ul.link-list li a .icon { border-radius: 0; box-shadow: none; outline: none; + + &::-webkit-calendar-picker-indicator { + /* replace icon with triangle */ + opacity: 0.5; + background-image: url('data:image/svg+xml;utf8,'); + } } } } diff --git a/src/components/icon.jsx b/src/components/icon.jsx index 9186383b..42e33f2a 100644 --- a/src/components/icon.jsx +++ b/src/components/icon.jsx @@ -101,6 +101,7 @@ export const ICONS = { 'account-warning': () => import('@iconify-icons/mingcute/user-warning-line'), keyboard: () => import('@iconify-icons/mingcute/keyboard-line'), cloud: () => import('@iconify-icons/mingcute/cloud-line'), + month: () => import('@iconify-icons/mingcute/calendar-month-line'), }; function Icon({ diff --git a/src/pages/account-statuses.jsx b/src/pages/account-statuses.jsx index dfd94df5..4f9d936e 100644 --- a/src/pages/account-statuses.jsx +++ b/src/pages/account-statuses.jsx @@ -16,6 +16,8 @@ import { saveStatus } from '../utils/states'; import useTitle from '../utils/useTitle'; const LIMIT = 20; +const MIN_YEAR = 1983; +const MIN_YEAR_MONTH = `${MIN_YEAR}-01`; // Birth of the Internet const supportsInputMonth = (() => { try { @@ -67,7 +69,9 @@ function AccountStatuses() { }, [sameCurrentInstance, account?.acct]); async function fetchAccountStatuses(firstLoad) { - if (/^\d{4}-[01]\d$/.test(month)) { + const isValidMonth = /^\d{4}-[01]\d$/.test(month); + const isValidYear = month?.split?.('-')?.[0] >= MIN_YEAR; + if (isValidMonth && isValidYear) { if (!account) { return { value: [], @@ -297,31 +301,33 @@ function AccountStatuses() { ))} {searchEnabled && (supportsInputMonth ? ( - { - const { value } = e.currentTarget; - setSearchParams( - value - ? { - month: value, - } - : {}, - ); - }} - /> + ) : ( // Fallback to for year { const { value } = e; @@ -465,6 +471,7 @@ function MonthPicker(props) { return (
+