Files
koodiklinikka.fi/components/membership/MembershipForm.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

40 lines
1.2 KiB
TypeScript

import React from "react";
import MembershipInfoForm from "./MembershipInfoForm";
export default class MembershipForm extends React.Component {
state = {
signupSuccess: false,
};
handleSignupSuccess = () => {
this.setState({ signupSuccess: true });
};
render() {
if (!this.state.signupSuccess) {
return <MembershipInfoForm onSignupSuccess={this.handleSignupSuccess} />;
}
return (
<div>
<svg
height="50"
width="50"
viewBox="0 0 512 512"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill="#349c4a"
d="M256 6.998c-137.533 0-249 111.467-249 249 0 137.534 111.467 249 249 249s249-111.467 249-249c0-137.534-111.467-249-249-249zm0 478.08c-126.31 0-229.08-102.77-229.08-229.08 0-126.31 102.77-229.08 229.08-229.08 126.31 0 229.08 102.77 229.08 229.08 0 126.31-102.77 229.08-229.08 229.08z"
/>
<path
fill="#349c4a"
d="M384.235 158.192L216.92 325.518 127.86 236.48l-14.142 14.144 103.2 103.18 181.36-181.47"
/>
</svg>
<p> Rekisteröityminen onnistui. Tervetuloa jäseneksi!</p>
<p> Tervetuloa Koodiklinikka ry:n jäseneksi!</p>
</div>
);
}
}