mirror of
https://github.com/koodiklinikka/koodiklinikka.fi.git
synced 2026-03-17 23:05:12 +00:00
Add prettify command and run it
This commit is contained in:
@@ -6,11 +6,11 @@ function clamp(min, max, value) {
|
||||
|
||||
export default class Fader extends React.Component {
|
||||
static defaultProps = {
|
||||
threshold: 100
|
||||
threshold: 100,
|
||||
};
|
||||
|
||||
state = {
|
||||
opacity: 0
|
||||
opacity: 0,
|
||||
};
|
||||
|
||||
onScroll = () => {
|
||||
@@ -19,7 +19,7 @@ export default class Fader extends React.Component {
|
||||
distanceToBottom = scrollableDistance - scrollTop;
|
||||
|
||||
this.setState({
|
||||
opacity: clamp(0, 1, distanceToBottom / this.props.threshold)
|
||||
opacity: clamp(0, 1, distanceToBottom / this.props.threshold),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -34,7 +34,7 @@ export default class Fader extends React.Component {
|
||||
|
||||
render() {
|
||||
var style = {
|
||||
opacity: this.state.opacity
|
||||
opacity: this.state.opacity,
|
||||
};
|
||||
|
||||
return <div className="fader" style={style}></div>;
|
||||
|
||||
@@ -14,7 +14,7 @@ function throwError(err) {
|
||||
|
||||
export default class Feed extends React.Component {
|
||||
state = {
|
||||
messages: []
|
||||
messages: [],
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
@@ -32,7 +32,7 @@ export default class Feed extends React.Component {
|
||||
.sortBy("timestamp")
|
||||
.reverse()
|
||||
.value()
|
||||
.slice(0, 40)
|
||||
.slice(0, 40),
|
||||
});
|
||||
})
|
||||
.catch(throwError);
|
||||
|
||||
@@ -9,7 +9,7 @@ export default class InviteForm extends React.Component {
|
||||
email: "",
|
||||
submitted: false,
|
||||
sending: false,
|
||||
error: null
|
||||
error: null,
|
||||
};
|
||||
|
||||
onSubmit = e => {
|
||||
@@ -18,12 +18,12 @@ export default class InviteForm extends React.Component {
|
||||
this.setState({
|
||||
submitted: false,
|
||||
sending: true,
|
||||
error: null
|
||||
error: null,
|
||||
});
|
||||
|
||||
request
|
||||
.post(api("invites"), {
|
||||
email: this.state.email.trim()
|
||||
email: this.state.email.trim(),
|
||||
})
|
||||
.then(this.handleSuccess)
|
||||
.catch(this.handleError);
|
||||
@@ -44,7 +44,7 @@ export default class InviteForm extends React.Component {
|
||||
this.setState({
|
||||
email: e.target.value,
|
||||
error: null,
|
||||
submitted: false
|
||||
submitted: false,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -54,13 +54,13 @@ export default class InviteForm extends React.Component {
|
||||
"invite-form": true,
|
||||
"has-success": this.state.submitted,
|
||||
"has-error": this.state.error,
|
||||
sending: this.state.sending
|
||||
sending: this.state.sending,
|
||||
});
|
||||
|
||||
var inputClasses = classSet({
|
||||
input: true,
|
||||
"has-success": this.state.submitted,
|
||||
"has-error": this.state.error
|
||||
"has-error": this.state.error,
|
||||
});
|
||||
|
||||
var feedbackMessage;
|
||||
|
||||
@@ -5,14 +5,14 @@ import api from "./api";
|
||||
|
||||
export default class Members extends React.Component {
|
||||
state = {
|
||||
members: []
|
||||
members: [],
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
request.get(api("members")).then(
|
||||
function(res) {
|
||||
this.setState({
|
||||
members: _.shuffle(res.data)
|
||||
members: _.shuffle(res.data),
|
||||
});
|
||||
}.bind(this)
|
||||
);
|
||||
|
||||
@@ -23,7 +23,7 @@ export default {
|
||||
branch: branch,
|
||||
number: item.payload.number,
|
||||
ref_type: item.payload.ref_type,
|
||||
ref: item.payload.ref
|
||||
ref: item.payload.ref,
|
||||
});
|
||||
|
||||
var url = `https://github.com/${item.actor.login}`;
|
||||
@@ -36,7 +36,7 @@ export default {
|
||||
body: message,
|
||||
timestamp: new Date(item.created_at),
|
||||
url: message.url,
|
||||
type: "github"
|
||||
type: "github",
|
||||
};
|
||||
});
|
||||
},
|
||||
@@ -55,8 +55,8 @@ export default {
|
||||
imageLink: url,
|
||||
body: twitterText.autoLink(item.text),
|
||||
timestamp: new Date(item.created_at),
|
||||
type: "twitter"
|
||||
type: "twitter",
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@ import MembershipInfoForm from "./MembershipInfoForm";
|
||||
|
||||
export default class MembershipForm extends React.Component {
|
||||
state = {
|
||||
signupSuccess: false
|
||||
signupSuccess: false,
|
||||
};
|
||||
|
||||
handleSignupSuccess = () => {
|
||||
|
||||
@@ -11,7 +11,7 @@ var fieldNameTranslations = {
|
||||
email: { fi: "Sähköpostiosoite" },
|
||||
handle: { fi: "Slack-käyttäjätunnus " },
|
||||
name: { fi: "Koko nimi " },
|
||||
postcode: { fi: "Postinumero" }
|
||||
postcode: { fi: "Postinumero" },
|
||||
};
|
||||
|
||||
const mailValidateRe = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
@@ -35,18 +35,18 @@ export default class MembershipInfoForm extends React.Component {
|
||||
name: "",
|
||||
postcode: "",
|
||||
sending: false,
|
||||
pristineFields: fieldNames
|
||||
pristineFields: fieldNames,
|
||||
};
|
||||
|
||||
onSubmit = () => {
|
||||
this.setState({
|
||||
sending: true,
|
||||
error: null
|
||||
error: null,
|
||||
});
|
||||
|
||||
request
|
||||
.post(api("membership"), {
|
||||
userInfo: getUserInfo(this.state)
|
||||
userInfo: getUserInfo(this.state),
|
||||
})
|
||||
.then(() => {
|
||||
this.setState({ sending: false });
|
||||
@@ -68,7 +68,7 @@ export default class MembershipInfoForm extends React.Component {
|
||||
pristineFields: this.state.pristineFields.filter(
|
||||
fieldName => fieldName !== name
|
||||
),
|
||||
errors: []
|
||||
errors: [],
|
||||
});
|
||||
};
|
||||
|
||||
@@ -95,7 +95,7 @@ export default class MembershipInfoForm extends React.Component {
|
||||
form: true,
|
||||
"membership-form": true,
|
||||
"has-error": inputErrors.length !== 0 || this.state.error,
|
||||
sending: this.state.sending
|
||||
sending: this.state.sending,
|
||||
});
|
||||
|
||||
function getErrorMessage(err) {
|
||||
@@ -126,7 +126,7 @@ export default class MembershipInfoForm extends React.Component {
|
||||
input: true,
|
||||
"has-error": _.includes(fieldsWithErrors, fieldName),
|
||||
half: fieldName === "city" || fieldName === "postcode",
|
||||
left: fieldName === "postcode"
|
||||
left: fieldName === "postcode",
|
||||
});
|
||||
|
||||
function showsErrorFor(field) {
|
||||
|
||||
Reference in New Issue
Block a user