quik access
This commit is contained in:
+1
-1
@@ -82,7 +82,7 @@ define(['./workbox-e7681877'], (function (workbox) { 'use strict';
|
|||||||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||||
}, {
|
}, {
|
||||||
"url": "index.html",
|
"url": "index.html",
|
||||||
"revision": "0.6dtlsl90suo"
|
"revision": "0.3q32r8akalg"
|
||||||
}], {});
|
}], {});
|
||||||
workbox.cleanupOutdatedCaches();
|
workbox.cleanupOutdatedCaches();
|
||||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { FC } from 'react'
|
import { FC } from 'react'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import { Pages } from '../config/Pages'
|
import { Pages } from '../config/Pages'
|
||||||
import { ArrowLeft } from 'iconsax-react'
|
import { ArrowLeft, More } from 'iconsax-react'
|
||||||
import Button from './Button'
|
import Button from './Button'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { ItemServiceType } from '../pages/service/types/ServiecTypes'
|
import { ItemServiceType } from '../pages/service/types/ServiecTypes'
|
||||||
@@ -12,7 +12,8 @@ type Props = {
|
|||||||
isLinkPanel?: boolean,
|
isLinkPanel?: boolean,
|
||||||
businessName?: string,
|
businessName?: string,
|
||||||
isDisabled?: boolean,
|
isDisabled?: boolean,
|
||||||
isQuikAccess?: boolean
|
isQuikAccess?: boolean,
|
||||||
|
onMoreClick?: () => void,
|
||||||
}
|
}
|
||||||
|
|
||||||
const ServiceItem: FC<Props> = (props: Props) => {
|
const ServiceItem: FC<Props> = (props: Props) => {
|
||||||
@@ -21,7 +22,13 @@ const ServiceItem: FC<Props> = (props: Props) => {
|
|||||||
const { item } = props
|
const { item } = props
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`flex-1 flex flex-col self-stretch min-w-[45%] xl:min-w-[30%] bg-white rounded-3xl xl:p-6 p-4 ${props.className} ${props.isDisabled ? 'opacity-50' : ''}`}>
|
<div className={`flex-1 relative flex flex-col self-stretch min-w-[45%] xl:min-w-[30%] bg-white rounded-3xl xl:p-6 p-4 ${props.className} ${props.isDisabled ? 'opacity-50' : ''}`}>
|
||||||
|
{
|
||||||
|
props.isQuikAccess &&
|
||||||
|
<div className='absolute left-4 top-4'>
|
||||||
|
<More onClick={props.onMoreClick} size={14} color='black' className='rotate-90' />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
<div className='flex gap-2 items-center'>
|
<div className='flex gap-2 items-center'>
|
||||||
<div className='xl:size-[50px] xl:min-w-[50px] min-w-10 size-10 overflow-hidden rounded-xl'>
|
<div className='xl:size-[50px] xl:min-w-[50px] min-w-10 size-10 overflow-hidden rounded-xl'>
|
||||||
<img src={item.icon} alt={item.name} className='w-full h-full' />
|
<img src={item.icon} alt={item.name} className='w-full h-full' />
|
||||||
|
|||||||
@@ -15,11 +15,13 @@ import { QuikAccessItemType } from './types/HomeTypes'
|
|||||||
import ServiceItem from '../../components/ServiceItem'
|
import ServiceItem from '../../components/ServiceItem'
|
||||||
import PageLoading from '../../components/PageLoading'
|
import PageLoading from '../../components/PageLoading'
|
||||||
import { Helmet } from 'react-helmet-async';
|
import { Helmet } from 'react-helmet-async';
|
||||||
|
import { useHomeStore } from './store/HomeStore'
|
||||||
|
|
||||||
|
|
||||||
const Home: FC = () => {
|
const Home: FC = () => {
|
||||||
|
|
||||||
const { t } = useTranslation('global')
|
const { t } = useTranslation('global')
|
||||||
|
const { setShowModal } = useHomeStore()
|
||||||
const getAds = useGetAds(AdsDisplayLocation.HOMEPAGE_TOP)
|
const getAds = useGetAds(AdsDisplayLocation.HOMEPAGE_TOP)
|
||||||
const getQuikAccess = useGetQuikAccess()
|
const getQuikAccess = useGetQuikAccess()
|
||||||
const getDashboard = useGetDashboardSummary()
|
const getDashboard = useGetDashboardSummary()
|
||||||
@@ -131,6 +133,8 @@ const Home: FC = () => {
|
|||||||
className='flex-1 min-w-[40%] xl:!min-w-[20%] xl:p-6 p-4 flex flex-col'
|
className='flex-1 min-w-[40%] xl:!min-w-[20%] xl:p-6 p-4 flex flex-col'
|
||||||
isQuikAccess
|
isQuikAccess
|
||||||
businessName={item.userSubscription.businessName}
|
businessName={item.userSubscription.businessName}
|
||||||
|
isLinkPanel
|
||||||
|
onMoreClick={() => setShowModal(true)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -8,11 +8,12 @@ import { MyServicesItem } from '../../service/types/ServiecTypes'
|
|||||||
import PageLoading from '../../../components/PageLoading'
|
import PageLoading from '../../../components/PageLoading'
|
||||||
import { useGetQuikAccess, useQuikAccess, useRemoveQuikAccess } from '../hooks/useHomeData'
|
import { useGetQuikAccess, useQuikAccess, useRemoveQuikAccess } from '../hooks/useHomeData'
|
||||||
import ChangeQuikAccess from './ChangeQuikAccess'
|
import ChangeQuikAccess from './ChangeQuikAccess'
|
||||||
|
import { useHomeStore } from '../store/HomeStore'
|
||||||
|
|
||||||
const BoxNewAccessbility: FC = () => {
|
const BoxNewAccessbility: FC = () => {
|
||||||
|
|
||||||
|
const { showModal, setShowModal } = useHomeStore()
|
||||||
const [search, setSearch] = useState<string>('')
|
const [search, setSearch] = useState<string>('')
|
||||||
const [open, setOpen] = useState<boolean>(false)
|
|
||||||
const { t } = useTranslation('global')
|
const { t } = useTranslation('global')
|
||||||
const getMyservices = useGetMyServices(search)
|
const getMyservices = useGetMyServices(search)
|
||||||
const getQuikAccess = useGetQuikAccess()
|
const getQuikAccess = useGetQuikAccess()
|
||||||
@@ -38,7 +39,7 @@ const BoxNewAccessbility: FC = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
onClick={() => setOpen(true)}
|
onClick={() => setShowModal(true)}
|
||||||
className="flex-1 min-w-[40%] xl:p-6 p-4 xl:min-w-[20%] flex justify-center items-center min-h-[152px]"
|
className="flex-1 min-w-[40%] xl:p-6 p-4 xl:min-w-[20%] flex justify-center items-center min-h-[152px]"
|
||||||
style={{
|
style={{
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
@@ -76,8 +77,8 @@ const BoxNewAccessbility: FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<DefaulModal
|
<DefaulModal
|
||||||
open={open}
|
open={showModal}
|
||||||
close={() => setOpen(false)}
|
close={() => setShowModal(false)}
|
||||||
isHeader={true}
|
isHeader={true}
|
||||||
title_header={t('home.create_new_access')}
|
title_header={t('home.create_new_access')}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { create } from "zustand";
|
||||||
|
import { HomeStoreType } from "../types/HomeTypes";
|
||||||
|
|
||||||
|
export const useHomeStore = create<HomeStoreType>((set) => ({
|
||||||
|
showModal: false,
|
||||||
|
setShowModal(value) {
|
||||||
|
set({ showModal: value });
|
||||||
|
},
|
||||||
|
}));
|
||||||
@@ -18,3 +18,8 @@ export type QuikAccessItemType = {
|
|||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type HomeStoreType = {
|
||||||
|
showModal: boolean;
|
||||||
|
setShowModal: (value: boolean) => void;
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user