Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

refactor(web): update pricing Rive art layout and sizing

Richie McIlroy93d222f31f5c
diff --git a/apps/web/components/pages/HomePage/Pricing/CommercialArt.tsx b/apps/web/components/pages/HomePage/Pricing/CommercialArt.tsx
index 2e762a35a..277ea937c 100644
--- a/apps/web/components/pages/HomePage/Pricing/CommercialArt.tsx
+++ b/apps/web/components/pages/HomePage/Pricing/CommercialArt.tsx
@@ -1,5 +1,5 @@
-import { Fit, Layout, useRive } from "@rive-app/react-canvas";
-import clsx from "clsx";
+import { classNames } from "@cap/utils";
+import { Alignment, Fit, Layout, useRive } from "@rive-app/react-canvas";
import { forwardRef, memo, useImperativeHandle } from "react";
export interface CommercialArtRef {
@@ -7,19 +7,20 @@ export interface CommercialArtRef {
playDefaultAnimation: () => void;
}
-interface Props {
+interface CommercialArtProps {
className?: string;
}
export const CommercialArt = memo(
- forwardRef<CommercialArtRef, Props>((props, ref) => {
+ forwardRef<CommercialArtRef, CommercialArtProps>(({ className }, ref) => {
const { rive, RiveComponent: CommercialRive } = useRive({
src: "/rive/pricing.riv",
artboard: "commercial",
animations: "idle",
autoplay: false,
layout: new Layout({
- fit: Fit.Cover,
+ fit: Fit.Contain,
+ alignment: Alignment.CenterLeft,
}),
});
@@ -39,12 +40,9 @@ export const CommercialArt = memo(
}));
return (
- <CommercialRive
- className={clsx(
- "w-full max-w-[100px] mx-auto h-[90px]",
- props.className,
- )}
- />
+ <CommercialRive className={classNames("w-full h-full", className)} />
);
}),
);
+
+CommercialArt.displayName = "CommercialArt";
diff --git a/apps/web/components/pages/HomePage/Pricing/EnterpriseArt.tsx b/apps/web/components/pages/HomePage/Pricing/EnterpriseArt.tsx
index 0ae729f9a..2cb173c0f 100644
--- a/apps/web/components/pages/HomePage/Pricing/EnterpriseArt.tsx
+++ b/apps/web/components/pages/HomePage/Pricing/EnterpriseArt.tsx
@@ -1,5 +1,5 @@
-import { Fit, Layout, useRive } from "@rive-app/react-canvas";
-import clsx from "clsx";
+import { classNames } from "@cap/utils";
+import { Alignment, Fit, Layout, useRive } from "@rive-app/react-canvas";
import { forwardRef, memo, useImperativeHandle } from "react";
export interface EnterpriseArtRef {
@@ -20,6 +20,7 @@ export const EnterpriseArt = memo(
autoplay: false,
layout: new Layout({
fit: Fit.Contain,
+ alignment: Alignment.CenterLeft,
}),
});
@@ -37,9 +38,9 @@ export const EnterpriseArt = memo(
}));
return (
- <EnterpriseRive
- className={clsx(className, "mx-auto w-full max-w-[200px] h-[120px]")}
- />
+ <EnterpriseRive className={classNames("w-full h-full", className)} />
);
}),
);
+
+EnterpriseArt.displayName = "EnterpriseArt";
diff --git a/apps/web/components/pages/HomePage/Pricing/ProArt.tsx b/apps/web/components/pages/HomePage/Pricing/ProArt.tsx
index c9588e377..12e9e80de 100644
--- a/apps/web/components/pages/HomePage/Pricing/ProArt.tsx
+++ b/apps/web/components/pages/HomePage/Pricing/ProArt.tsx
@@ -1,5 +1,5 @@
-import { Fit, Layout, useRive } from "@rive-app/react-canvas";
-import clsx from "clsx";
+import { classNames } from "@cap/utils";
+import { Alignment, Fit, Layout, useRive } from "@rive-app/react-canvas";
import { forwardRef, memo, useImperativeHandle } from "react";
export interface ProArtRef {
@@ -20,6 +20,7 @@ export const ProArt = memo(
autoplay: false,
layout: new Layout({
fit: Fit.Contain,
+ alignment: Alignment.CenterLeft,
}),
});
@@ -38,10 +39,8 @@ export const ProArt = memo(
},
}));
- return (
- <ProRive
- className={clsx(className, "mx-auto w-full max-w-[100px] h-[80px]")}
- />
- );
+ return <ProRive className={classNames("w-full h-full", className)} />;
}),
);
+
+ProArt.displayName = "ProArt";