feat(WEB-128): desktop and mobile initial wireframe implemented
This commit is contained in:
33
components/MyPages/Header/Logo/index.tsx
Normal file
33
components/MyPages/Header/Logo/index.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { request } from "@/lib/request"
|
||||
import { GetMyPagesLogo } from "@/lib/graphql/Query/Logo.graphql"
|
||||
|
||||
import Image from "@/components/Image"
|
||||
import Link from "next/link"
|
||||
|
||||
import styles from "./logo.module.css"
|
||||
|
||||
import type { LangParams } from "@/types/params"
|
||||
import type { LogoQueryData } from "@/types/requests/myPages/logo"
|
||||
|
||||
export default async function Logo({ lang }: LangParams) {
|
||||
const { data } = await request<LogoQueryData>(GetMyPagesLogo, {
|
||||
locale: lang,
|
||||
})
|
||||
if (
|
||||
!data.all_header.items.length ||
|
||||
!data.all_header.items?.[0].logoConnection.totalCount
|
||||
) {
|
||||
return null
|
||||
}
|
||||
const logo = data.all_header.items[0].logoConnection.edges[0]
|
||||
return (
|
||||
<Link className={styles.link} href="#">
|
||||
<Image
|
||||
alt={logo.node.title}
|
||||
height={logo.node.dimension.height}
|
||||
src={logo.node.url}
|
||||
width={logo.node.dimension.width}
|
||||
/>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
4
components/MyPages/Header/Logo/logo.module.css
Normal file
4
components/MyPages/Header/Logo/logo.module.css
Normal file
@@ -0,0 +1,4 @@
|
||||
.link {
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
}
|
||||
Reference in New Issue
Block a user