mirror of
https://github.com/vercel/commerce.git
synced 2025-07-27 04:01:23 +00:00
merged
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { FC } from 'react'
|
||||
|
||||
import useCustomer from '@framework/use-customer'
|
||||
import useCustomer from '@framework/customer/use-customer'
|
||||
import { Container, Text } from '@components/ui'
|
||||
import { Module } from '@agility/nextjs'
|
||||
|
||||
@@ -12,34 +12,30 @@ interface Fields {
|
||||
}
|
||||
|
||||
|
||||
const ProfileModule:Module<Fields> = ({ module: {fields}}) => {
|
||||
const ProfileModule: Module<Fields> = ({ module: { fields } }) => {
|
||||
|
||||
const { data } = useCustomer()
|
||||
return (
|
||||
<Container>
|
||||
<Text variant="pageHeading">{fields.heading}</Text>
|
||||
{data && (
|
||||
<div className="grid lg:grid-cols-12">
|
||||
<div className="lg:col-span-8 pr-4">
|
||||
<div>
|
||||
<Text variant="sectionHeading">{fields.fullNameLabel}</Text>
|
||||
<span>
|
||||
{data.firstName} {data.lastName}
|
||||
</span>
|
||||
</div>
|
||||
<div className="mt-5">
|
||||
<Text variant="sectionHeading">{fields.emailLabel}</Text>
|
||||
<span>{data.email}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{ !data &&
|
||||
<Text variant="body">{fields.notLoggedInMessage}</Text>
|
||||
}
|
||||
</Container>
|
||||
)
|
||||
return (
|
||||
<Container>
|
||||
<Text variant="pageHeading">My Profile</Text>
|
||||
{data && (
|
||||
<div className="grid lg:grid-cols-12">
|
||||
<div className="lg:col-span-8 pr-4">
|
||||
<div>
|
||||
<Text variant="sectionHeading">Full Name</Text>
|
||||
<span>
|
||||
{data.firstName} {data.lastName}
|
||||
</span>
|
||||
</div>
|
||||
<div className="mt-5">
|
||||
<Text variant="sectionHeading">Email</Text>
|
||||
<span>{data.email}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
|
||||
export default ProfileModule
|
||||
|
Reference in New Issue
Block a user