Skip to content

Commit

Permalink
modal tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
cdleveille committed Jun 1, 2024
1 parent fda8265 commit 9165bb4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
8 changes: 6 additions & 2 deletions src/app/@modal/(.)[name_slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { DiscDetail } from "@components";
import { DiscDetail, DiscModal } from "@components";

export default function DiscDetailPage({ params: { name_slug } }: { params: { name_slug: string } }) {
return <DiscDetail name_slug={name_slug} />;
return (
<DiscModal>
<DiscDetail name_slug={name_slug} />
</DiscModal>
);
}
21 changes: 12 additions & 9 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
user-select: none;
}

html,
body {
padding: 0 !important;
overflow: auto !important;
}

a {
text-decoration: none;
}
Expand Down Expand Up @@ -94,14 +88,23 @@ h1 {
.modal {
top: 0;
left: 0;
width: 100vw;
height: 100vh;
width: 100%;
height: 100%;
z-index: 1000;
display: flex;
justify-content: center;
align-items: center;
}

.disc-detail-container {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
width: 100%;
height: 100%;
}

.disc-detail {
display: flex;
flex-direction: column;
Expand All @@ -125,7 +128,7 @@ h1 {
flex-direction: column;
justify-content: center;
align-items: center;
row-gap: 0.5vmin;
row-gap: 0.75vmin;
}

.disc-detail-img-container {
Expand Down
6 changes: 3 additions & 3 deletions src/components/DiscDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import Image from "next/image";
import { useContext } from "react";

import { DiscContext, DiscModal } from "@components";
import { DiscContext } from "@components";
import { hexToRgba } from "@util";

import type { DiscDetailProps } from "@types";
Expand All @@ -29,7 +29,7 @@ export const DiscDetail = ({ name_slug }: DiscDetailProps) => {
const borderColor = hexToRgba(color, 0.25);

return (
<DiscModal>
<div className="disc-detail-container">
<div
className="disc-detail"
onClick={e => e.stopPropagation()}
Expand All @@ -49,6 +49,6 @@ export const DiscDetail = ({ name_slug }: DiscDetailProps) => {
<Image src={pic} alt={name} width={400} height={340} className="disc-detail-img" />
</div>
</div>
</DiscModal>
</div>
);
};

0 comments on commit 9165bb4

Please sign in to comment.