Skip to content

Commit

Permalink
Merge branch 'main' into connorwinston/web-342-implement-creative-rev…
Browse files Browse the repository at this point in the history
…iew-changes
  • Loading branch information
connorwinston authored Dec 2, 2024
2 parents 164fc00 + 60eec34 commit 3f83fa3
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 93 deletions.
7 changes: 6 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
NUXT_PUBLIC_SITE_URL=http://localhost:3000
NUXT_SITE_ENV=preview
NUXT_PRODUCT_DIRECTUS_URL=https://product-team.directus.app
NUXT_PUBLIC_INKEEP_API_KEY=1cc5c5549ed34af9402c9370e3f5f3a095e6c8daafdfa955
NUXT_PUBLIC_NEWSLETTER_URL=https://product-team.directus.app/flows/trigger/webhook_id
NUXT_PUBLIC_PRODUCT_DIRECTUS_URL=https://product-team.directus.app
NUXT_IMAGE_DOMAINS="product-team.directus.app"
POSTHOG_API_KEY="phc_api_key"
POSTHOG_API_HOST="https://us.i.posthog.com"
41 changes: 36 additions & 5 deletions app/components/aside/AsideFeedback.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,52 @@
<script setup lang="ts">
const { $clientPosthog } = useNuxtApp();
const buttonLoading = ref<'good' | 'bad' | null>(null);
const buttonTimeout = 500;
const handleFeedback = (feedback: 'good' | 'bad') => {
if (buttonLoading.value) return;
buttonLoading.value = feedback;
$clientPosthog?.capture(`feedback_${feedback}`);
setTimeout(() => {
buttonLoading.value = null;
}, buttonTimeout);
};
</script>

<template>
<div class="feedback">
<Button
color="outline-only"
size="small"
class="feedback-button"
:disabled="buttonLoading !== null"
@click="() => handleFeedback('good')"
>
<Icon name="material-symbols:thumb-up-rounded" />
<Icon
v-if="buttonLoading === 'good'"
name="svg-spinners:180-ring-with-bg"
/>
<Icon
v-else
name="material-symbols:thumb-up-rounded"
/>
</Button>
<Button
color="outline-only"
size="small"
class="feedback-button"
:disabled="buttonLoading !== null"
@click="() => handleFeedback('bad')"
>
<Icon name="material-symbols:thumb-down-rounded" />
<Icon
v-if="buttonLoading === 'bad'"
name="svg-spinners:180-ring-with-bg"
/>
<Icon
v-else
name="material-symbols:thumb-down-rounded"
/>
</Button>
<div>
<p class="cta">
Expand All @@ -25,9 +59,6 @@
</div>
</template>

<script setup lang="ts">
</script>

<style scoped lang="scss">
.feedback {
padding-top: 0.75rem;
Expand Down
3 changes: 2 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default defineNuxtConfig({
'@nuxt/icon',
'@nuxtjs/seo',
'@nuxtjs/color-mode',
'nuxt-posthog',
],
devtools: { enabled: true },
css: ['~/assets/css/main.scss'],
Expand Down Expand Up @@ -144,7 +145,7 @@ export default defineNuxtConfig({
rateLimiter: false,
headers: {
crossOriginEmbedderPolicy:
process.env.NODE_ENV === 'development' ? 'unsafe-none' : 'require-corp',
process.env.NODE_ENV === 'development' ? 'unsafe-none' : 'require-corp',
},
},
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"confbox": "^0.1.8",
"consola": "^3.2.3",
"nuxt": "^3.13.2",
"nuxt-posthog": "^1.5.4",
"nuxt-security": "2.0.0",
"radix-vue": "^1.9.7",
"ufo": "^1.5.4",
Expand Down
Loading

0 comments on commit 3f83fa3

Please sign in to comment.