Skip to content

Commit

Permalink
✨ Add className prop to Hero block
Browse files Browse the repository at this point in the history
  • Loading branch information
Frontendland committed Jan 2, 2025
1 parent b93bf20 commit 640880a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/blocks/Hero/Hero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ const {
buttons,
badge,
image,
reverse
reverse,
className
} = Astro.props
const classes = [
styles.hero,
reverse && styles.reverse,
image?.src && styles.flex
image?.src && styles.flex,
className
]
---

Expand Down
6 changes: 4 additions & 2 deletions src/blocks/Hero/Hero.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
buttons,
badge,
image,
reverse
reverse,
className
}: HeroProps = $props()
const classes = classNames([
styles.hero,
reverse && styles.reverse,
image?.src && styles.flex
image?.src && styles.flex,
className
])
</script>

Expand Down
6 changes: 4 additions & 2 deletions src/blocks/Hero/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ const Hero = ({
buttons,
badge,
image,
reverse
reverse,
className
}: HeroProps) => {
const classes = classNames([
styles.hero,
reverse && styles.reverse,
image?.src && styles.flex
image?.src && styles.flex,
className
])

return (
Expand Down
1 change: 1 addition & 0 deletions src/blocks/Hero/hero.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ export type HeroProps = {
height: number
} | null
reverse?: boolean
className?: string
}

0 comments on commit 640880a

Please sign in to comment.