1
0
Fork 0
mirror of synced 2024-09-30 00:57:16 +13:00
budibase/packages/builder/src/components/feedback/FeedbackNavLink.svelte

64 lines
1.4 KiB
Svelte

<script>
import { Popover } from "@budibase/bbui"
import { store } from "builderStore"
import { onMount } from "svelte"
import FeedbackIframe from "./FeedbackIframe.svelte"
import analytics from "analytics"
const FIVE_MINUTES = 300000
let iconContainer
let popover
onMount(() => {
const interval = setInterval(() => {
store.update(state => {
state.highlightFeedbackIcon = analytics.highlightFeedbackIcon()
return state
})
}, FIVE_MINUTES)
return () => clearInterval(interval)
})
</script>
<div class="container" bind:this={iconContainer} on:click={popover.show}>
<i class="ri-feedback-line" class:highlight={$store.highlightFeedbackIcon} />
</div>
<div class="iframe">
<Popover bind:this={popover} anchor={iconContainer} align="right">
<FeedbackIframe on:finished={popover.hide} />
</Popover>
</div>
<style>
i {
font-size: 18px;
color: var(--grey-7);
}
i.highlight {
color: var(--blue);
filter: drop-shadow(0 0 20px var(--blue));
}
.container {
cursor: pointer;
color: var(--grey-7);
margin: 0 12px 0 0;
font-weight: 500;
font-size: 1rem;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
height: 24px;
width: 24px;
}
.container:hover i {
color: var(--ink);
}
.iframe :global(.menu-container) {
background-color: white;
}
</style>