Skip to content

Commit

Permalink
allowed smaller screen to view hero component
Browse files Browse the repository at this point in the history
  • Loading branch information
fluid-design-io committed Oct 25, 2024
1 parent 364a1bf commit 368c848
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions components/landing/hero-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,21 @@ import { WindowExample } from "../examples/window";
import { ComponentWrapper } from "../component-wrapper";

export const HeroLayout = ({ children }: { children: React.ReactNode }) => {
const isDesktop = useMediaQuery("(min-width: 1024px)");
if (!isDesktop)
const isTablet = useMediaQuery("(min-width: 640px)");
const canRotate = useMediaQuery("(orientation: portrait)");
if (!isTablet)
return (
<div>
<Image src={heroImage} alt="hero" />
<p className="text-sm text-muted-foreground">
Use a larger screen to interact
</p>
{canRotate ? (
<p className="text-sm text-muted-foreground">
Try rotating your device to landscape
</p>
) : (
<p className="text-sm text-muted-foreground">
Use a larger screen to interact
</p>
)}
<div className="flex flex-col gap-4 p-6">
<ComponentWrapper className="flex flex-col gap-4" gradient>
<ButtonExample />
Expand Down

0 comments on commit 368c848

Please sign in to comment.