fix: whitelist server action proxies

This commit is contained in:
Simon Emanuelsson
2024-06-24 12:40:55 +02:00
parent 788bfd3568
commit be47e42163
9 changed files with 66 additions and 49 deletions

View File

@@ -1,7 +1,9 @@
import { languageSelect } from "@/constants/languages"
import { profileEdit } from "@/constants/routes/myPages"
import { serverClient } from "@/lib/trpc/server"
import {
CalendarIcon,
EmailIcon,
GlobeIcon,
LocationIcon,
@@ -10,7 +12,6 @@ import {
} from "@/components/Icons"
import Header from "@/components/Profile/Header"
import Button from "@/components/TempDesignSystem/Button"
import Divider from "@/components/TempDesignSystem/Divider"
import Link from "@/components/TempDesignSystem/Link"
import Body from "@/components/TempDesignSystem/Text/Body"
import Title from "@/components/TempDesignSystem/Text/Title"
@@ -26,26 +27,54 @@ export default async function Profile({ params }: PageArgs<LangParams>) {
if (!user) {
return null
}
const language = languageSelect.find((l) => l.value === user.language)
return (
<>
<Header>
<hgroup>
<Title as="h4" color="peach80" level="h1">
<Title as="h4" color="red" level="h1">
{formatMessage({ id: "Welcome" })}
</Title>
<Title as="h4" color="burgundy" level="h2">
{user.name}
</Title>
</hgroup>
<Button asChild intent="secondary" size="small" theme="base">
<Button asChild intent="primary" size="small" theme="base">
<Link color="none" href={profileEdit[params.lang]}>
{formatMessage({ id: "Edit profile" })}
</Link>
</Button>
</Header>
<Divider color="burgundy" opacity={8} />
<section className={styles.profile}>
<article className={styles.info}>
<div className={styles.item}>
<CalendarIcon color="burgundy" />
<Body color="burgundy" textTransform="bold">
{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" })}
</Body>
<Body color="burgundy">{user.phoneNumber}</Body>
</div>
<div className={styles.item}>
<GlobeIcon color="burgundy" />
<Body color="burgundy" textTransform="bold">
{formatMessage({ id: "Language" })}
</Body>
<Body color="burgundy">{language?.label ?? "N/A"}</Body>
</div>
<div className={styles.item}>
<EmailIcon color="burgundy" />
<Body color="burgundy" textTransform="bold">
{formatMessage({ id: "Email" })}
</Body>
<Body color="burgundy">{user.email}</Body>
</div>
<div className={styles.item}>
<LocationIcon color="burgundy" />
<Body color="burgundy" textTransform="bold">
@@ -64,29 +93,6 @@ export default async function Profile({ params }: PageArgs<LangParams>) {
: null}
</Body>
</div>
<div className={styles.item}>
<EmailIcon color="burgundy" />
<Body color="burgundy" textTransform="bold">
{formatMessage({ id: "Email" })}
</Body>
<Body color="burgundy">{user.email}</Body>
</div>
<div className={styles.item}>
<PhoneIcon color="burgundy" />
<Body color="burgundy" textTransform="bold">
{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" })}
</Body>
<Body color="burgundy">{user.language}</Body>
</div>
</article>
<aside>
<div className={styles.item}>
<LockIcon color="burgundy" />
<Body color="burgundy" textTransform="bold">
@@ -94,7 +100,7 @@ export default async function Profile({ params }: PageArgs<LangParams>) {
</Body>
<Body color="burgundy">**********</Body>
</div>
</aside>
</article>
</section>
</>
)