From f7ed0f2d0732237b00fbc7481c61326d4b11321d Mon Sep 17 00:00:00 2001 From: sina_sajjadi Date: Thu, 26 Dec 2024 16:45:37 +0330 Subject: [PATCH] feat: add subscription page and dashboard widget, update routes and translations --- .../image/subscriptions/Frame 1000005697.webp | Bin 0 -> 9122 bytes public/locales/en/common.json | 6 +++ src/components/dashboard/admin.tsx | 6 ++- .../widgets/subscription/subscription.tsx | 35 ++++++++++++++++++ src/config/routes.ts | 1 + src/data/subscription.ts | 7 ++++ src/data/user.ts | 2 +- src/pages/index.tsx | 6 +-- src/pages/subscriptions.tsx | 24 ++++++++++++ src/settings/site.settings.ts | 5 +++ 10 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 public/image/subscriptions/Frame 1000005697.webp create mode 100644 src/components/dashboard/widgets/subscription/subscription.tsx create mode 100644 src/data/subscription.ts create mode 100644 src/pages/subscriptions.tsx diff --git a/public/image/subscriptions/Frame 1000005697.webp b/public/image/subscriptions/Frame 1000005697.webp new file mode 100644 index 0000000000000000000000000000000000000000..1cf6069deb6c998d2978fe20198393a1cf771a04 GIT binary patch literal 9122 zcmcgx1y3AMvt4A7#hv2rUYz2#xLc7zDekruU0e$kE5)_AySo&3En3{&WnaJdz2ESX zncU1IliZV>Gn0EqQ$bEHjTQjVla*4}RTtC;0RRB(f4&3+i~|6Y%Ie^)e-WHB_MgV& zRTPBL)dR6$U@3>Vpc#JT7Cn9iaH3Z+-U^Lw_9(Ufb^NlJ0D^T;t@T5T~slyr<~)=JjZ z0?#zF7ct$Qjl?VS&5hz5N<9Jpuu~<_007mKfJ``+W#9xrEFPS#OkY6ri|TS2yBZhO z#_6(-D!9wVQmm;WBhJ>oxk#U1XqiScDzQvk zvoWi1rfk4~YQow7JK?*vDZlN~0vpv^qKJI{ll-oy1DS^g4f#i%e1u11_V58@-WG(kG9vwGwPHe`VGuU1vS1>+~`NR2$^4{O`I14>Eh&ppgP`&eZUq@x5SK_EEf zq~^sh2n@nve)9)-xYD1TXF!7Wmtjs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index 57813e0..56d5c8d 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -58,6 +58,7 @@ "sidebar-nav-item-users": "Users", "sidebar-nav-item-coupons": "Coupons", "sidebar-nav-item-taxes": "Taxes", + "sidebar-subscription": "Subscription", "sidebar-nav-item-shippings": "Shippings", "sidebar-nav-item-settings": "Settings", "sidebar-nav-item-store-notice": "Store Notice", @@ -375,6 +376,11 @@ "text-abuse-report-submitted": "Abusive report submitted successfully", "text-report": "Report", "text-summary": "Summary", + "text-7day-subscription": "You have a 7-day free subscription.", + "text-1-month-subscription": "You have a 1-Month free subscription.", + "text-3-month-subscription": "You have a 3-Month free subscription.", + "text-6-month-subscription": "You have a 6-Month free subscription.", + "text-1-year-subscription": "You have a 1-Year free subscription.", "text-campaign": "campaign", "text-pending-order": "Pending Order", "text-processing-order": "Processing Order", diff --git a/src/components/dashboard/admin.tsx b/src/components/dashboard/admin.tsx index 088dfbd..add17e9 100644 --- a/src/components/dashboard/admin.tsx +++ b/src/components/dashboard/admin.tsx @@ -28,6 +28,8 @@ import { ShoppingIcon } from '@/components/icons/summary/shopping'; import { BasketIcon } from '@/components/icons/summary/basket'; import { ChecklistIcon } from '@/components/icons/summary/checklist'; import Search from '@/components/common/search'; +import { getAuthCredentials } from '@/utils/auth-utils'; +import Subscription from './widgets/subscription/subscription'; // const TotalOrderByStatus = dynamic( // () => import('@/components/dashboard/total-order-by-status') @@ -64,7 +66,8 @@ export default function Dashboard() { const [orderDataRange, setOrderDataRange] = useState( data?.todayTotalOrderByStatus, ); - console.log(data); + const token = getAuthCredentials(); + const { price: total_revenue } = usePrice( data && { @@ -192,6 +195,7 @@ export default function Dashboard() { return (
+

diff --git a/src/components/dashboard/widgets/subscription/subscription.tsx b/src/components/dashboard/widgets/subscription/subscription.tsx new file mode 100644 index 0000000..799ccbd --- /dev/null +++ b/src/components/dashboard/widgets/subscription/subscription.tsx @@ -0,0 +1,35 @@ +// components/Subscription.tsx +import Image from 'next/image'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +const Subscription: React.FC = () => { + const { t } = useTranslation('common'); // Specify the namespace if using multiple + return ( +
+
+

+ {/* {t('text-7day-subscription')} */} + You have a 7-day free subscription. +

+
+ +

5 days left

+
+
+ + {/*
*/} +
{/* Use relative positioning for next/image with fill */} + subscription plan +
+ {/*
*/} +
+ ); +}; + +export default Subscription; diff --git a/src/config/routes.ts b/src/config/routes.ts index 1bcf6c2..f937e9c 100644 --- a/src/config/routes.ts +++ b/src/config/routes.ts @@ -22,6 +22,7 @@ export const Routes = { checkout: '/orders/checkout', verifyEmail: '/verify-email', verifyLicense: '/verify-license', + subscriptions: '/subscriptions', user: { ...routesFactory('/users'), }, diff --git a/src/data/subscription.ts b/src/data/subscription.ts new file mode 100644 index 0000000..5c1f611 --- /dev/null +++ b/src/data/subscription.ts @@ -0,0 +1,7 @@ +import { useQuery } from "react-query"; +import { API_ENDPOINTS } from "./client/api-endpoints"; +import { HttpClient } from "./client/http-client"; + +export const useGetActiveSubscription = () => { + return useQuery([API_ENDPOINTS.GET_ACTIVE_SUBSCRIPTION], () => HttpClient.get(API_ENDPOINTS.GET_ACTIVE_SUBSCRIPTION)); +}; \ No newline at end of file diff --git a/src/data/user.ts b/src/data/user.ts index 848d552..bde9ac8 100644 --- a/src/data/user.ts +++ b/src/data/user.ts @@ -52,7 +52,7 @@ console.log(err); return; } queryClient.clear(); - // router.replace(Routes.login); + router.replace(Routes.login); } }, }); diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 77e9496..172244b 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -35,10 +35,8 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { locale !== Config.defaultLanguage ? `/${locale}${Routes.login}` : Routes.login; - const { token, permissions } = getAuthCredentials(ctx); // if ( - // !isAuthenticated({ token, permissions }) || - // !hasAccess(allowedRoles, permissions) + // !isAuthenticated({ token, permissions }) // ) { // return { // redirect: { @@ -47,6 +45,8 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { // }, // }; // } + + if (locale) { return { props: { diff --git a/src/pages/subscriptions.tsx b/src/pages/subscriptions.tsx new file mode 100644 index 0000000..c2a53a8 --- /dev/null +++ b/src/pages/subscriptions.tsx @@ -0,0 +1,24 @@ +import React from 'react'; +import { useTranslation } from 'react-i18next'; +import Layout from '@/components/layouts/admin'; + +const Subscription: React.FC = () => { + const { t } = useTranslation(); + + return ( +
+

{t('subscription.title')}

+

{t('subscription.description')}

+
+ ); +}; + +export default Subscription; + +Subscription.Layout = Layout; + +// export const getStaticProps = async ({ locale }: any) => ({ +// props: { +// ...(await serverSideTranslations(locale, ['table', 'common', 'form'])), +// }, +// }); diff --git a/src/settings/site.settings.ts b/src/settings/site.settings.ts index bd32cba..a5b411b 100644 --- a/src/settings/site.settings.ts +++ b/src/settings/site.settings.ts @@ -213,6 +213,11 @@ export const siteSettings = { label: 'text-e-commerce-management', icon: 'WithdrawIcon', childMenu: [ + { + href: Routes.subscriptions, + label: 'sidebar-subscription', + icon: 'TaxesIcon', + }, { href: Routes.tax.list, label: 'sidebar-nav-item-taxes',