Skip to content

Commit

Permalink
fix Map layout
Browse files Browse the repository at this point in the history
  • Loading branch information
denisprado committed Jul 17, 2024
1 parent 40ca25b commit 264ac0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/app/(app)/[works]/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export default async function Work({ params }: { params: { slug: string } }) {

const gallery: WorkType['gallery'] = work?.gallery as WorkType['gallery'];

const children = description?.root.children

return (
<PageContainer key={work.id} className="mt-4">
Expand All @@ -42,11 +41,11 @@ export default async function Work({ params }: { params: { slug: string } }) {

<PageTitle align="start">{title}</PageTitle>

<div className="grid grid-cols-12 justify-center w-full gap-4 md:gap-6 lg:gap-8">
{children && children.text && <div className="col-span-full md:col-span-7">
{serializeLexical({ nodes: description?.root?.children })}
</div>}
<div className={classNames("col-span-full md:col-span-5", children && !children.text && "col-span-full md:col-span-full")}>
<div className="grid grid-cols-12 justify-center w-full gap-4 md:gap-4 lg:gap-6">
<div className="col-span-full">
{serializeLexical({ nodes: description!.root?.children })}
</div>
<div className={"col-span-full"}>
<Map hasCoordinates={hasCoordinates} work={work} height="800"></Map>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Map = (props:
}) => {
const height = props.height ?? '450'
return (
props.hasCoordinates(props.work?.coordenadas) && <div className="w-full border-2 rounded-lg p-2">
props.hasCoordinates(props.work?.coordenadas) && <div className="w-full">
<iframe src={`https://www.google.com/maps/embed/v1/streetview?key=AIzaSyBFQ2XvHhidZ5rCrKnJ9GZMzldlkTUsRKQ&location=${props.work?.coordenadas?.longitude!},${props.work?.coordenadas?.latitude!}&heading=161&pitch=10&fov=35&`} width="100%" height={height} allowFullScreen={true} loading="lazy" referrerPolicy="no-referrer-when-downgrade"></iframe>
</div>)
};
Expand Down

0 comments on commit 264ac0c

Please sign in to comment.