Add notice if there's only 1 shortcut

This commit is contained in:
Lim Chee Aun 2024-01-10 14:48:29 +08:00
parent 8c6563a671
commit 07f927d4ff
2 changed files with 106 additions and 91 deletions

View file

@ -1059,6 +1059,10 @@ a[href^='http'][rel*='nofollow']:visited:not(:has(div)) {
.ui-state { .ui-state {
padding: 16px; padding: 16px;
text-align: center; text-align: center;
.icon {
vertical-align: middle;
}
} }
.status-carousel-link { .status-carousel-link {

View file

@ -279,6 +279,7 @@ function ShortcutsSettings({ onClose }) {
})} })}
</div> </div>
{shortcuts.length > 0 ? ( {shortcuts.length > 0 ? (
<>
<ol class="shortcuts-list" ref={shortcutsListParent}> <ol class="shortcuts-list" ref={shortcutsListParent}>
{shortcuts.filter(Boolean).map((shortcut, i) => { {shortcuts.filter(Boolean).map((shortcut, i) => {
// const key = i + Object.values(shortcut); // const key = i + Object.values(shortcut);
@ -378,6 +379,16 @@ function ShortcutsSettings({ onClose }) {
); );
})} })}
</ol> </ol>
{shortcuts.length === 1 &&
snapStates.settings.shortcutsViewMode !== 'float-button' && (
<div class="ui-state insignificant">
<Icon icon="info" />{' '}
<small>
Add more than one shortcut/column to make this work.
</small>
</div>
)}
</>
) : ( ) : (
<div class="ui-state insignificant"> <div class="ui-state insignificant">
<p>No shortcuts yet. Tap on the Add shortcut button.</p> <p>No shortcuts yet. Tap on the Add shortcut button.</p>