mirror of
https://git.sr.ht/~ashkeel/strimertul
synced 2024-09-20 02:00:49 +00:00
Some stylish tweaks
This commit is contained in:
parent
b8b7f2347e
commit
dfeb2fbf65
2 changed files with 65 additions and 38 deletions
|
@ -96,6 +96,14 @@ const ACLIndicator = styled('span', {
|
|||
marginRight: '0.5rem',
|
||||
});
|
||||
|
||||
const NoneText = styled('div', {
|
||||
color: '$gray9',
|
||||
fontSize: '1.2em',
|
||||
textAlign: 'center',
|
||||
fontStyle: 'italic',
|
||||
paddingTop: '1rem',
|
||||
});
|
||||
|
||||
interface CommandItemProps {
|
||||
name: string;
|
||||
item: TwitchBotCustomCommand;
|
||||
|
@ -358,8 +366,13 @@ export default function TwitchBotCommandsPage(): React.ReactElement {
|
|||
/>
|
||||
</FlexRow>
|
||||
<CommandList>
|
||||
{Object.keys(commands ?? {})
|
||||
?.filter((cmd) => cmd.toLowerCase().includes(filterLC))
|
||||
{commands ? (
|
||||
Object.keys(commands ?? {})
|
||||
?.filter(
|
||||
(cmd) =>
|
||||
cmd.toLowerCase().includes(filterLC) ||
|
||||
commands[cmd].description.toLowerCase().includes(filterLC),
|
||||
)
|
||||
.sort()
|
||||
.map((cmd) => (
|
||||
<CommandItem
|
||||
|
@ -376,7 +389,10 @@ export default function TwitchBotCommandsPage(): React.ReactElement {
|
|||
}
|
||||
onDelete={() => deleteCommand(cmd)}
|
||||
/>
|
||||
))}
|
||||
))
|
||||
) : (
|
||||
<NoneText>{t('pages.botcommands.no-commands')}</NoneText>
|
||||
)}
|
||||
</CommandList>
|
||||
|
||||
<Dialog
|
||||
|
|
|
@ -89,6 +89,13 @@ const TimerText = styled('div', {
|
|||
marginBottom: '-0.5rem',
|
||||
},
|
||||
});
|
||||
const NoneText = styled('div', {
|
||||
color: '$gray9',
|
||||
fontSize: '1.2em',
|
||||
textAlign: 'center',
|
||||
fontStyle: 'italic',
|
||||
paddingTop: '1rem',
|
||||
});
|
||||
|
||||
function humanTime(t: TFunction<'translation'>, secs: number): string {
|
||||
const mins = Math.floor(secs / 60);
|
||||
|
@ -384,7 +391,8 @@ export default function TwitchBotTimersPage(): React.ReactElement {
|
|||
/>
|
||||
</FlexRow>
|
||||
<TimerList>
|
||||
{Object.keys(timerConfig?.timers ?? {})
|
||||
{!timerConfig?.timers ? (
|
||||
Object.keys(timerConfig?.timers ?? {})
|
||||
?.filter((cmd) => cmd.toLowerCase().includes(filterLC))
|
||||
.sort()
|
||||
.map((cmd) => (
|
||||
|
@ -402,7 +410,10 @@ export default function TwitchBotTimersPage(): React.ReactElement {
|
|||
}
|
||||
onDelete={() => deleteTimer(cmd)}
|
||||
/>
|
||||
))}
|
||||
))
|
||||
) : (
|
||||
<NoneText>{t('pages.bottimers.no-timers')}</NoneText>
|
||||
)}
|
||||
</TimerList>
|
||||
|
||||
<Dialog
|
||||
|
|
Loading…
Reference in a new issue