chore: replace function expression with inline statement
replace destructuring for better static analysis remove unused variables
This commit is contained in:
@@ -18,7 +18,7 @@ export default async function MyPages({
|
||||
setLang(params.lang)
|
||||
|
||||
const accountPageRes = await serverClient().contentstack.accountPage.get()
|
||||
const { formatMessage } = await getIntl()
|
||||
const intl = await getIntl()
|
||||
|
||||
if (!accountPageRes) {
|
||||
return null
|
||||
@@ -33,7 +33,7 @@ export default async function MyPages({
|
||||
{accountPage.content?.length ? (
|
||||
<Blocks blocks={accountPage.content} />
|
||||
) : (
|
||||
<p>{formatMessage({ id: "No content published" })}</p>
|
||||
<p>{intl.formatMessage({ id: "No content published" })}</p>
|
||||
)}
|
||||
</main>
|
||||
<TrackingSDK pageData={tracking} />
|
||||
|
||||
@@ -13,15 +13,15 @@ export default async function CommunicationSlot({
|
||||
}: PageArgs<LangParams>) {
|
||||
setLang(params.lang)
|
||||
|
||||
const { formatMessage } = await getIntl()
|
||||
const intl = await getIntl()
|
||||
return (
|
||||
<section className={styles.container}>
|
||||
<article className={styles.content}>
|
||||
<Subtitle type="two" color="black">
|
||||
{formatMessage({ id: "My communication preferences" })}
|
||||
{intl.formatMessage({ id: "My communication preferences" })}
|
||||
</Subtitle>
|
||||
<Body color="black">
|
||||
{formatMessage({
|
||||
{intl.formatMessage({
|
||||
id: "Tell us what information and updates you'd like to receive, and how, by clicking the link below.",
|
||||
})}
|
||||
</Body>
|
||||
|
||||
@@ -13,17 +13,17 @@ import { LangParams, PageArgs } from "@/types/params"
|
||||
|
||||
export default async function CreditCardSlot({ params }: PageArgs<LangParams>) {
|
||||
setLang(params.lang)
|
||||
const { formatMessage } = await getIntl()
|
||||
const intl = await getIntl()
|
||||
const creditCards = await serverClient().user.creditCards()
|
||||
|
||||
return (
|
||||
<section className={styles.container}>
|
||||
<article className={styles.content}>
|
||||
<Subtitle type="two" color="black">
|
||||
{formatMessage({ id: "My payment cards" })}
|
||||
{intl.formatMessage({ id: "My payment cards" })}
|
||||
</Subtitle>
|
||||
<Body color="black">
|
||||
{formatMessage({
|
||||
{intl.formatMessage({
|
||||
id: "Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.",
|
||||
})}
|
||||
</Body>
|
||||
|
||||
@@ -15,14 +15,14 @@ export default async function MembershipCardSlot({
|
||||
params,
|
||||
}: PageArgs<LangParams>) {
|
||||
setLang(params.lang)
|
||||
const { formatMessage } = await getIntl()
|
||||
const intl = await getIntl()
|
||||
const membershipCards = await getMembershipCards()
|
||||
|
||||
return (
|
||||
<section className={styles.container}>
|
||||
<article className={styles.content}>
|
||||
<Subtitle color="black">
|
||||
{formatMessage({ id: "My membership cards" })}
|
||||
{intl.formatMessage({ id: "My membership cards" })}
|
||||
</Subtitle>
|
||||
</article>
|
||||
{membershipCards &&
|
||||
@@ -41,7 +41,7 @@ export default async function MembershipCardSlot({
|
||||
<Link href="#" variant="icon">
|
||||
<PlusCircleIcon color="burgundy" />
|
||||
<Body color="burgundy" textTransform="underlined">
|
||||
{formatMessage({ id: "Add new card" })}
|
||||
{intl.formatMessage({ id: "Add new card" })}
|
||||
</Body>
|
||||
</Link>
|
||||
</section>
|
||||
|
||||
@@ -24,7 +24,7 @@ import { LangParams, PageArgs } from "@/types/params"
|
||||
|
||||
export default async function Profile({ params }: PageArgs<LangParams>) {
|
||||
setLang(params.lang)
|
||||
const { formatMessage } = await getIntl()
|
||||
const intl = await getIntl()
|
||||
const user = await getProfile()
|
||||
if (!user || "error" in user) {
|
||||
return null
|
||||
@@ -37,7 +37,7 @@ export default async function Profile({ params }: PageArgs<LangParams>) {
|
||||
<Header>
|
||||
<hgroup>
|
||||
<Title as="h4" color="red" level="h1" textTransform="capitalize">
|
||||
{formatMessage({ id: "Welcome" })}
|
||||
{intl.formatMessage({ id: "Welcome" })}
|
||||
</Title>
|
||||
<Title as="h4" color="burgundy" level="h2" textTransform="capitalize">
|
||||
{user.name}
|
||||
@@ -45,7 +45,7 @@ export default async function Profile({ params }: PageArgs<LangParams>) {
|
||||
</hgroup>
|
||||
<Button asChild intent="primary" size="small" theme="base">
|
||||
<Link prefetch={false} color="none" href={profileEdit[params.lang]}>
|
||||
{formatMessage({ id: "Edit profile" })}
|
||||
{intl.formatMessage({ id: "Edit profile" })}
|
||||
</Link>
|
||||
</Button>
|
||||
</Header>
|
||||
@@ -54,35 +54,35 @@ export default async function Profile({ params }: PageArgs<LangParams>) {
|
||||
<div className={styles.item}>
|
||||
<CalendarIcon color="burgundy" />
|
||||
<Body color="burgundy" textTransform="bold">
|
||||
{formatMessage({ id: "Date of Birth" })}
|
||||
{intl.formatMessage({ id: "Date of Birth" })}
|
||||
</Body>
|
||||
<Body color="burgundy">{user.dateOfBirth}</Body>
|
||||
</div>
|
||||
<div className={styles.item}>
|
||||
<PhoneIcon color="burgundy" />
|
||||
<Body color="burgundy" textTransform="bold">
|
||||
{formatMessage({ id: "Phone number" })}
|
||||
{intl.formatMessage({ id: "Phone number" })}
|
||||
</Body>
|
||||
<Body color="burgundy">{user.phoneNumber}</Body>
|
||||
</div>
|
||||
<div className={styles.item}>
|
||||
<GlobeIcon color="burgundy" />
|
||||
<Body color="burgundy" textTransform="bold">
|
||||
{formatMessage({ id: "Language" })}
|
||||
{intl.formatMessage({ id: "Language" })}
|
||||
</Body>
|
||||
<Body color="burgundy">{language?.label ?? defaultLanguage}</Body>
|
||||
</div>
|
||||
<div className={styles.item}>
|
||||
<EmailIcon color="burgundy" />
|
||||
<Body color="burgundy" textTransform="bold">
|
||||
{formatMessage({ id: "Email" })}
|
||||
{intl.formatMessage({ id: "Email" })}
|
||||
</Body>
|
||||
<Body color="burgundy">{user.email}</Body>
|
||||
</div>
|
||||
<div className={styles.item}>
|
||||
<LocationIcon color="burgundy" />
|
||||
<Body color="burgundy" textTransform="bold">
|
||||
{formatMessage({ id: "Address" })}
|
||||
{intl.formatMessage({ id: "Address" })}
|
||||
</Body>
|
||||
<Body color="burgundy">
|
||||
{user.address.streetAddress
|
||||
@@ -100,7 +100,7 @@ export default async function Profile({ params }: PageArgs<LangParams>) {
|
||||
<div className={styles.item}>
|
||||
<LockIcon color="burgundy" />
|
||||
<Body color="burgundy" textTransform="bold">
|
||||
{formatMessage({ id: "Password" })}
|
||||
{intl.formatMessage({ id: "Password" })}
|
||||
</Body>
|
||||
<Body color="burgundy">**********</Body>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user