Skip to content

Commit 5a6f8c1

Browse files
committed
........
1 parent 486016d commit 5a6f8c1

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

app/component/form/previewDetails.tsx

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,25 @@ export const PreviewDetails = ({
3737
const bg = useMotionTemplate`rgba(0,0,0,${bgOpacity})`;
3838
const [isMobile, setIsMobile] = useState(false);
3939

40-
const [isSmallHeight, setIsSmallHeight] = useState(false);
40+
const [isSmallHeight, setIsSmallHeight] = useState(false);
41+
const [isSmallWidth, setIsSmallWidth] = useState(false);
4142

4243
useEffect(() => {
4344
const checkHeight = () => setIsSmallHeight(window.innerHeight <= 1020);
45+
const checkWidth = () => setIsSmallWidth(window.innerWidth <= 760);
46+
47+
// run once on mount
4448
checkHeight();
49+
checkWidth();
50+
51+
// add resize listeners
4552
window.addEventListener("resize", checkHeight);
46-
return () => window.removeEventListener("resize", checkHeight);
53+
window.addEventListener("resize", checkWidth);
54+
55+
return () => {
56+
window.removeEventListener("resize", checkHeight);
57+
window.removeEventListener("resize", checkWidth);
58+
};
4759
}, []);
4860

4961

@@ -62,29 +74,32 @@ useEffect(() => {
6274
>
6375
<Magnetic intensity={0.1} actionArea="global" range={200}>
6476
<div
65-
style={{ maxHeight: "1020px",
66-
transform: isSmallHeight ? "scale(0.8)" : "",}}
77+
style={{ maxHeight: "1080px",
78+
maxWidth: "760px",
79+
transform: isSmallHeight || isSmallWidth ? "" : "scale(1)",}}
6780
className="
6881
max-[760px]:sticky max-[760px]:top-0
6982
max-[760px]:overflow-y-scroll
7083
7184
h-full
72-
85+
max-[760px]:scale-[0.7]
7386
max-[760px]:h-screen
74-
75-
md:w-[450px]
87+
lg:scale-100
88+
xl:scale-100
89+
2xl:scale-100
90+
md:w-[450px]
7691
lg:w-[560px]
7792
xl:w-[600px]
7893
2xl:w-[640px]
7994
w-full
8095
mx-auto
81-
overflow-hidden bg-white mt-0 rounded-2xl shadow-md shadow-slate-200 max-[760px]:shadow-gray-400 border border-dashed max-[760px]:border-none justify-center items-center">
96+
overflow-hidden bg-white rounded-2xl shadow-md shadow-slate-200 max-[760px]:shadow-gray-400 border border-dashed max-[760px]:border-none justify-center items-center">
8297

8398
{/* Invoice Terms */}
8499
<HoverCard openDelay={0} closeDelay={0}>
85100
<HoverCardTrigger><InvoiceTermsPreview {...invoiceTerms} onClick={onClick} /></HoverCardTrigger>
86101
<HoverCardContent
87-
side="top"
102+
side="bottom"
88103
align="center"
89104
className="bg-black text-white text-xs w-fit pl-1.5 py-1.5 rounded-full shadow-lg flex items-center gap-2 font-medium animate-in fade-in-0 zoom-in-95 duration-100"
90105
>

app/new/component/NewInvoiceForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ export const NewInvoiceForm = () => {
6969

7070
<motion.div style={isMobile ? { backgroundColor: bg } : {}}
7171

72-
className=" min-h-[866px] max-[760px]:sticky max-[760px]:top-0 relative h-full w-full flex justify-center items-center p-4 md:p-0 shadow-slate-900 "
72+
className=" min-h-[866px] max-[760px]:sticky max-[760px]:top-0 relative h-full w-full flex justify-center items-center p-4 md:p-0 shadow-slate-900 "
7373
>
74-
<div className="absolute inset-0 -z-10 h-full w-full bg-[radial-gradient(#e5e7eb_0.5px,transparent_1px)] max-[760px]:bg-[radial-gradient(#C0C0C0_0.5px,transparent_1px)] [background-size:16px_16px]"></div>
74+
<div style={{transformOrigin: "bottom",}} className="absolute origin-bottom scale-y-150 inset-0 -z-10 h-full w-full bg-[radial-gradient(#e5e7eb_0.5px,transparent_1px)] max-[760px]:bg-[radial-gradient(#C0C0C0_0.5px,transparent_1px)] [background-size:16px_16px]"></div>
7575

7676
<UserDataPreview />
7777
</motion.div>

0 commit comments

Comments
 (0)