style: improve button

This commit is contained in:
SethBurkart123
2025-03-30 12:33:28 +11:00
parent 1acda4f399
commit aeaf5d9e59
2 changed files with 15 additions and 5 deletions
+1 -1
View File
@@ -2,6 +2,6 @@
let { onClick, text } = $props<{ onClick: () => void, text: string, [key: string]: any }>(); let { onClick, text } = $props<{ onClick: () => void, text: string, [key: string]: any }>();
</script> </script>
<button onclick={onClick} class='px-14 py-1 text-[0.75rem] dark:bg-[#38373D] bg-[#DDDDDD] dark:text-white rounded-md'> <button onclick={onClick} class='px-4 py-1 text-[0.75rem] dark:bg-[#38373D] bg-[#DDDDDD] dark:text-white rounded-md'>
{text} {text}
</button> </button>
+12 -2
View File
@@ -22,7 +22,7 @@
(Omit<SelectSetting<string>, 'type'> & { (Omit<SelectSetting<string>, 'type'> & {
type: 'select', type: 'select',
id: string, id: string,
options: Array<{ value: string, label: string }> options: string[]
}); });
interface Plugin { interface Plugin {
@@ -130,11 +130,21 @@
max={setting.max} max={setting.max}
step={setting.step} step={setting.step}
/> />
{:else if setting.type === 'string'}
<input
type="text"
class="px-2 py-1 text-sm rounded-md dark:bg-[#38373D] bg-[#DDDDDD] dark:text-white"
value={pluginSettingsValues[plugin.pluginId]?.[key] ?? setting.default}
oninput={(e) => updatePluginSetting(plugin.pluginId, key, e.currentTarget.value)}
/>
{:else if setting.type === 'select'} {:else if setting.type === 'select'}
<Select <Select
state={pluginSettingsValues[plugin.pluginId]?.[key] ?? setting.default} state={pluginSettingsValues[plugin.pluginId]?.[key] ?? setting.default}
onChange={(value) => updatePluginSetting(plugin.pluginId, key, value)} onChange={(value) => updatePluginSetting(plugin.pluginId, key, value)}
options={setting.options} options={(setting.options as string[]).map(opt => ({
value: opt,
label: opt.charAt(0).toUpperCase() + opt.slice(1)
}))}
/> />
{/if} {/if}
</div> </div>