Skip to content
Open
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
56 changes: 56 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"vue": "^3.4.21",
"vue-axios": "^3.5.2",
"vue-chartjs": "^5.3.2",
"vue-input-otp": "^0.3.2",
"vue-markdown": "^2.1.3",
"vue-router": "^4.3.0",
"vue-tel-input": "^8.3.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/VendorNav.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { defineProps } from 'vue'
import { defineProps, computed } from 'vue'
import VendorsIcon from './VendorsIcon.vue'
// Function to format the date in the desired format (e.g., "Tue, 5 Feb 2023")
import { useDateFormat, useNow } from '@vueuse/core'
Expand Down
28 changes: 28 additions & 0 deletions src/components/ui/input-otp/InputOTP.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import type { OTPInputEmits, OTPInputProps } from "vue-input-otp"
import { reactiveOmit } from "@vueuse/core"
import { useForwardPropsEmits } from 'radix-vue'
import { OTPInput } from "vue-input-otp"
import { cn } from "@/lib/utils"

const props = defineProps<OTPInputProps & { class?: HTMLAttributes["class"] }>()

const emits = defineEmits<OTPInputEmits>()

const delegatedProps = reactiveOmit(props, "class")

const forwarded = useForwardPropsEmits(delegatedProps, emits)
</script>

<template>
<OTPInput
v-slot="slotProps"
v-bind="forwarded"
:container-class="cn('flex items-center gap-2 has-disabled:opacity-50', props.class)"
data-slot="input-otp"
class="disabled:cursor-not-allowed"
>
<slot v-bind="slotProps" />
</OTPInput>
</template>
22 changes: 22 additions & 0 deletions src/components/ui/input-otp/InputOTPGroup.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { reactiveOmit } from "@vueuse/core"
import { useForwardProps } from 'radix-vue'
import { cn } from "@/lib/utils"

const props = defineProps<{ class?: HTMLAttributes["class"] }>()

const delegatedProps = reactiveOmit(props, "class")

const forwarded = useForwardProps(delegatedProps)
</script>

<template>
<div
data-slot="input-otp-group"
v-bind="forwarded"
:class="cn('flex items-center', props.class)"
>
<slot />
</div>
</template>
21 changes: 21 additions & 0 deletions src/components/ui/input-otp/InputOTPSeparator.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { MinusIcon } from "lucide-vue-next"
import { useForwardProps } from 'radix-vue'

const props = defineProps<{ class?: HTMLAttributes["class"] }>()

const forwarded = useForwardProps(props)
</script>

<template>
<div
data-slot="input-otp-separator"
role="separator"
v-bind="forwarded"
>
<slot>
<MinusIcon />
</slot>
</div>
</template>
32 changes: 32 additions & 0 deletions src/components/ui/input-otp/InputOTPSlot.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { reactiveOmit } from "@vueuse/core"
import { useForwardProps } from 'radix-vue'
import { computed } from "vue"
import { useVueOTPContext } from "vue-input-otp"
import { cn } from "@/lib/utils"

const props = defineProps<{ index: number, class?: HTMLAttributes["class"] }>()

const delegatedProps = reactiveOmit(props, "class")

const forwarded = useForwardProps(delegatedProps)

const context = useVueOTPContext()

const slot = computed(() => context?.value.slots[props.index])
</script>

<template>
<div
v-bind="forwarded"
data-slot="input-otp-slot"
:data-active="slot?.isActive"
:class="cn('data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-3', props.class)"
>
{{ slot?.char }}
<div v-if="slot?.hasFakeCaret" class="pointer-events-none absolute inset-0 flex items-center justify-center">
<div class="animate-caret-blink bg-foreground h-4 w-px duration-1000" />
</div>
</div>
</template>
4 changes: 4 additions & 0 deletions src/components/ui/input-otp/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { default as InputOTP } from "./InputOTP.vue"
export { default as InputOTPGroup } from "./InputOTPGroup.vue"
export { default as InputOTPSeparator } from "./InputOTPSeparator.vue"
export { default as InputOTPSlot } from "./InputOTPSlot.vue"
5 changes: 2 additions & 3 deletions src/components/vendors/VendorShare.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ const props = defineProps<{
const copied = ref(false);
const baseLink = 'https://weeshr.com/v';
const vendorSlug = computed(() => {
// return props.vendorName?.toLowerCase().replace(/\s+/g, '-');
return JSON.parse(localStorage.getItem('vendor') || 'null').toLowerCase().replace(/\s+/g, '-');
return props.vendorName?.toLowerCase().replace(/\s+/g, '-');
});
const storeLink = computed(() => {
return `${baseLink}/${vendorSlug.value}`;
Expand Down Expand Up @@ -97,7 +96,7 @@ const handleShare = (option: any) => {
if (option.action === 'copy') {
navigator.clipboard.writeText(storeLink.value);
copied.value = true;
console.log(storeLink.value)
// console.log(storeLink.value)
setTimeout(() => {
copied.value = false;
}, 2000);
Expand Down
1 change: 1 addition & 0 deletions src/components/vendors/vendorDetailCom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ const saveUserData = async () => {

// Check if response status is 200 or 201
if (response.status === 200 || response.status === 201) {
await useSuperAdminStore().fetchUsersData('Success', id)
// Show success toast
toast({
title: 'Success',
Expand Down
27 changes: 17 additions & 10 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ import GlobalGeeftr from '@/views/protected/VendorModule/GlobalGeeftr.vue'
import VendorRegistration from '@/views/unprotected/VendorModule/VendorRegistration.vue'
import VendorsDetailsPage from '@/components/vendors/vendorsDetailsPage.vue'
import VendorPayout from '@/views/protected/AdminModule/VendorPayout.vue'
import ResetPassword from '@/views/unprotected/SuperAdminModule/ResetPassword.vue'

const routes = [
// dashboard,
{
path: '/',
name: 'home',
component: DashboardWrapper,
meta: { requiresAuth: true, dynamic: true }
meta: { requiresAuth: true, dynamic: true }
},
{
path: '/registration',
Expand All @@ -63,6 +64,12 @@ const routes = [
component: SuperAdminLogin,
meta: { hideSidebar: true }
},
{
path: '/reset-password',
name: 'reset-password',
component: ResetPassword,
meta: { hideSidebar: true }
},

{
path: '/error',
Expand Down Expand Up @@ -295,16 +302,16 @@ router.beforeEach((to, from, next) => {
const isAuthenticated = useSuperAdminStore().token !== ''
// const isVendor = useSuperAdminStore().isVendor
const requiresAuth = to.matched.some((record) => record.meta.requiresAuth)
// 🧠 Dynamic dashboard: if user is vendor, switch home component
// if (to.name === 'home') {
// const record = to.matched[0]
// 🧠 Dynamic dashboard: if user is vendor, switch home component
// if (to.name === 'home') {
// const record = to.matched[0]

// if (record?.components) {
// record.components.default = isVendor
// ? Vendors
// : AdminDashboard
// }
// }
// if (record?.components) {
// record.components.default = isVendor
// ? Vendors
// : AdminDashboard
// }
// }



Expand Down
2 changes: 2 additions & 0 deletions src/stores/super-admin/super-admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ export const useSuperAdminStore = defineStore({
if (response.status === 200 || response.status === 201) {
// Update the users data with the response
this.vendor = response.data.data;
localStorage.setItem('vendor', JSON.stringify(response.data.data.companyName))
this.companyName = response.data.data.companyName;
// console.log(response.data.data)
// const responseData = response.data.data[0]
// const phoneData = response.data.data[0].phoneNumber.normalizedNumber
Expand Down
2 changes: 1 addition & 1 deletion src/stores/vendor/vendor-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export const useVendorListStore = defineStore({
page: params?.page || 1,
limit: params?.limit || 10,
search: params?.search || '',
// status: params?.status || 'all',
// sortBy: params?.sortBy || 'name',
// status: params?.status || 'all'
}
})

Expand Down
Loading