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

Feature/add premium banner to org #80

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ VITE_GOOGLE_MEASUREMENT_ID=YOUR_SUPABASE_URL
VITE_SUPABASE_URL=YOUR_SUPABASE_URL
VITE_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY
VITE_WHATSAPP_URL=https://wa.me
VITE_SUPPORT_EMAIL=example@support.com
VITE_SUPPORT_PHONE=1231231231
4 changes: 4 additions & 0 deletions src/config/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const WHATSAPP_URL = import.meta.env.VITE_WHATSAPP_URL as string;
export const SUPPORT_EMAIL = import.meta.env.VITE_SUPPORT_EMAIL as string;
export const SUPPORT_PHONE = import.meta.env.VITE_SUPPORT_PHONE as string;
export const SUPPORT_WHATSAPP = `${WHATSAPP_URL}/${SUPPORT_PHONE}`;
13 changes: 8 additions & 5 deletions src/features/organizations/components/GoPremiumSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,16 @@ async function createStripeCheckout() {
<SheetHeader>
<SheetTitle>¡Hazte Premium Hoy!</SheetTitle>
<SheetDescription>
Suscríbete ahora para disfrutar de todos los beneficios exclusivos de
nuestra membresía premium. Accede a contenido exclusivo, soporte
prioritario y mucho más. Haz clic en el botón de abajo para completar
tu suscripción a través de Stripe y mejorar tu experiencia al máximo.
<ul class="list-disc pl-4">
<li>Hasta 5000 clientes y 5000 productos</li>
<li>Hasta 3 organizaciones</li>
<li>Página pública para compartir inventario con clientes</li>
<li>Estadísticas avanzadas</li>
<li>Monedero electrónico para tus clientes</li>
</ul>
</SheetDescription>
</SheetHeader>
<SheetFooter class="flex flex-row gap-2">
<SheetFooter class="flex flex-row gap-2 mt-4">
<Button
:disabled="isSubscribeButtonDisabled"
@click="createStripeCheckoutMutation.mutate()"
Expand Down
45 changes: 40 additions & 5 deletions src/features/organizations/components/OrgLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
MoonIcon,
SunIcon,
} from "@heroicons/vue/24/outline";
import { CrownIcon, MenuIcon, SettingsIcon } from "lucide-vue-next";
import { CrownIcon, MenuIcon, PhoneIcon, SettingsIcon } from "lucide-vue-next";
import GoPremiumSidebar from "./GoPremiumSidebar.vue";
import { computed } from "vue";
import {
Expand All @@ -40,6 +40,7 @@ import OrganizationSwitcher from "./OrganizationSwitcher.vue";
import UpdateOrganizationSidebar from "./UpdateOrganizationSidebar.vue";
import { useLayerManager } from "@/features/global";
import CreateOrganizationSidebar from "./CreateOrganizationSidebar.vue";
import { SUPPORT_EMAIL, SUPPORT_WHATSAPP } from "@/config/constants";

const layerManager = useLayerManager();
const organizationStore = useOrganizationStore();
Expand Down Expand Up @@ -152,12 +153,21 @@ const menuList = computed(() => ({
<SheetFooter class="flex flex-col gap-4">
<div class="shrink-0 bg-border h-px w-full" />
<a
href="mailto:inventariofacilmx@gmail.com"
:href="`mailto:${SUPPORT_EMAIL}`"
class="w-full inline-flex items-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground rounded-md h-10 px-3 text-md justify-start"
active-class="active-link"
>
<EnvelopeIcon class="size-5" />
<span class="ms-2">Soporte</span>
<span class="ms-2">Soporte correo</span>
</a>
<a
:href="SUPPORT_WHATSAPP"
target="_blank"
class="w-full inline-flex items-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground rounded-md h-10 px-3 text-md justify-start"
active-class="active-link"
>
<PhoneIcon class="size-5" />
<span class="ms-2">Soporte Whatsapp</span>
</a>
<Button
v-if="!organizationStore.isPremium"
Expand Down Expand Up @@ -276,12 +286,21 @@ const menuList = computed(() => ({

<div class="w-full flex flex-col gap-4">
<a
href="mailto:inventariofacilmx@gmail.com"
:href="`mailto:${SUPPORT_EMAIL}`"
class="w-full inline-flex items-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground rounded-md h-10 px-3 text-md justify-start"
active-class="active-link"
>
<EnvelopeIcon class="size-5" />
<span class="ms-2">Soporte</span>
<span class="ms-2">Soporte correo</span>
</a>
<a
:href="SUPPORT_WHATSAPP"
target="_blank"
class="w-full inline-flex items-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground rounded-md h-10 px-3 text-md justify-start"
active-class="active-link"
>
<PhoneIcon class="size-5" />
<span class="ms-2">Soporte Whatsapp</span>
</a>
<Button
v-if="!organizationStore.isPremium"
Expand All @@ -295,6 +314,16 @@ const menuList = computed(() => ({
</aside>

<div class="sm:ml-64">
<div class="mt-[71px]">
<div
v-if="!organizationStore.isPremium"
class="banner"
@click="layerManager.openLayer('go-premium')"
>
<CrownIcon class="size-4" />
Obtener premium
</div>
</div>
<router-view />
</div>
</template>
Expand All @@ -303,4 +332,10 @@ const menuList = computed(() => ({
.active-link {
@apply bg-primary text-primary-foreground shadow hover:bg-primary/90;
}
.banner {
@apply bg-primary text-primary-foreground;
@apply flex justify-center items-center gap-2;
@apply p-2 select-none cursor-pointer;
@apply shadow-sm;
}
</style>
2 changes: 1 addition & 1 deletion src/features/sales/components/TodaySalesSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { useCurrencyFormatter } from "@/features/products";
import { FeedbackCard, useTableStates } from "@/features/global";
import { FaceFrownIcon } from "@heroicons/vue/24/outline";
import { useRoute } from "vue-router";
import { WHATSAPP_URL } from "@/config/constants";

const openModel = defineModel<boolean>("open");

Expand All @@ -33,7 +34,6 @@ const LOCALE = {
cancelled: "Cancelada",
completed: "Completada",
};
const WHATSAPP_URL = import.meta.env.VITE_WHATSAPP_URL;
const route = useRoute();
const currencyFormatter = useCurrencyFormatter();
const dashboardDates = useDashboardDates({
Expand Down
3 changes: 1 addition & 2 deletions src/features/sales/components/ViewSaleSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
} from "@/components/ui";
import { Sale } from "../composables";
import { useCurrencyFormatter } from "@/features/products";
import { WHATSAPP_URL } from "@/config/constants";

type ViewSaleSidebarProps = {
sale?: Sale | null;
Expand All @@ -33,8 +34,6 @@ const LOCALE = {
cancelled: "Cancelada",
completed: "Completada",
};
const WHATSAPP_URL = import.meta.env.VITE_WHATSAPP_URL;

const currencyFormatter = useCurrencyFormatter();
</script>

Expand Down
17 changes: 14 additions & 3 deletions src/pages/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { useCurrencyFormatter } from "@/features/products";
import { useRouter } from "vue-router";
import { ref } from "vue";
import { GoPremiumSidebar } from "@/features/organizations";
import { SUPPORT_EMAIL, SUPPORT_WHATSAPP } from "@/config/constants";
import { MailIcon, PhoneIcon } from "lucide-vue-next";

const isGoPremiumSidebarOpen = ref(false);
const router = useRouter();
Expand Down Expand Up @@ -48,6 +50,7 @@ function getCardDataFromPlan(plan: Tables<"plans">) {
<li>Hasta 3 organizaciones</li>
<li>Página pública para compartir inventario con clientes</li>
<li>Estadísticas avanzadas</li>
<li>Monedero electrónico para tus clientes</li>
</ul>
`,
action: {
Expand Down Expand Up @@ -219,9 +222,17 @@ function getCardDataFromPlan(plan: Tables<"plans">) {
<p class="text-muted-foreground">Ponte en contacto con nosotros</p>
</div>

<div class="mt-10 mb-14 flex justify-center">
<a href="mailto:inventariofacilmx@gmail.com">
<Button variant="outline" size="lg">Contactar</Button>
<div class="mt-10 mb-14 flex justify-center gap-4">
<a :href="`mailto:${SUPPORT_EMAIL}`">
<Button variant="outline" size="lg">
<MailIcon class="size-4 mr-2" />
Contactar</Button
>
</a>
<a :href="SUPPORT_WHATSAPP">
<Button variant="outline" size="lg"
><PhoneIcon class="size-4 mr-2" /> Whatsapp</Button
>
</a>
</div>
</section>
Expand Down
6 changes: 5 additions & 1 deletion src/pages/legal/cookie-policy.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<script setup lang="ts">
import { SUPPORT_EMAIL } from "@/config/constants";
</script>

<template>
<div class="container my-12">
<h1 class="text-4xl">Política de Cookies</h1>
Expand Down Expand Up @@ -96,7 +100,7 @@
</p>
<p>
<strong>inventariofacil.mx</strong><br />
Correo Electrónico: inventariofacilmx@gmail.com
Correo Electrónico: {{ SUPPORT_EMAIL }}
</p>
</div>
</template>
8 changes: 6 additions & 2 deletions src/pages/legal/legal-notice.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<script setup lang="ts">
import { SUPPORT_EMAIL } from "@/config/constants";
</script>

<template>
<div class="container my-12">
<h1 class="text-4xl">Aviso Legal</h1>
Expand All @@ -19,7 +23,7 @@
</p>
<p class="mt-2 mb-6">
<strong>inventariofacil.mx</strong><br />
Correo Electrónico: inventariofacilmx@gmail.com<br />
Correo Electrónico: {{ SUPPORT_EMAIL }}<br />
Sitio Web:
<a href="https://inventariofacil.mx">https://inventariofacil.mx</a>
</p>
Expand Down Expand Up @@ -77,7 +81,7 @@
</p>
<p class="mt-2 mb-6">
<strong>inventariofacil.mx</strong><br />
Correo Electrónico: inventariofacilmx@gmail.com
Correo Electrónico: {{ SUPPORT_EMAIL }}
</p>
</div>
</template>
6 changes: 5 additions & 1 deletion src/pages/legal/privacy-policy.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<script setup lang="ts">
import { SUPPORT_EMAIL } from "@/config/constants";
</script>

<template>
<div class="container my-12">
<h1 class="text-4xl">Política de Privacidad</h1>
Expand Down Expand Up @@ -114,7 +118,7 @@
</p>
<p class="mt-2 mb-6">
<strong>inventariofacil.mx</strong><br />
Correo Electrónico: inventariofacilmx@gmail.com
Correo Electrónico: {{ SUPPORT_EMAIL }}
</p>
</div>
</template>
12 changes: 6 additions & 6 deletions src/pages/legal/refund-policy.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<script setup lang="ts">
import { SUPPORT_EMAIL } from "@/config/constants";
</script>

<template>
<div class="container my-12">
<h1 class="text-4xl">Política de Reembolsos</h1>
Expand All @@ -23,9 +27,7 @@
<ul class="mb-6">
<li>
Envíe un correo electrónico a
<a href="mailto:inventariofacilmx@gmail.com"
>inventariofacilmx@gmail.com</a
>
<a :href="`mailto:${SUPPORT_EMAIL}`">{{ SUPPORT_EMAIL }}</a>
con el asunto "Solicitud de Reembolso".
</li>
<li>
Expand Down Expand Up @@ -60,9 +62,7 @@
<p class="mt-2 mb-6">
<strong>InventarioFácil.mx</strong><br />
Correo Electrónico:
<a href="mailto:inventariofacilmx@gmail.com"
>inventariofacilmx@gmail.com</a
>
<a :href="`mailto:${SUPPORT_EMAIL}`">{{ SUPPORT_EMAIL }}</a>
</p>

<h2 class="text-xl">5. Cambios en la Política de Reembolsos</h2>
Expand Down
6 changes: 5 additions & 1 deletion src/pages/legal/terms-and-conditions.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<script setup lang="ts">
import { SUPPORT_EMAIL } from "@/config/constants";
</script>

<template>
<div class="container my-12">
<h1 class="text-4xl">Términos y Condiciones</h1>
Expand Down Expand Up @@ -92,7 +96,7 @@
</p>
<p>
<strong>inventariofacil.mx</strong><br />
Correo Electrónico: inventariofacilmx@gmail.com
Correo Electrónico: {{ SUPPORT_EMAIL }}
</p>
</div>
</template>
7 changes: 2 additions & 5 deletions src/pages/org/customers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ import { refDebounced, useInfiniteScroll } from "@vueuse/core";
import { useOrganizationStore } from "@/stores";
import { useRoute } from "vue-router";
import { useCurrencyFormatter } from "@/features/products";
import { WHATSAPP_URL } from "@/config/constants";

const LOCALE = {
trusted: "Confiable",
not_trusted: "No confiable",
};
const WHATSAPP_URL = import.meta.env.VITE_WHATSAPP_URL;
const tableRef = ref<HTMLElement | null>(null);
const customerSearch = ref("");
const customerSearchDebounced = refDebounced(customerSearch, 400);
Expand Down Expand Up @@ -111,10 +111,7 @@ watchEffect(() => {
</script>

<template>
<div
ref="tableRef"
class="py-6 mt-[71px] md:px-6 h-[calc(100vh-71px)] overflow-y-auto"
>
<div ref="tableRef" class="py-6 md:px-6 h-[calc(100vh-71px)] overflow-y-auto">
<div class="flex justify-between flex-col md:flex-row mx-4 md:mx-0">
<div class="mb-6">
<h2
Expand Down
2 changes: 1 addition & 1 deletion src/pages/org/dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const yearMonthlySalesData = computed(() => {
</script>

<template>
<div class="py-6 mt-[71px] md:px-6 h-[calc(100vh-71px)] overflow-y-auto">
<div class="py-6 md:px-6 h-[calc(100vh-71px)] overflow-y-auto">
<div class="flex flex-col gap-8 mx-4 md:mx-0 mb-6">
<div class="flex flex-col gap-5">
<div class="text-slate-500 dark:text-slate-400 font-semibold">
Expand Down
5 changes: 1 addition & 4 deletions src/pages/org/products.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,7 @@ watchEffect(() => {
</script>

<template>
<div
ref="tableRef"
class="py-6 mt-[71px] md:px-6 h-[calc(100vh-71px)] overflow-y-auto"
>
<div ref="tableRef" class="py-6 md:px-6 h-[calc(100vh-71px)] overflow-y-auto">
<div class="flex justify-between flex-col md:flex-row mx-4 md:mx-0">
<div class="mb-6">
<h2
Expand Down
7 changes: 2 additions & 5 deletions src/pages/org/sales.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ import { useRoute } from "vue-router";
import CustomerPickerSidebar from "@/features/sales/components/CustomerPickerSidebar.vue";
import { CreateCustomerSidebar, Customer } from "@/features/customers";
import ProductPickerSidebar from "@/features/sales/components/ProductPickerSidebar.vue";
import { WHATSAPP_URL } from "@/config/constants";

const LOCALE = {
in_progress: "En progreso",
cancelled: "Cancelada",
completed: "Completada",
};
const WHATSAPP_URL = import.meta.env.VITE_WHATSAPP_URL;
const tableFiltersRef = useStorage<{
status: NonNullable<Tables<"i_sales">["status"]> | "all";
period?: "daily" | "weekly" | "monthly";
Expand Down Expand Up @@ -192,10 +192,7 @@ watchEffect(() => {
</script>

<template>
<div
ref="tableRef"
class="py-6 mt-[71px] md:px-6 h-[calc(100vh-71px)] overflow-y-auto"
>
<div ref="tableRef" class="py-6 md:px-6 h-[calc(100vh-71px)] overflow-y-auto">
<div class="flex justify-between flex-col md:flex-row mx-4 md:mx-0">
<div class="mb-6">
<h2
Expand Down
Loading