Skip to content
This repository was archived by the owner on Oct 28, 2023. It is now read-only.

Commit df2bfa2

Browse files
Merge pull request #32 from javaBin/linkFix
Fixed Link tag
2 parents 656e888 + 35a885c commit df2bfa2

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

src/components/Link/Link.module.scss

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@
1111
background: none;
1212
text-align: center;
1313
cursor: pointer;
14-
a {
15-
color: $color-logo-red;
16-
text-decoration: none;
17-
}
14+
text-decoration: none;
15+
color: $color-logo-red;
16+
1817
&:hover {
18+
text-decoration: none;
1919
background: $color-logo-red-dark;
20-
a {
21-
color: white;
22-
}
20+
color: white;
21+
2322
}
2423
}

src/components/Link/Link.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ interface LinkProps {
1212
function Link(props: LinkProps) {
1313
return (
1414
props.external
15-
? <div className={styles.link}>
16-
<a href={props.url} target={props.noBlankTarget ? '' : '_blank'}>{props.children}</a>
17-
</div>
18-
: <div className={styles.link}>
19-
<RouterLink to={props.url}>
15+
? <a href={props.url} className={styles.link} target={props.noBlankTarget ? '' : '_blank'}>
16+
<span >{props.children}</span>
17+
</a>
18+
:
19+
<RouterLink to={props.url} className={styles.link}>
20+
<span >
2021
{props.children}
22+
</span>
2123
</RouterLink>
22-
</div>
24+
2325
)
2426
}
2527

0 commit comments

Comments
 (0)