Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions src/components/common/ButtonFd.astro
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export interface Props {
disabled?: boolean;
class?: string;
registrationStatus?: 'registered' | 'not-registered' | null;
href: string;
target?: '_blank' | '_self' | '_parent' | '_top';
rel?: string;
}

const {
Expand All @@ -61,6 +64,9 @@ const {
disabled = false,
class: additionalClasses = '',
registrationStatus = null,
href,
target,
rel,
...restProps
} = Astro.props;

Expand Down Expand Up @@ -108,15 +114,18 @@ const currentSize = sizeConfig[size];
</svg>
</div>

<button
<a
href={href}
target={target}
rel={rel}
class={cn(
'button-main relative flex items-center w-full font-ibm-plex-sans-thai font-normal leading-tight cursor-pointer transition-colors duration-200 ease-in-out border-0 outline-none bg-transparent focus:outline-none disabled:cursor-not-allowed overflow-hidden',
'button-main relative flex items-center w-full font-ibm-plex-sans-thai font-normal leading-tight cursor-pointer transition-colors duration-200 ease-in-out border-0 outline-none bg-transparent focus:outline-none overflow-hidden text-decoration-none',
currentSize.text,
currentSize.padding,
disabled && 'opacity-50'
disabled && 'opacity-50 pointer-events-none'
)}
disabled={disabled}
data-variant={variant}
aria-disabled={disabled}
{...restProps}
>
<div class={cn('flex items-center w-full relative z-10 overflow-hidden')}>
Expand All @@ -142,7 +151,7 @@ const currentSize = sizeConfig[size];
</div>
)}
</div>
</button>
</a>
</div>

<style>
Expand Down
20 changes: 15 additions & 5 deletions src/components/common/ButtonRpkm.astro
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export interface Props {
size?: 'xs' | 'sm' | 'md' | 'lg';
disabled?: boolean;
class?: string;
href: string;
target?: '_blank' | '_self' | '_parent' | '_top';
rel?: string;
}

const {
Expand All @@ -49,6 +52,9 @@ const {
size = 'md',
disabled = false,
class: additionalClasses = '',
href,
target,
rel,
...restProps
} = Astro.props;

Expand Down Expand Up @@ -220,17 +226,21 @@ const getSvgBorder = () => {
};
---

<button
<a
href={href}
target={target}
rel={rel}
class={cn(
buttonClasses,
'focus:outline-2 focus:outline-white/30 focus:outline-offset-2 focus:disabled:outline-none',
variant === 'stroke' && 'bg-no-repeat bg-center bg-contain'
'focus:outline-2 focus:outline-white/30 focus:outline-offset-2 text-decoration-none',
variant === 'stroke' && 'bg-no-repeat bg-center bg-contain',
disabled && 'pointer-events-none'
)}
style={`${getGradientStyle()}${getSvgBorder()}`}
disabled={disabled}
data-variant={variant}
data-color={color}
data-size={size}
aria-disabled={disabled}
{...restProps}
>
<div class="flex items-center w-full relative z-10 overflow-hidden">
Expand All @@ -243,4 +253,4 @@ const getSvgBorder = () => {
</div>
</div>
</div>
</button>
</a>
Loading