56 lines
1.4 KiB
TypeScript
56 lines
1.4 KiB
TypeScript
import * as React from "react";
|
|
import Helmet from "react-helmet";
|
|
import "./EventCreatePage.scss";
|
|
import { async } from "q";
|
|
import { isAuthenticated } from "../../auth";
|
|
import Form from "react-jsonschema-form";
|
|
|
|
export interface EventCreatePageProps {}
|
|
export interface EventCreatePageState {
|
|
}
|
|
|
|
|
|
|
|
class EventCreatePage extends React.Component<EventCreatePageProps, EventCreatePageState> {
|
|
|
|
render() {
|
|
const schema = {
|
|
title: "Uusi tapahtuma",
|
|
type: "object",
|
|
required: ["title"],
|
|
properties: {
|
|
title: {type: "string", title: "Name", default: "Name for the event"},
|
|
location: {type: "string", title: "Location", defailt: "Location for the event"},
|
|
multipleChoicesList: {
|
|
type: "array",
|
|
title: "Event type",
|
|
items: {
|
|
type: "string",
|
|
enum: [
|
|
"Virallinen",
|
|
"Fuksit",
|
|
"Opinnot",
|
|
"Urheilu"
|
|
]
|
|
},
|
|
uniqueItems: true
|
|
},
|
|
}
|
|
};
|
|
return (
|
|
<div className="event-create-page">
|
|
<Helmet>
|
|
<link rel="canonical" href="https://sik.ayy.fi/admin/events/create" />
|
|
</Helmet>
|
|
Event Create Page
|
|
<Form schema={schema}
|
|
onChange={console.log("cahnged")}
|
|
onSubmit={console.log("submitted")}
|
|
onError={console.log("error")} />
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default EventCreatePage;
|