From 730fb29582531905d16d0cb3de7f450d8beedf05 Mon Sep 17 00:00:00 2001 From: Jin Igarashi Date: Fri, 29 Dec 2023 15:09:06 +0000 Subject: [PATCH] fix: improved the design of layer header name and buttons. Show tooltip to describe what they are. --- .changeset/twelve-worms-crash.md | 5 ++ .../pages/map/layers/LayerTemplate.svelte | 50 ++++++++++++------- .../map/layers/header/VisibilityButton.svelte | 15 +++++- sites/geohub/src/lib/helper/initTippy.ts | 20 ++++++++ 4 files changed, 69 insertions(+), 21 deletions(-) create mode 100644 .changeset/twelve-worms-crash.md diff --git a/.changeset/twelve-worms-crash.md b/.changeset/twelve-worms-crash.md new file mode 100644 index 0000000000..abc30a720e --- /dev/null +++ b/.changeset/twelve-worms-crash.md @@ -0,0 +1,5 @@ +--- +"geohub": patch +--- + +fix: improved the design of layer header name and buttons. Show tooltip to describe what they are. diff --git a/sites/geohub/src/components/pages/map/layers/LayerTemplate.svelte b/sites/geohub/src/components/pages/map/layers/LayerTemplate.svelte index b765840ee6..3cb93571ef 100644 --- a/sites/geohub/src/components/pages/map/layers/LayerTemplate.svelte +++ b/sites/geohub/src/components/pages/map/layers/LayerTemplate.svelte @@ -1,6 +1,13 @@ - diff --git a/sites/geohub/src/lib/helper/initTippy.ts b/sites/geohub/src/lib/helper/initTippy.ts index 4502b97291..8ce7532cce 100644 --- a/sites/geohub/src/lib/helper/initTippy.ts +++ b/sites/geohub/src/lib/helper/initTippy.ts @@ -39,3 +39,23 @@ export const initTippy = (options?: TippyProps) => { const tippy = createTippy(props); return tippy; }; + +/** + * Create tippy object for tooltip purpose + * @param options TippyProps + * @returns Tippy object + */ +export const initTooltipTippy = (options?: TippyProps) => { + let props: TippyProps = { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + trigger: 'mouseenter focus' + }; + + if (options) { + props = Object.assign(props, options); + } + + const tippy = createTippy(props); + return tippy; +};