Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: using the dropdown #2

Prev Previous commit
Next Next commit
chore: use dropdownmenu component for always on buddy widget popup menu
Signed-off-by: Evzen Gasta <[email protected]>
gastoner committed Aug 6, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit ff6ffc29ca3a52199b30355a8bcbc4ab2bedadb9
58 changes: 0 additions & 58 deletions packages/renderer/src/AppNavigation.svelte
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
<svelte:options runes={true} />

<script lang="ts">
<<<<<<< HEAD
import { Tooltip } from '@podman-desktop/ui-svelte';
import { onMount } from 'svelte';
import type { TinroRouteMeta } from 'tinro';

=======
import { faCircleUser } from '@fortawesome/free-regular-svg-icons';
import { Tooltip } from '@podman-desktop/ui-svelte';
import { ContainerIcon } from '@podman-desktop/ui-svelte/icons';
import { onDestroy, onMount } from 'svelte';
import type { Unsubscriber } from 'svelte/store';
import Fa from 'svelte-fa';
import type { TinroRouteMeta } from 'tinro';

import Webviews from '/@/lib/webview/Webviews.svelte';
import { webviews } from '/@/stores/webviews';
import type { ImageInfo } from '/@api/image-info';

>>>>>>> c556038c (chore: use dropdownmenu component for always on buddy widget popup menu)
import AuthActions from './lib/authentication/AuthActions.svelte';
import { CommandRegistry } from './lib/CommandRegistry';
import NewContentOnDashboardBadge from './lib/dashboard/NewContentOnDashboardBadge.svelte';
@@ -31,7 +16,6 @@ import NavRegistryEntry from './lib/ui/NavRegistryEntry.svelte';
import NavSection from './lib/ui/NavSection.svelte';
import { navigationRegistry } from './stores/navigation/navigation-registry';

<<<<<<< HEAD
let {
exitSettingsCallback,
meta = $bindable(),
@@ -43,44 +27,6 @@ let {
authActions: AuthActions;
outsideWindow: HTMLDivElement;
} = $props();
=======
let podInfoSubscribe: Unsubscriber;
let containerInfoSubscribe: Unsubscriber;
let imageInfoSubscribe: Unsubscriber;
let volumeInfoSubscribe: Unsubscriber;
let contextsSubscribe: Unsubscriber;
let nodesSubscribe: Unsubscriber;
let deploymentsSubscribe: Unsubscriber;
let persistentVolumeClaimsSubscribe: Unsubscriber;
let servicesSubscribe: Unsubscriber;
let ingressesSubscribe: Unsubscriber;
let routesSubscribe: Unsubscriber;
let configmapsSubscribe: Unsubscriber;
let secretsSubscribe: Unsubscriber;
let combinedInstalledExtensionsSubscribe: Unsubscriber;

let podCount = '';
let containerCount = '';
let imageCount = '';
let volumeCount = '';
let configmapsCount = 0;
let secretsCount = 0;
let configmapSecretsCount = '';
let persistentVolumeClaimsCount = '';
let contextCount = 0;
let deploymentCount = '';
let nodeCount = '';
let serviceCount = '';
let ingressesCount = 0;
let routesCount = 0;
let ingressesRoutesCount = '';
let extensionCount = '';
let authActions: AuthActions;
let outsideWindow: HTMLDivElement;

const imageUtils = new ImageUtils();
export let exitSettingsCallback: () => void;
>>>>>>> c556038c (chore: use dropdownmenu component for always on buddy widget popup menu)

const iconSize = '22';

@@ -140,11 +86,7 @@ function clickSettings(b: boolean) {
<div bind:this={outsideWindow}>
<NavItem href="/accounts" tooltip="" bind:meta={meta} onClick={event => authActions.onButtonClick(event)}>
<Tooltip bottomRight tip="Accounts">
<<<<<<< HEAD
<AccountIcon size={iconSize} />
=======
<Fa class="h-6 w-6 fa-light" icon={faCircleUser} size="2x" style="fa-light" />
>>>>>>> c556038c (chore: use dropdownmenu component for always on buddy widget popup menu)
</Tooltip>
<AuthActions bind:this={authActions} outsideWindow={outsideWindow} />
</NavItem>
5 changes: 0 additions & 5 deletions packages/ui/src/lib/dropdownMenu/DropDownMenuItems.svelte
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ export let clientY: number;
export let clientX: number;

const STATUS_BAR_HEIGHT = 24;
const NAV_BAR_WIDTH = 48;

// When initializing the widget, set the placement on top or on bottom
// depending on the clientY position (cursor position) and the height of the dropdown menu to display
@@ -22,13 +21,9 @@ onMount(() => {
dropDownElement.style.top = '20px';
}

<<<<<<< HEAD
// When initializing the widget, set the placement on left or right
// depending on the clientX position (cursor position) and the width of the dropdown menu to display
if (window.innerWidth - clientX < dropDownWidth) {
=======
if (window.innerWidth - clientX - NAV_BAR_WIDTH < dropDownWidth) {
>>>>>>> c556038c (chore: use dropdownmenu component for always on buddy widget popup menu)
sideAlign = 'right-0 origin-top-right';
} else {
sideAlign = 'left-0 origin-top-left';