conversions

This commit is contained in:
Joel Varty
2021-01-16 14:26:51 -05:00
parent 2dd8d59ae7
commit 914d75dc8d
14 changed files with 854 additions and 27 deletions

View File

@@ -1,27 +1,39 @@
import {FC} from "react"
import { FC } from "react"
import * as AgilityTypes from "@agility/types"
import RichTextArea from "./RichTextArea"
import BestsellingProducts from "./BestsellingProducts"
import ProductDetails from "./ProductDetails"
import FeaturedProducts from "./FeaturedProducts"
import ProductListing from "./ProductListing"
import ProductSearch from "./ProductSearch"
import Hero from "./Hero"
import HomeAllProductsGrid from "./HomeAllProductsGrid"
import Cart from "./Cart"
import Orders from "./Orders"
import Profile from "./Profile"
import Wishlist from "./Wishlist"
const allModules =[
{ name: "RichTextArea", module:RichTextArea },
const allModules = [
{ name: "RichTextArea", module: RichTextArea },
{ name: "BestsellingProducts", module: BestsellingProducts },
{ name: "FeaturedProducts", module: FeaturedProducts},
{ name: "ProductListing", module: ProductListing},
{ name: "Hero", module: Hero},
{ name: "ProductDetails", module: ProductDetails }
{ name: "FeaturedProducts", module: FeaturedProducts },
{ name: "ProductListing", module: ProductListing },
{ name: "ProductSearch", module: ProductSearch },
{ name: "Hero", module: Hero },
{ name: "ProductDetails", module: ProductDetails },
{ name: "HomeAllProductsGrid", module: HomeAllProductsGrid },
{ name: "Cart", module: Cart },
{ name: "Orders", module: Orders },
{ name: "Profile", module: Profile},
{ name: "Wishlist", module: Wishlist}
]
/**
* Find the component for a module.
* Find the component for a module by name.
* @param moduleName
*/
const getModule = (moduleName:string):any | null => {
const getModule = (moduleName: string): any | null => {
const obj = allModules.find(m => m.name.toLowerCase() === moduleName.toLowerCase())
if (!obj) return null
return obj.module