mirror of
https://github.com/vercel/commerce.git
synced 2025-08-16 13:51:24 +00:00
.vscode
assets
components
agility-common
agility-global
agility-modules
BlogPostDetails.tsx
BlogPostListing.tsx
Cart.tsx
FeaturedProduct.tsx
Hero.tsx
Orders.tsx
ProductDetails.tsx
ProductListing.tsx
ProductMarquee.tsx
ProductSearch.tsx
Profile.tsx
RichTextArea.tsx
Wishlist.tsx
index.ts
agility-pageTemplates
auth
cart
checkout
common
icons
product
ui
wishlist
search.tsx
config
framework
lib
pages
public
.editorconfig
.env.template
.gitignore
.prettierignore
.prettierrc
README.md
codegen.bigcommerce.json
codegen.json
commerce.config.json
global.d.ts
jsconfig.json
license.md
next-env.d.ts
next.config.js
package.json
postcss.config.js
swell-js.d.ts
tailwind.config.js
tsconfig.js
tsconfig.json
yarn.lock
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
import RichTextArea from "./RichTextArea"
|
|
import ProductMarquee from "./ProductMarquee"
|
|
import ProductDetails from "./ProductDetails"
|
|
|
|
import ProductListing from "./ProductListing"
|
|
import ProductSearch from "./ProductSearch"
|
|
import Hero from "./Hero"
|
|
import HomeAllProductsGrid from "./ProductListing"
|
|
import Cart from "./Cart"
|
|
import Orders from "./Orders"
|
|
import Profile from "./Profile"
|
|
import Wishlist from "./Wishlist"
|
|
import BlogPostListing from "./BlogPostListing"
|
|
import BlogPostDetails from "./BlogPostDetails"
|
|
import FeaturedProduct from "./FeaturedProduct"
|
|
|
|
|
|
const allModules = [
|
|
{ name: "RichTextArea", module: RichTextArea },
|
|
{ name: "ProductMarquee", module: ProductMarquee },
|
|
{ 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 },
|
|
{ name: "BlogPostListing", module: BlogPostListing },
|
|
{ name: "BlogPostDetails", module: BlogPostDetails },
|
|
{ name: "FeaturedProduct", module: FeaturedProduct }
|
|
|
|
]
|
|
|
|
/**
|
|
* Find the component for a module by name.
|
|
* @param moduleName
|
|
*/
|
|
export const getModule = (moduleName: string): any | null => {
|
|
const obj = allModules.find(m => m.name.toLowerCase() === moduleName.toLowerCase())
|
|
if (!obj) return null
|
|
return obj.module
|
|
}
|