Merged in feat/mypages-parallel-routes (pull request #1388)

feat: my profile - removed all parallel routes

* Removed all parallel routes on my-profile

* Fixed suspense

* Moved components into myprofile folder

* Turn off browser cache on myprofile

* Clear router cache when editing profile

* Clear route cache when adding new credit card

* PR fixes


Approved-by: Joakim Jäderberg
This commit is contained in:
Linus Flood
2025-02-21 11:24:46 +00:00
parent 9cd648fd65
commit 15dbeb9d46
25 changed files with 205 additions and 247 deletions

View File

@@ -0,0 +1,22 @@
.container {
display: grid;
gap: var(--Spacing-x2);
justify-items: flex-start;
max-width: 510px;
}
.content {
display: grid;
gap: var(--Spacing-x1);
}
.cardContainer {
display: grid;
gap: var(--Spacing-x1);
}
@media screen and (min-width: 768px) {
.container {
gap: var(--Spacing-x3);
}
}

View File

@@ -0,0 +1,31 @@
import { serverClient } from "@/lib/trpc/server"
import AddCreditCardButton from "@/components/Profile/AddCreditCardButton"
import CreditCardList from "@/components/Profile/CreditCardList"
import Body from "@/components/TempDesignSystem/Text/Body"
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
import { getIntl } from "@/i18n"
import styles from "./creditCards.module.css"
export default async function CreditCardSlot() {
const intl = await getIntl()
const creditCards = await serverClient().user.creditCards()
return (
<section className={styles.container}>
<article className={styles.content}>
<Subtitle type="two" color="black">
{intl.formatMessage({ id: "My payment cards" })}
</Subtitle>
<Body color="black">
{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>
</article>
<CreditCardList initialData={creditCards} />
<AddCreditCardButton />
</section>
)
}