Skip to content

Commit 1a30195

Browse files
authored
Merge pull request #62 from pranav-deshmukh/dev
Refactored the demo loading logic to reduce redundancy and simplify component structure.
2 parents 2532c36 + cdb530d commit 1a30195

5 files changed

Lines changed: 21 additions & 427 deletions

File tree

src/pages/Home.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@ export const Home = () => {
1515
px-4 py-2 rounded-full text-sm font-medium mb-8"
1616
>
1717
<span className="w-2 h-2 bg-blue-400 dark:bg-blue-500 rounded-full mr-2"></span>
18-
Product Demo Platform
18+
Demo Platform
1919
</div>
2020

2121
<h1 className="text-5xl md:text-6xl font-bold text-gray-900 dark:text-white mb-8 leading-tight">
2222
Welcome to the Mifos
2323
<br />
24-
<span className="bg-gradient-to-r from-blue-600 to-blue-500 dark:from-blue-400 dark:to-blue-300 bg-clip-text text-transparent">
25-
Product
26-
</span>{' '}
2724
<span className="relative inline-block text-blue-600 dark:text-blue-300">
2825
Demo
2926
<div className="absolute left-0 right-0 -bottom-2 flex justify-center">
@@ -54,10 +51,10 @@ export const Home = () => {
5451
</h1>
5552

5653
<p className="text-xl text-gray-600 dark:text-gray-300 max-w-2xl leading-relaxed font-light mb-8 mx-auto lg:mx-0">
57-
Experience interactive demonstrations of our products — MifosX,
58-
Phee, and VNext. Explore comprehensive step-by-step guides
59-
designed to showcase the full potential of our financial
60-
technology solutions.
54+
Experience interactive demonstrations of our products and
55+
platform. Explore comprehensive step-by-step guides designed to
56+
showcase the full potential of our financial technology
57+
solutions.
6158
</p>
6259

6360
<a

src/pages/demo-list/DemoList.tsx

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
1-
import { lazy, Suspense } from 'react';
21
import { useParams } from 'react-router-dom';
2+
import { lazy, Suspense } from 'react';
33

4-
const demoComponentMap: Record<string, React.LazyExoticComponent<React.FC>> = {
5-
mifosx: lazy(() => import('./mifosx')),
6-
phee: lazy(() => import('./phee')),
7-
vnext: lazy(() => import('./vnext')),
8-
platform_demos: lazy(() => import('./platform-demos')),
9-
};
4+
const PlatformDemos = lazy(() => import('./platform-demos'));
5+
const ProductDemos = lazy(() => import('./product-demos'));
106

117
export const DemoList = () => {
128
const { product } = useParams();
139

14-
const Component = product ? demoComponentMap[product] : null;
15-
1610
return (
1711
<Suspense fallback={<div className="p-6 text-center">Loading demo...</div>}>
18-
{Component ? (
19-
<Component />
12+
{product === 'platform_demos' ? (
13+
<PlatformDemos />
2014
) : (
21-
<div className="p-6 text-center text-red-500">
22-
Invalid demo: {product}
23-
</div>
15+
<ProductDemos product={product as 'mifosx' | 'phee' | 'vnext'} />
2416
)}
2517
</Suspense>
2618
);

src/pages/demo-list/phee.tsx

Lines changed: 0 additions & 200 deletions
This file was deleted.
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ interface DemoData {
3131

3232
const columnHelper = createColumnHelper<DemoData>();
3333

34-
export default function MifosXDemos() {
34+
type ProductDemosProps = {
35+
product: 'mifosx' | 'phee' | 'vnext';
36+
};
37+
38+
export default function ProductDemos({ product }: ProductDemosProps) {
3539
const navigate = useNavigate();
3640
const NavigateToDemo = (id: string, demoName: string) => {
3741
const demoSlug = slugify(demoName, { lower: true });
@@ -110,12 +114,13 @@ export default function MifosXDemos() {
110114
<div className="max-w-7xl mx-auto">
111115
<div className="text-center mb-12">
112116
<h1 className="text-4xl font-bold text-gray-900 dark:text-white mb-4">
113-
MifosX Demo Center
117+
{product.toUpperCase()} Demo Center
114118
</h1>
115119
<p className="text-xl text-gray-600 dark:text-gray-300 max-w-3xl mx-auto leading-relaxed">
116-
Explore guided walkthroughs of key flows in the MifosX application.
117-
Each demo provides an interactive experience to help you understand
118-
our platform's capabilities.
120+
Explore guided walkthroughs of key flows in the{' '}
121+
{product.toUpperCase()} application. Each demo provides an
122+
interactive experience to help you understand our platform's
123+
capabilities.
119124
</p>
120125
</div>
121126

0 commit comments

Comments
 (0)