Skip to content

Commit 7df2443

Browse files
authored
chore: light mode for delete button, remove drop down (#709)
We cannot complete #376 because the issue to provide the component has stalled: podman-desktop/podman-desktop#6898 In the meantime we can do two things: - Pick up light mode support by copying the current code from Podman Desktop. - Remove the menu property, so that we can remove the unused dependency on the the DropdownMenuItem component. (if we need dropdown support in the future, we should use/require the component) Related to #376. Part of #536. Fixes #371. Signed-off-by: Tim deBoer <[email protected]>
1 parent ed15234 commit 7df2443

File tree

2 files changed

+22
-56
lines changed

2 files changed

+22
-56
lines changed

packages/frontend/src/lib/upstream/DropDownMenuItem.svelte

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script lang="ts">
22
import type { IconDefinition } from '@fortawesome/fontawesome-common-types';
3-
import DropdownMenuItem from './DropDownMenuItem.svelte';
43
import Fa from 'svelte-fa';
54
import { onMount } from 'svelte';
65
@@ -10,7 +9,6 @@ export let fontAwesomeIcon: IconDefinition | undefined = undefined;
109
export let hidden = false;
1110
export let enabled: boolean = true;
1211
export let onClick: () => void = () => {};
13-
export let menu = false;
1412
export let detailed = false;
1513
export let inProgress = false;
1614
export let iconOffset = '';
@@ -27,13 +25,13 @@ onMount(() => {
2725
});
2826
2927
const buttonDetailedClass =
30-
'text-gray-400 bg-charcoal-800 hover:text-violet-600 font-medium rounded-lg text-sm inline-flex items-center px-3 py-2 text-center';
28+
'text-[var(--pd-action-button-details-text)] bg-[var(--pd-action-button-details-bg)] hover:text-[var(--pd-action-button-details-hover-text)] font-medium rounded-lg text-sm inline-flex items-center px-3 py-2 text-center';
3129
const buttonDetailedDisabledClass =
32-
'text-gray-900 bg-charcoal-800 font-medium rounded-lg text-sm inline-flex items-center px-3 py-2 text-center';
30+
'text-[var(--pd-action-button-details-disabled-text)] bg-[var(--pd-action-button-details-disabled-bg)] font-medium rounded-lg text-sm inline-flex items-center px-3 py-2 text-center';
3331
const buttonClass =
34-
'm-0.5 text-gray-400 hover:bg-charcoal-600 hover:text-violet-600 font-medium rounded-full inline-flex items-center px-2 py-2 text-center';
32+
'text-[var(--pd-action-button-text)] hover:bg-[var(--pd-action-button-hover-bg)] hover:text-[var(--pd-action-button-hover-text)] font-medium rounded-full inline-flex items-center px-2 py-2 text-center';
3533
const buttonDisabledClass =
36-
'm-0.5 text-gray-900 font-medium rounded-full inline-flex items-center px-2 py-2 text-center';
34+
'text-[var(--pd-action-button-disabled-text)] font-medium rounded-full inline-flex items-center px-2 py-2 text-center';
3735
3836
$: styleClass = detailed
3937
? enabled && !inProgress
@@ -45,27 +43,22 @@ $: styleClass = detailed
4543
</script>
4644

4745
<!-- If menu = true, use the menu, otherwise implement the button -->
48-
{#if menu}
49-
<!-- enabled menu -->
50-
<DropdownMenuItem title={title} icon={icon} enabled={enabled} hidden={hidden} onClick={onClick} />
51-
{:else}
52-
<!-- enabled button -->
53-
<button
54-
title={title}
55-
aria-label={title}
56-
on:click={onClick}
57-
class="{styleClass} relative"
58-
class:disabled={inProgress}
59-
class:hidden={hidden}
60-
disabled={!enabled}>
61-
{#if fontAwesomeIcon}
62-
<Fa class="h-4 w-4 {iconOffset}" icon={fontAwesomeIcon} />
63-
{/if}
46+
<!-- enabled button -->
47+
<button
48+
title={title}
49+
aria-label={title}
50+
on:click={onClick}
51+
class="{styleClass} relative"
52+
class:disabled={inProgress}
53+
class:hidden={hidden}
54+
disabled={!enabled}>
55+
{#if fontAwesomeIcon}
56+
<Fa class="h-4 w-4 {iconOffset}" icon={fontAwesomeIcon} />
57+
{/if}
6458

65-
<div
66-
aria-label="spinner"
67-
class="w-6 h-6 rounded-full animate-spin border border-solid border-violet-500 border-t-transparent absolute {positionTopClass} {positionLeftClass}"
68-
class:hidden={!inProgress}>
69-
</div>
70-
</button>
71-
{/if}
59+
<div
60+
aria-label="spinner"
61+
class="w-6 h-6 rounded-full animate-spin border border-solid border-[var(--pd-action-button-spinner)] border-t-transparent absolute {positionTopClass} {positionLeftClass}"
62+
class:hidden={!inProgress}>
63+
</div>
64+
</button>

0 commit comments

Comments
 (0)