mirror of
https://github.com/koodiklinikka/koodiklinikka.fi.git
synced 2026-01-26 11:23:58 +00:00
* 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
44 lines
916 B
TypeScript
44 lines
916 B
TypeScript
import React from "react";
|
|
import request from "axios";
|
|
import shuffle from "lodash/shuffle";
|
|
import api from "./api";
|
|
|
|
export default class Members extends React.Component {
|
|
state = {
|
|
members: [],
|
|
};
|
|
|
|
componentDidMount() {
|
|
this.refreshMembers();
|
|
}
|
|
|
|
async refreshMembers() {
|
|
const res = await request.get(api("members"));
|
|
this.setState({
|
|
members: shuffle(res.data),
|
|
});
|
|
}
|
|
|
|
render() {
|
|
const members = this.state.members.map(member => {
|
|
const src = `${member.avatar_url}&s=120`;
|
|
return (
|
|
<img className="member" key={member.avatar_url} src={src} alt="" />
|
|
);
|
|
});
|
|
|
|
return (
|
|
<div className="members" aria-hidden="true">
|
|
<a
|
|
href="https://github.com/koodiklinikka"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
tabIndex={-1}
|
|
>
|
|
{members}
|
|
</a>
|
|
</div>
|
|
);
|
|
}
|
|
}
|