Skip to content

Commit ceb4fdc

Browse files
Merge pull request #80 from Giveth/remove-all-a-tags
change LinkButtons to span
2 parents 014d5b4 + 58e3cd2 commit ceb4fdc

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@giveth/ui-design-system",
3-
"version": "1.11.0",
3+
"version": "1.11.1",
44
"files": [
55
"/lib"
66
],

src/components/buttonLinks/ButtonLink.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { brandColors, neutralColors } from '../../common/colors';
55
import { ButtonText } from '../typography/ButtonText';
66
import { IButtonLinkContainerProps, IButtonLinkProps } from './type';
77

8-
const ButtonLinkContainer = styled.a<IButtonLinkContainerProps>`
8+
const ButtonLinkContainer = styled.span<IButtonLinkContainerProps>`
99
border: none;
1010
border-radius: 48px;
1111
padding: ${props => (props.size === 'large' ? '24px' : '16px')} 24px;
@@ -134,15 +134,15 @@ export const ButtonLink: FC<IButtonLinkProps> = forwardRef(
134134
target,
135135
className,
136136
href,
137-
onClick,
137+
isExternal,
138138
},
139139
ref,
140140
) => {
141141
return (
142142
<ButtonLinkContainer
143143
ref={ref as any}
144144
href={href}
145-
onClick={onClick}
145+
as={isExternal ? 'a' : 'span'}
146146
target={target}
147147
linkType={linkType}
148148
disabled={disabled}

src/components/buttonLinks/OutlineButtonLink.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { brandColors } from '../../common/colors';
55
import { ButtonText } from '../typography/ButtonText';
66
import { IButtonLinkContainerProps, IButtonLinkProps } from './type';
77

8-
const ButtonLinkContainer = styled.a<IButtonLinkContainerProps>`
8+
const ButtonLinkContainer = styled.span<IButtonLinkContainerProps>`
99
border: 2px solid;
1010
border-radius: 48px;
1111
padding: ${props => (props.size === 'large' ? '22px' : '14px')} 24px;
@@ -87,20 +87,20 @@ export const OutlineLinkButton: FC<IButtonLinkProps> = forwardRef(
8787
href,
8888
target,
8989
className,
90-
onClick,
90+
isExternal,
9191
},
9292
ref,
9393
) => {
9494
return (
9595
<ButtonLinkContainer
9696
ref={ref as any}
9797
href={href}
98-
onClick={onClick}
9998
target={target}
10099
linkType={linkType}
101100
size={size}
102101
disabled={disabled}
103102
className={className}
103+
as={isExternal ? 'a' : 'span'}
104104
>
105105
<ButtonText as='span' size={size}>
106106
{label}

src/components/buttonLinks/type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface IButtonLinkContainerProps {
99
| 'texty-secondary';
1010
size?: 'small' | 'medium' | 'large';
1111
disabled?: boolean;
12+
isExternal?: boolean;
1213
}
1314

1415
export interface IButtonLinkProps

src/components/typography/ButtonText.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export interface IButtonTextProps {
44
size?: 'small' | 'medium' | 'large';
55
}
66

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

0 commit comments

Comments
 (0)