Update board-buttons.tsx

This commit is contained in:
Tom (plebeius.eth)
2025-03-03 23:43:45 +01:00
parent 2d1fb69f02
commit 4bdcfbdd28
@@ -92,7 +92,7 @@ const UpdateButton = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const isMobile = useIsMobile(); const isMobile = useIsMobile();
const handleUpdate = () => { const handleManualUpdate = () => {
window.alert('Manual updates are not available yet. Posts update automatically every ~2 minutes.'); window.alert('Manual updates are not available yet. Posts update automatically every ~2 minutes.');
}; };
@@ -100,11 +100,11 @@ const UpdateButton = () => {
<> <>
{/* TODO: Implement update button once available in API */} {/* TODO: Implement update button once available in API */}
{isMobile ? ( {isMobile ? (
<button className={`button ${styles.disabledButton}`} onClick={handleUpdate}> <button className={`button ${styles.disabledButton}`} onClick={handleManualUpdate}>
{t('update')} {t('update')}
</button> </button>
) : ( ) : (
<button className={`button ${styles.disabledButton}`} onClick={handleUpdate}> <button className={`button ${styles.disabledButton}`} onClick={handleManualUpdate}>
{t('update')} {t('update')}
</button> </button>
)} )}
@@ -116,17 +116,21 @@ const AutoButton = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const isMobile = useIsMobile(); const isMobile = useIsMobile();
const handleManualUpdate = () => {
window.alert('Manual updates are not available yet. Posts update automatically every ~2 minutes.');
};
return ( return (
<> <>
{isMobile ? ( {isMobile ? (
<button className='button'> <button className='button' onClick={handleManualUpdate}>
<label> <label>
<input type='checkbox' className={styles.autoCheckbox} checked disabled /> <input type='checkbox' className={styles.autoCheckbox} checked disabled />
{t('Auto')} {t('Auto')}
</label> </label>
</button> </button>
) : ( ) : (
<label> <label onClick={handleManualUpdate}>
{' '} {' '}
<input type='checkbox' className={styles.autoCheckbox} checked disabled /> {t('Auto')} <input type='checkbox' className={styles.autoCheckbox} checked disabled /> {t('Auto')}
</label> </label>