Skip to content

Commit

Permalink
✨ Improve blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Frontendland committed Nov 7, 2024
1 parent d76b966 commit b415d12
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/blocks/ErrorPage/ErrorPage.astro
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const typeStyle = typeColor
{!!buttons?.length && (
<div class="flex xs wrap justify-center">
{buttons?.map(button => (
<Button {...button}>
<Button {...button} icon={null}>
{button.icon && (
<Fragment>
{button.icon.startsWith('<svg')
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/ErrorPage/ErrorPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{#if buttons?.length}
<div class="flex xs wrap justify-center">
{#each buttons as button}
<Button {...button}>
<Button {...button} icon={null}>
{#if button.icon}
{@html button.icon}
{/if}
Expand Down
1 change: 1 addition & 0 deletions src/blocks/ErrorPage/ErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const ErrorPage = ({
<Button
{...button}
key={index}
icon={null}
dangerouslySetInnerHTML={{ __html: button.icon
? `${button.icon} ${button.text}`
: button.text
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/Hero/Hero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const classes = [
{!!buttons?.length && (
<div class:list={[styles.cta, 'flex xs wrap']}>
{buttons?.map(button => (
<Button {...button}>
<Button {...button} icon={null}>
{button.icon && (
<Fragment>
{button.icon.startsWith('<svg')
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/Hero/Hero.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{#if buttons?.length}
<div class={classNames([styles.cta, 'flex xs wrap'])}>
{#each buttons as button}
<Button {...button}>
<Button {...button} icon={null}>
{#if button.icon}
{@html button.icon}
{/if}
Expand Down
1 change: 1 addition & 0 deletions src/blocks/Hero/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const Hero = ({
<Button
{...button}
key={index}
icon={null}
dangerouslySetInnerHTML={{ __html: button.icon
? `${button.icon} ${button.text}`
: button.text
Expand Down
4 changes: 4 additions & 0 deletions src/components/Button/button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,8 @@
@include background(alert-accent);
}
}

svg {
pointer-events: none;
}
}
1 change: 1 addition & 0 deletions src/components/ConditionalWrapper/conditionalwrapper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export type ConditionalWrapperProps = {
condition: boolean
[key: string]: any
}

export type ReactConditionalWrapperProps = {
Expand Down

0 comments on commit b415d12

Please sign in to comment.