Commit 739fd91a authored by David Haynes's avatar David Haynes 🙆

Random nits, holding myself back for anything bigger

- there's no docs but that's ok
parent 91a2305f
import * as React from 'react';
import Section from '../section';
import { ENDPOINTS, downloadCalendar, postData } from '../utilities';
import { Section } from '../ts/section';
import { downloadCalendar, ENDPOINTS, postData } from '../ts/utilities';
import Search from './Search';
import SectionList from './SectionList';
......@@ -8,7 +8,7 @@ interface State {
currentSchedule: Section[];
}
class App extends React.Component<any, State> {
export default class App extends React.Component<any, State> {
constructor(props: any) {
super(props);
this.state = { currentSchedule: [] };
......@@ -54,5 +54,3 @@ class App extends React.Component<any, State> {
});
};
}
export default App;
import * as React from 'react';
import Section, { fetchSectionWithCRN } from '../section';
import { fetchSectionWithCRN, Section } from '../ts/section';
import SearchBar from './SearchBar';
import SectionList from './SectionList';
......
import * as React from 'react';
import Section from '../section';
import { Section } from '../ts/section';
interface Props {
sections: Section[];
......@@ -8,6 +8,11 @@ interface Props {
}
export default class SectionList extends React.Component<Props, any> {
constructor(props: Props) {
super(props);
this.state = {};
}
render() {
return (
<table>
......
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './components/App';
ReactDOM.render(<App />, document.getElementById('root'));
export default interface Section {
export interface Section {
id: number;
name: string;
title: string;
......
......@@ -14,7 +14,7 @@ export function postData(endpoint: string, data: any): Promise<Response> {
});
}
export function downloadCalendar(calendarText: string) {
export const downloadCalendar = (calendarText: string) => {
const blob = new Blob([calendarText], { type: 'text/plain;charset=utf-8' });
FileSaver.saveAs(blob, 'GMU Fall 2018.ics');
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment