Files
koodiklinikka.fi/components/Footer.tsx
Olavi Haapala f4474523ad Chore/convert to typescript (#60)
* Convert to using TypeScript

Next.js v.9 allows converting an existing project to TS by simply renaming the files as TS files

* Fix type errors: Type 'string' is not assignable to type 'number'.

* Add mention about missing typings for javascript-time-ago

* Add GA_INITIALIZED to window

* Fix type error in feed transformers

* Model MembershipInfoForm state and props with TS

* Silence the typescript warning in MembershipInfoForm

* Add threshold to Fader props

* Fix Warning: Each child in a list should have a unique "key" prop.

Sponsors don't have ids – name is probably unique and can be used as a key

* Allow key as prop for SponsorLink

* Add type of the props for SponsorLink
2019-11-07 07:28:02 +02:00

70 lines
1.9 KiB
TypeScript

import React from "react";
import EmailComponent from "./EmailComponent";
import sponsors from "../data/sponsors";
type Props = {
href: string;
name: string;
key: string;
};
const SponsorLink = ({ href, name }: Props) => (
<a href={href} target="_blank" rel="noopener noreferrer">
<img
src={`/static/images/sponsors/${name.toLowerCase()}.svg`}
alt={name}
className={`sponsor sponsor__${name.toLowerCase()}`}
/>
</a>
);
export function Footer() {
return (
<footer>
<div className="sponsors">
<div className="sponsors__label">Yhteistyössä</div>
{sponsors.map(sponsor => (
<SponsorLink key={sponsor.name} {...sponsor} />
))}
</div>
<div className="contacts">
<div>
<a
href="https://koodiklinikka.slack.com"
aria-label="Koodiklinikka Slackissä"
>
<i className="fa fa-slack" aria-hidden="true" />
</a>
<a
href="https://github.com/koodiklinikka/koodiklinikka.fi"
aria-label="Koodiklinikka Githubissa"
>
<i className="fa fa-github" aria-hidden="true" />
</a>
<a
href="https://twitter.com/koodiklinikka"
aria-label="Koodiklinikka Twitterissä"
>
<i className="fa fa-twitter" aria-hidden="true" />
</a>
<a
href="https://www.linkedin.com/groups/12025476"
aria-label="Koodiklinikka Linkedinissä"
>
<i className="fa fa-linkedin" aria-hidden="true" />
</a>
<a
href="https://www.facebook.com/koodiklinikka"
aria-label="Koodiklinikka Facebookissa"
>
<i className="fa fa-facebook" aria-hidden="true" />
</a>
<div id="email">
<EmailComponent />
</div>
</div>
</div>
</footer>
);
}