Skip to content

Commit

Permalink
Merge pull request #80 from Giveth/remove-all-a-tags
Browse files Browse the repository at this point in the history
change LinkButtons to span
  • Loading branch information
alireza-sharifpour authored Dec 1, 2022
2 parents 014d5b4 + 58e3cd2 commit ceb4fdc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@giveth/ui-design-system",
"version": "1.11.0",
"version": "1.11.1",
"files": [
"/lib"
],
Expand Down
6 changes: 3 additions & 3 deletions src/components/buttonLinks/ButtonLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { brandColors, neutralColors } from '../../common/colors';
import { ButtonText } from '../typography/ButtonText';
import { IButtonLinkContainerProps, IButtonLinkProps } from './type';

const ButtonLinkContainer = styled.a<IButtonLinkContainerProps>`
const ButtonLinkContainer = styled.span<IButtonLinkContainerProps>`
border: none;
border-radius: 48px;
padding: ${props => (props.size === 'large' ? '24px' : '16px')} 24px;
Expand Down Expand Up @@ -134,15 +134,15 @@ export const ButtonLink: FC<IButtonLinkProps> = forwardRef(
target,
className,
href,
onClick,
isExternal,
},
ref,
) => {
return (
<ButtonLinkContainer
ref={ref as any}
href={href}
onClick={onClick}
as={isExternal ? 'a' : 'span'}
target={target}
linkType={linkType}
disabled={disabled}
Expand Down
6 changes: 3 additions & 3 deletions src/components/buttonLinks/OutlineButtonLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { brandColors } from '../../common/colors';
import { ButtonText } from '../typography/ButtonText';
import { IButtonLinkContainerProps, IButtonLinkProps } from './type';

const ButtonLinkContainer = styled.a<IButtonLinkContainerProps>`
const ButtonLinkContainer = styled.span<IButtonLinkContainerProps>`
border: 2px solid;
border-radius: 48px;
padding: ${props => (props.size === 'large' ? '22px' : '14px')} 24px;
Expand Down Expand Up @@ -87,20 +87,20 @@ export const OutlineLinkButton: FC<IButtonLinkProps> = forwardRef(
href,
target,
className,
onClick,
isExternal,
},
ref,
) => {
return (
<ButtonLinkContainer
ref={ref as any}
href={href}
onClick={onClick}
target={target}
linkType={linkType}
size={size}
disabled={disabled}
className={className}
as={isExternal ? 'a' : 'span'}
>
<ButtonText as='span' size={size}>
{label}
Expand Down
1 change: 1 addition & 0 deletions src/components/buttonLinks/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface IButtonLinkContainerProps {
| 'texty-secondary';
size?: 'small' | 'medium' | 'large';
disabled?: boolean;
isExternal?: boolean;
}

export interface IButtonLinkProps
Expand Down
2 changes: 1 addition & 1 deletion src/components/typography/ButtonText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface IButtonTextProps {
size?: 'small' | 'medium' | 'large';
}

export const ButtonText = styled.a<IButtonTextProps>`
export const ButtonText = styled.span<IButtonTextProps>`
font-family: Red Hat Text, sans-serif;
font-style: normal;
text-transform: uppercase;
Expand Down

0 comments on commit ceb4fdc

Please sign in to comment.