Use Link components instead of anchor tags
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
import FooterMap from "../FooterMap/FooterMap";
|
import FooterMap from "../FooterMap/FooterMap";
|
||||||
import "./Footer.scss";
|
import "./Footer.scss";
|
||||||
|
|
||||||
@@ -22,13 +23,13 @@ class Footer extends React.Component<FooterProps, FooterState> {
|
|||||||
<br></br>
|
<br></br>
|
||||||
<p>Y-tunnus: 1627010-1</p>
|
<p>Y-tunnus: 1627010-1</p>
|
||||||
<p>sik-hallitus@list.ayy.fi</p>
|
<p>sik-hallitus@list.ayy.fi</p>
|
||||||
<a href="/yhteystiedot">Yhteystiedot</a>
|
<Link to="/yhteystiedot">Yhteystiedot</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="footer__links">
|
<div className="footer__links">
|
||||||
<a href="/jaseneksi">Jäseneksi</a>
|
<Link to="/jaseneksi">Jäseneksi</Link>
|
||||||
<a href="/palaute">Palaute</a>
|
<Link to="/palaute">Palaute</Link>
|
||||||
<a href="/arkisto">Arkisto</a>
|
<Link to="/arkisto">Arkisto</Link>
|
||||||
<a href="/materiaalipankki">Materiaalipankki</a>
|
<Link to="/materiaalipankki">Materiaalipankki</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
import "./Icon.scss";
|
import "./Icon.scss";
|
||||||
|
|
||||||
export enum IconType {
|
export enum IconType {
|
||||||
@@ -62,13 +63,13 @@ class Icon extends React.Component<IconProps, IconState> {
|
|||||||
const elem = nameToIcon(name);
|
const elem = nameToIcon(name);
|
||||||
if (link) {
|
if (link) {
|
||||||
return (
|
return (
|
||||||
<a
|
<Link
|
||||||
href={link}
|
to={link}
|
||||||
className="so-me-icon"
|
className="so-me-icon"
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
>
|
>
|
||||||
{elem}
|
{elem}
|
||||||
</a>
|
</Link>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
import "./NavbarChildLink.scss";
|
import "./NavbarChildLink.scss";
|
||||||
|
|
||||||
export interface NavbarChildLinkProps {
|
export interface NavbarChildLinkProps {
|
||||||
@@ -11,10 +12,10 @@ export interface NavbarChildLinkState {
|
|||||||
class NavbarChildLink extends React.Component<NavbarChildLinkProps, NavbarChildLinkState> {
|
class NavbarChildLink extends React.Component<NavbarChildLinkProps, NavbarChildLinkState> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<a className="navbar-child-link"
|
<Link className="navbar-child-link"
|
||||||
href={this.props.to}>
|
to={this.props.to}>
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
</a>
|
</Link>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
import "./NavbarDropdownLink.scss";
|
import "./NavbarDropdownLink.scss";
|
||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
import DropDownBox from "../DropDownBox/DropDownBox";
|
import DropDownBox from "../DropDownBox/DropDownBox";
|
||||||
@@ -55,9 +56,9 @@ class NavbarDropdownLink extends React.Component<NavbarDropdownLinkProps, Navbar
|
|||||||
if (exploded) {
|
if (exploded) {
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<a className="navbar-dropdown-link"
|
<Link className="navbar-dropdown-link"
|
||||||
href={this.props.to}
|
to={this.props.to}
|
||||||
>{text}</a>
|
>{text}</Link>
|
||||||
{children}
|
{children}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
@@ -65,11 +66,11 @@ class NavbarDropdownLink extends React.Component<NavbarDropdownLinkProps, Navbar
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="navbar-dropdown-container">
|
<div className="navbar-dropdown-container">
|
||||||
<a className="navbar-dropdown-link"
|
<Link className="navbar-dropdown-link"
|
||||||
href={to}
|
to={to}
|
||||||
onMouseEnter={this.handleMouseEnterLink}
|
onMouseEnter={this.handleMouseEnterLink}
|
||||||
onMouseLeave={this.handleMouseLeaveLink}
|
onMouseLeave={this.handleMouseLeaveLink}
|
||||||
>{text}</a>
|
>{text}</Link>
|
||||||
<DropDownBox
|
<DropDownBox
|
||||||
onMouseEnter={this.handleMouseEnterBox}
|
onMouseEnter={this.handleMouseEnterBox}
|
||||||
onMouseLeave={this.handleMouseLeaveBox}
|
onMouseLeave={this.handleMouseLeaveBox}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
import "./PageLink.scss";
|
import "./PageLink.scss";
|
||||||
|
|
||||||
export interface PageLinkProps {
|
export interface PageLinkProps {
|
||||||
@@ -13,7 +14,7 @@ class PageLink extends React.Component<PageLinkProps, PageLinkState> {
|
|||||||
return (
|
return (
|
||||||
<div className="page-link">
|
<div className="page-link">
|
||||||
<p>{this.props.children}</p>
|
<p>{this.props.children}</p>
|
||||||
<a href={to}>{desc}</a>
|
<Link to={to}>{desc}</Link>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
import "./SponsorReel.scss";
|
import "./SponsorReel.scss";
|
||||||
|
|
||||||
export interface SponsorReelProps {}
|
export interface SponsorReelProps {}
|
||||||
@@ -10,13 +11,13 @@ class SponsorReel extends React.Component<SponsorReelProps, SponsorReelState> {
|
|||||||
<div className="sponsor-reel">
|
<div className="sponsor-reel">
|
||||||
<h3>Yhteistyössä</h3>
|
<h3>Yhteistyössä</h3>
|
||||||
<div className="sponsor-reel-logos">
|
<div className="sponsor-reel-logos">
|
||||||
<a href="#"><img src="https://placehold.it/200x200" /></a>
|
<Link to="#"><img src="https://placehold.it/200x200" /></Link>
|
||||||
<a href="#"><img src="https://placehold.it/200x200" /></a>
|
<Link to="#"><img src="https://placehold.it/200x200" /></Link>
|
||||||
<a href="#"><img src="https://placehold.it/200x200" /></a>
|
<Link to="#"><img src="https://placehold.it/200x200" /></Link>
|
||||||
<a href="#"><img src="https://placehold.it/200x200" /></a>
|
<Link to="#"><img src="https://placehold.it/200x200" /></Link>
|
||||||
<a href="#"><img src="https://placehold.it/200x200" /></a>
|
<Link to="#"><img src="https://placehold.it/200x200" /></Link>
|
||||||
</div>
|
</div>
|
||||||
<a href="/yritysyhteistyo">Haluatko kuulla lisää yhteistyöstä kanssamme?</a>
|
<Link to="/yritysyhteistyo">Haluatko kuulla lisää yhteistyöstä kanssamme?</Link>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
import "./FrontPage.scss";
|
import "./FrontPage.scss";
|
||||||
import appStore from "../../stores/AppStore";
|
import appStore from "../../stores/AppStore";
|
||||||
import Card from "../../components/Card";
|
import Card from "../../components/Card";
|
||||||
@@ -121,7 +122,7 @@ class FrontPage extends React.Component<FrontPageProps, FrontPageState> {
|
|||||||
<PageSection backgroundColor={PageSectionColor.Orange}>
|
<PageSection backgroundColor={PageSectionColor.Orange}>
|
||||||
<Ribbon>
|
<Ribbon>
|
||||||
<p>Sössöä vuodesta 1969.</p>
|
<p>Sössöä vuodesta 1969.</p>
|
||||||
<a href="https://sosso.fi">Lue opiskelijalehden viimeisin numero ›</a>
|
<Link to="https://sosso.fi">Lue opiskelijalehden viimeisin numero ›</Link>
|
||||||
</Ribbon>
|
</Ribbon>
|
||||||
</PageSection>
|
</PageSection>
|
||||||
<PageSection backgroundColor={PageSectionColor.White} bottomBorder cardSection>
|
<PageSection backgroundColor={PageSectionColor.White} bottomBorder cardSection>
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
import { Switch, Route } from "react-router-dom";
|
import { Switch, Route, DefaultRoute } from "react-router-dom";
|
||||||
import Helmet from "react-helmet";
|
import Helmet from "react-helmet";
|
||||||
import FrontPage from "./pages/FrontPage";
|
import FrontPage from "./pages/FrontPage";
|
||||||
import NotFoundPage from "./pages/NotFoundPage";
|
import NotFoundPage from "./pages/NotFoundPage";
|
||||||
|
|||||||
Reference in New Issue
Block a user