Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Khalid Ali
schedules
Commits
739fd91a
Commit
739fd91a
authored
Jun 10, 2018
by
David Haynes
🙆
Browse files
Random nits, holding myself back for anything bigger
- there's no docs but that's ok
parent
91a2305f
Changes
6
Hide whitespace changes
Inline
Side-by-side
schedules_web/src/components/App.tsx
View file @
739fd91a
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
;
schedules_web/src/components/Search.tsx
View file @
739fd91a
import
*
as
React
from
'
react
'
;
import
Section
,
{
fetchSectionWithCRN
}
from
'
../section
'
;
import
{
fetchSectionWithCRN
,
Section
}
from
'
../
ts/
section
'
;
import
SearchBar
from
'
./SearchBar
'
;
import
SectionList
from
'
./SectionList
'
;
...
...
schedules_web/src/components/SectionList.tsx
View file @
739fd91a
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
>
...
...
schedules_web/src/index.tsx
View file @
739fd91a
import
*
as
React
from
'
react
'
;
import
*
as
ReactDOM
from
'
react-dom
'
;
import
App
from
'
./components/App
'
;
ReactDOM
.
render
(<
App
/>,
document
.
getElementById
(
'
root
'
));
schedules_web/src/section.ts
→
schedules_web/src/
ts/
section.ts
View file @
739fd91a
export
default
interface
Section
{
export
interface
Section
{
id
:
number
;
name
:
string
;
title
:
string
;
...
...
schedules_web/src/utilities.ts
→
schedules_web/src/
ts/
utilities.ts
View file @
739fd91a
...
...
@@ -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
'
);
}
}
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment