From ada58dca9d8b8b5c30a33ad2ebbeb2c73e92946c Mon Sep 17 00:00:00 2001
From: Sharad Kumar <5488144+SharadKumar@users.noreply.github.com>
Date: Sun, 11 Feb 2024 10:14:06 +1100
Subject: [PATCH] Centralise the store name in store.config.json
---
.gitignore | 2 ++
src/app/[countryCode]/(checkout)/layout.tsx | 3 ++-
.../(main)/account/@dashboard/profile/page.tsx | 3 ++-
src/app/[countryCode]/(main)/account/@login/page.tsx | 4 ++--
.../[countryCode]/(main)/categories/[...category]/page.tsx | 3 ++-
src/app/[countryCode]/(main)/collections/[handle]/page.tsx | 3 ++-
src/app/[countryCode]/(main)/products/[handle]/page.tsx | 5 +++--
src/modules/account/components/register/index.tsx | 7 ++++---
src/modules/layout/components/side-menu/index.tsx | 3 ++-
src/modules/layout/templates/footer/index.tsx | 5 +++--
src/modules/layout/templates/nav/index.tsx | 3 ++-
store.config.json | 3 +++
tsconfig.json | 3 ++-
13 files changed, 31 insertions(+), 16 deletions(-)
diff --git a/.gitignore b/.gitignore
index 544f04ce8..1f3a967f4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,3 +46,5 @@ node_modules
.yarn
.swc
dump.rdb
+
+pnpm-lock.yaml
\ No newline at end of file
diff --git a/src/app/[countryCode]/(checkout)/layout.tsx b/src/app/[countryCode]/(checkout)/layout.tsx
index 517209709..05ecb9efe 100644
--- a/src/app/[countryCode]/(checkout)/layout.tsx
+++ b/src/app/[countryCode]/(checkout)/layout.tsx
@@ -1,6 +1,7 @@
import LocalizedClientLink from "@modules/common/components/localized-client-link"
import ChevronDown from "@modules/common/icons/chevron-down"
import MedusaCTA from "@modules/layout/components/medusa-cta"
+import { store } from "@config"
export default function CheckoutLayout({
children,
@@ -27,7 +28,7 @@ export default function CheckoutLayout({
href="/"
className="txt-compact-xlarge-plus text-ui-fg-subtle hover:text-ui-fg-base uppercase"
>
- Medusa Store
+ {store.name}
diff --git a/src/app/[countryCode]/(main)/account/@dashboard/profile/page.tsx b/src/app/[countryCode]/(main)/account/@dashboard/profile/page.tsx
index 7402992df..114f90299 100644
--- a/src/app/[countryCode]/(main)/account/@dashboard/profile/page.tsx
+++ b/src/app/[countryCode]/(main)/account/@dashboard/profile/page.tsx
@@ -8,10 +8,11 @@ import ProfilePassword from "@modules/account/components/profile-password"
import { getCustomer, listRegions } from "@lib/data"
import { notFound } from "next/navigation"
+import { store } from "@config"
export const metadata: Metadata = {
title: "Profile",
- description: "View and edit your Medusa Store profile.",
+ description: `View and edit your ${store.name} profile.`,
}
export default async function Profile() {
diff --git a/src/app/[countryCode]/(main)/account/@login/page.tsx b/src/app/[countryCode]/(main)/account/@login/page.tsx
index 848e21235..acd3308c6 100644
--- a/src/app/[countryCode]/(main)/account/@login/page.tsx
+++ b/src/app/[countryCode]/(main)/account/@login/page.tsx
@@ -1,10 +1,10 @@
import { Metadata } from "next"
-
+import { store } from "@config"
import LoginTemplate from "@modules/account/templates/login-template"
export const metadata: Metadata = {
title: "Sign in",
- description: "Sign in to your Medusa Store account.",
+ description: `Sign in to your ${store.name} account.`,
}
export default function Login() {
diff --git a/src/app/[countryCode]/(main)/categories/[...category]/page.tsx b/src/app/[countryCode]/(main)/categories/[...category]/page.tsx
index 74fd6584b..7bdd44f87 100644
--- a/src/app/[countryCode]/(main)/categories/[...category]/page.tsx
+++ b/src/app/[countryCode]/(main)/categories/[...category]/page.tsx
@@ -4,6 +4,7 @@ import { notFound } from "next/navigation"
import { getCategoryByHandle, listCategories, listRegions } from "@lib/data"
import CategoryTemplate from "@modules/categories/templates"
import { SortOptions } from "@modules/store/components/refinement-list/sort-products"
+import { store } from "@config"
type Props = {
params: { category: string[]; countryCode: string }
@@ -53,7 +54,7 @@ export async function generateMetadata({ params }: Props): Promise {
`${title} category.`
return {
- title: `${title} | Medusa Store`,
+ title: `${title} | ${store.name}`,
description,
alternates: {
canonical: `${params.category.join("/")}`,
diff --git a/src/app/[countryCode]/(main)/collections/[handle]/page.tsx b/src/app/[countryCode]/(main)/collections/[handle]/page.tsx
index 0289ed7e3..75aefe70d 100644
--- a/src/app/[countryCode]/(main)/collections/[handle]/page.tsx
+++ b/src/app/[countryCode]/(main)/collections/[handle]/page.tsx
@@ -8,6 +8,7 @@ import {
} from "@lib/data"
import CollectionTemplate from "@modules/collections/templates"
import { SortOptions } from "@modules/store/components/refinement-list/sort-products"
+import { store } from "@config"
type Props = {
params: { handle: string; countryCode: string }
@@ -54,7 +55,7 @@ export async function generateMetadata({ params }: Props): Promise {
}
const metadata = {
- title: `${collection.title} | Medusa Store`,
+ title: `${collection.title} | ${store.name}`,
description: `${collection.title} collection`,
} as Metadata
diff --git a/src/app/[countryCode]/(main)/products/[handle]/page.tsx b/src/app/[countryCode]/(main)/products/[handle]/page.tsx
index 9a11038ec..31a6a744c 100644
--- a/src/app/[countryCode]/(main)/products/[handle]/page.tsx
+++ b/src/app/[countryCode]/(main)/products/[handle]/page.tsx
@@ -2,6 +2,7 @@
import { Metadata } from "next"
import { notFound } from "next/navigation"
+import { store } from "@config"
import {
getProductByHandle,
@@ -58,10 +59,10 @@ export async function generateMetadata({ params }: Props): Promise {
}
return {
- title: `${product.title} | Medusa Store`,
+ title: `${product.title} | ${store.name}`,
description: `${product.title}`,
openGraph: {
- title: `${product.title} | Medusa Store`,
+ title: `${product.title} | ${store.name}`,
description: `${product.title}`,
images: product.thumbnail ? [product.thumbnail] : [],
},
diff --git a/src/modules/account/components/register/index.tsx b/src/modules/account/components/register/index.tsx
index 14e744e0a..72430ada7 100644
--- a/src/modules/account/components/register/index.tsx
+++ b/src/modules/account/components/register/index.tsx
@@ -8,6 +8,7 @@ import { signUp } from "@modules/account/actions"
import ErrorMessage from "@modules/checkout/components/error-message"
import { SubmitButton } from "@modules/checkout/components/submit-button"
import LocalizedClientLink from "@modules/common/components/localized-client-link"
+import { store } from "@config"
type Props = {
setCurrentView: (view: LOGIN_VIEW) => void
@@ -19,10 +20,10 @@ const Register = ({ setCurrentView }: Props) => {
return (
- Become a Medusa Store Member
+ Become a {store.name} Member
- Create your Medusa Store Member profile, and get access to an enhanced
+ Create your {store.name} Member profile, and get access to an enhanced
shopping experience.
- By creating an account, you agree to Medusa Store's{" "}
+ By creating an account, you agree to {store.name}'s{" "}
{
/>
- © {new Date().getFullYear()} Medusa Store. All rights
+ © {new Date().getFullYear()} {store.name}. All rights
reserved.
diff --git a/src/modules/layout/templates/footer/index.tsx b/src/modules/layout/templates/footer/index.tsx
index bf94b2f96..24c5789d6 100644
--- a/src/modules/layout/templates/footer/index.tsx
+++ b/src/modules/layout/templates/footer/index.tsx
@@ -1,6 +1,7 @@
import { Text, clx } from "@medusajs/ui"
import { getCategoriesList, getCollectionsList } from "@lib/data"
+import { store } from "@config"
import LocalizedClientLink from "@modules/common/components/localized-client-link"
import MedusaCTA from "../../components/medusa-cta"
@@ -31,7 +32,7 @@ export default async function Footer() {
href="/"
className="txt-compact-xlarge-plus text-ui-fg-subtle hover:text-ui-fg-base uppercase"
>
- Medusa Store
+ {store.name}
@@ -153,7 +154,7 @@ export default async function Footer() {
- © {new Date().getFullYear()} Medusa Store. All rights reserved.
+ © {new Date().getFullYear()} {store.name}. All rights reserved.
diff --git a/src/modules/layout/templates/nav/index.tsx b/src/modules/layout/templates/nav/index.tsx
index a4ccb6102..3f42e7f3d 100644
--- a/src/modules/layout/templates/nav/index.tsx
+++ b/src/modules/layout/templates/nav/index.tsx
@@ -5,6 +5,7 @@ import { listRegions } from "@lib/data"
import LocalizedClientLink from "@modules/common/components/localized-client-link"
import CartButton from "@modules/layout/components/cart-button"
import SideMenu from "@modules/layout/components/side-menu"
+import { store } from "@config"
export default async function Nav() {
const regions = await listRegions().then((regions) => regions)
@@ -24,7 +25,7 @@ export default async function Nav() {
href="/"
className="txt-compact-xlarge-plus hover:text-ui-fg-base uppercase"
>
- Medusa Store
+ {store.name}
diff --git a/store.config.json b/store.config.json
index e4df9fa66..063b747e7 100644
--- a/store.config.json
+++ b/store.config.json
@@ -1,5 +1,8 @@
{
"features": {
"search": false
+ },
+ "store": {
+ "name": "Medusa Store"
}
}
diff --git a/tsconfig.json b/tsconfig.json
index f5ced5f8e..d8160cd5b 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -19,7 +19,8 @@
"paths": {
"@lib/*": ["lib/*"],
"@modules/*": ["modules/*"],
- "@pages/*": ["pages/*"]
+ "@pages/*": ["pages/*"],
+ "@config": ["../store.config.json"]
},
"plugins": [
{