style: ui modifications to data sharing and newsletter component

This commit is contained in:
Joel Jacob Stephen
2024-03-05 09:19:28 +05:30
parent f99bfda88b
commit 0e2dd400e4
3 changed files with 44 additions and 52 deletions

View File

@@ -22,6 +22,7 @@
"title": "Data Sharing", "title": "Data Sharing",
"description": "Help improve Hoppscotch by sharing anonymous data", "description": "Help improve Hoppscotch by sharing anonymous data",
"enable": "Enable Data Sharing", "enable": "Enable Data Sharing",
"secondary_title": "Data Sharing Configurations",
"see_shared": "See what is shared", "see_shared": "See what is shared",
"toggle_description": "Share anonymous data", "toggle_description": "Share anonymous data",
"update_failure": "Failed to update data sharing configurations!!" "update_failure": "Failed to update data sharing configurations!!"

View File

@@ -29,10 +29,8 @@ declare module '@vue/runtime-core' {
HoppSmartTable: typeof import('@hoppscotch/ui')['HoppSmartTable'] HoppSmartTable: typeof import('@hoppscotch/ui')['HoppSmartTable']
HoppSmartTabs: typeof import('@hoppscotch/ui')['HoppSmartTabs'] HoppSmartTabs: typeof import('@hoppscotch/ui')['HoppSmartTabs']
HoppSmartToggle: typeof import('@hoppscotch/ui')['HoppSmartToggle'] HoppSmartToggle: typeof import('@hoppscotch/ui')['HoppSmartToggle']
IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default']
IconLucideChevronDown: typeof import('~icons/lucide/chevron-down')['default'] IconLucideChevronDown: typeof import('~icons/lucide/chevron-down')['default']
IconLucideInbox: typeof import('~icons/lucide/inbox')['default'] IconLucideInbox: typeof import('~icons/lucide/inbox')['default']
IconLucideUser: typeof import('~icons/lucide/user')['default']
SettingsAuthProvider: typeof import('./components/settings/AuthProvider.vue')['default'] SettingsAuthProvider: typeof import('./components/settings/AuthProvider.vue')['default']
SettingsConfigurations: typeof import('./components/settings/Configurations.vue')['default'] SettingsConfigurations: typeof import('./components/settings/Configurations.vue')['default']
SettingsDataSharing: typeof import('./components/settings/DataSharing.vue')['default'] SettingsDataSharing: typeof import('./components/settings/DataSharing.vue')['default']

View File

@@ -1,67 +1,63 @@
<template> <template>
<div class="flex flex-col items-center justify-center min-h-screen"> <div
<div class="text-center"> class="flex flex-col items-center justify-center min-h-screen space-y-10"
>
<div class="flex items-center justify-center flex-col space-y-2">
<h2 class="text-lg">{{ t('data_sharing.welcome') }}</h2> <h2 class="text-lg">{{ t('data_sharing.welcome') }}</h2>
<img src="/assets/images/hoppscotch-title.svg" alt="" class="mt-2 w-56" /> <img src="/assets/images/hoppscotch-title.svg" alt="" class="w-52" />
</div> </div>
<div <div
class="bg-primaryLight mt-10 p-10 border-2 border-dividerLight rounded-lg" class="bg-primaryLight p-10 border-2 border-dividerLight rounded-lg flex flex-col space-y-8"
> >
<section> <div class="flex flex-col space-y-5 items-start">
<div class="flex flex-col"> <span>
<p class="text-lg font-bold text-white"> <p class="text-lg font-bold text-white">
{{ t('data_sharing.title') }} {{ t('data_sharing.title') }}
</p> </p>
<p class="text-sm font-light"> <p class="font-light">
{{ t('data_sharing.description') }} {{ t('data_sharing.description') }}
</p> </p>
<HoppSmartToggle </span>
:on="dataSharingToggle" <HoppSmartToggle
@change="dataSharingToggle = !dataSharingToggle" :on="dataSharingToggle"
class="my-5 text-white w-min justify-start" @change="dataSharingToggle = !dataSharingToggle"
> >
{{ t('data_sharing.toggle_description') }} {{ t('data_sharing.toggle_description') }}
</HoppSmartToggle> </HoppSmartToggle>
<HoppButtonSecondary <HoppSmartAnchor
outline blank
filled to="http://docs.hoppscotch.io"
:icon="IconShieldQuestion" :label="t('data_sharing.see_shared')"
:label="t('data_sharing.see_shared')" class="underline"
to="http://docs.hoppscotch.io" />
class="w-min mx-auto mb-2" </div>
/> <div class="flex flex-col items-start space-y-5">
</div> <span>
<div class="mt-5">
<p class="text-lg font-bold text-white"> <p class="text-lg font-bold text-white">
{{ t('newsletter.title') }} {{ t('newsletter.title') }}
</p> </p>
<p>{{ t('newsletter.description') }}</p> <p class="font-light">{{ t('newsletter.description') }}</p>
<HoppSmartToggle </span>
:on="newsletterToggle" <HoppSmartToggle
@change="newsletterToggle = !newsletterToggle" :on="newsletterToggle"
class="my-5 text-white" @change="newsletterToggle = !newsletterToggle"
> >
{{ t('newsletter.toggle_description') }} {{ t('newsletter.toggle_description') }}
</HoppSmartToggle> </HoppSmartToggle>
</div> </div>
</section> <div class="flex flex-col space-y-5">
<div class="flex flex-col w-48 mx-auto mt-5">
<HoppButtonPrimary <HoppButtonPrimary
:icon="IconLogIn" :icon="IconLogIn"
:label="t('app.continue_to_dashboard')" :label="t('app.continue_to_dashboard')"
class="mx-10"
@click="submitSelection" @click="submitSelection"
/> />
<a href="http://docs.hoppscotch.io"> <HoppSmartAnchor
<HoppButtonSecondary blank
outline to="http://docs.hoppscotch.io"
filled :icon="IconBookOpenText"
:icon="IconBookOpenText" :label="t('app.read_documentation')"
:label="t('app.read_documentation')" />
class="mt-3 px-5"
/>
</a>
</div> </div>
</div> </div>
</div> </div>
@@ -136,9 +132,6 @@ const submitSelection = async () => {
const setupDataComplete = !dataSharingToggle.value || dataSharingResult; const setupDataComplete = !dataSharingToggle.value || dataSharingResult;
const setupNewsletterComplete = !newsletterToggle.value || newsletterResult; const setupNewsletterComplete = !newsletterToggle.value || newsletterResult;
emit( emit('onSetupComplete', setupDataComplete && setupNewsletterComplete);
'onSetupComplete',
setupDataComplete && setupNewsletterComplete ? true : false
);
}; };
</script> </script>