Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centralise the store name in store.config.json #258

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ node_modules
.yarn
.swc
dump.rdb

pnpm-lock.yaml
3 changes: 2 additions & 1 deletion src/app/[countryCode]/(checkout)/layout.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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}
</LocalizedClientLink>
<div className="flex-1 basis-0" />
</nav>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions src/app/[countryCode]/(main)/account/@login/page.tsx
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -53,7 +54,7 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
`${title} category.`

return {
title: `${title} | Medusa Store`,
title: `${title} | ${store.name}`,
description,
alternates: {
canonical: `${params.category.join("/")}`,
Expand Down
3 changes: 2 additions & 1 deletion src/app/[countryCode]/(main)/collections/[handle]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -54,7 +55,7 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
}

const metadata = {
title: `${collection.title} | Medusa Store`,
title: `${collection.title} | ${store.name}`,
description: `${collection.title} collection`,
} as Metadata

Expand Down
5 changes: 3 additions & 2 deletions src/app/[countryCode]/(main)/products/[handle]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { Metadata } from "next"
import { notFound } from "next/navigation"
import { store } from "@config"

import {
getProductByHandle,
Expand Down Expand Up @@ -58,10 +59,10 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
}

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] : [],
},
Expand Down
7 changes: 4 additions & 3 deletions src/modules/account/components/register/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,10 +20,10 @@ const Register = ({ setCurrentView }: Props) => {
return (
<div className="max-w-sm flex flex-col items-center">
<h1 className="text-large-semi uppercase mb-6">
Become a Medusa Store Member
Become a {store.name} Member
</h1>
<p className="text-center text-base-regular text-ui-fg-base mb-4">
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.
</p>
<form className="w-full flex flex-col" action={formAction}>
Expand Down Expand Up @@ -57,7 +58,7 @@ const Register = ({ setCurrentView }: Props) => {
</div>
<ErrorMessage error={message} />
<span className="text-center text-ui-fg-base text-small-regular mt-6">
By creating an account, you agree to Medusa Store&apos;s{" "}
By creating an account, you agree to {store.name}&apos;s{" "}
<LocalizedClientLink
href="/content/privacy-policy"
className="underline"
Expand Down
3 changes: 2 additions & 1 deletion src/modules/layout/components/side-menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ArrowRightMini, XMark } from "@medusajs/icons"
import { Region } from "@medusajs/medusa"
import { Text, clx, useToggleState } from "@medusajs/ui"
import { Fragment } from "react"
import { store } from "@config"

import LocalizedClientLink from "@modules/common/components/localized-client-link"
import CountrySelect from "../country-select"
Expand Down Expand Up @@ -84,7 +85,7 @@ const SideMenu = ({ regions }: { regions: Region[] | null }) => {
/>
</div>
<Text className="flex justify-between txt-compact-small">
© {new Date().getFullYear()} Medusa Store. All rights
© {new Date().getFullYear()} {store.name}. All rights
reserved.
</Text>
</div>
Expand Down
5 changes: 3 additions & 2 deletions src/modules/layout/templates/footer/index.tsx
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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}
</LocalizedClientLink>
</div>
<div className="text-small-regular gap-10 md:gap-x-16 grid grid-cols-2 sm:grid-cols-3">
Expand Down Expand Up @@ -153,7 +154,7 @@ export default async function Footer() {
</div>
<div className="flex w-full mb-16 justify-between text-ui-fg-muted">
<Text className="txt-compact-small">
© {new Date().getFullYear()} Medusa Store. All rights reserved.
© {new Date().getFullYear()} {store.name}. All rights reserved.
</Text>
<MedusaCTA />
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/modules/layout/templates/nav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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}
</LocalizedClientLink>
</div>

Expand Down
3 changes: 3 additions & 0 deletions store.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"features": {
"search": false
},
"store": {
"name": "Medusa Store"
}
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"paths": {
"@lib/*": ["lib/*"],
"@modules/*": ["modules/*"],
"@pages/*": ["pages/*"]
"@pages/*": ["pages/*"],
"@config": ["../store.config.json"]
},
"plugins": [
{
Expand Down