-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
537 additions
and
3,707 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Component } from 'react' | ||
import { findDOMNode } from 'react-dom' | ||
import PropTypes from 'prop-types' | ||
|
||
class Editor extends Component { | ||
componentDidMount() { | ||
const ace = require('brace') | ||
require('brace/mode/javascript') | ||
require('ayu-ace') | ||
window.Range = ace.acequire('ace/range').Range | ||
const editor = ace.edit(this.editorContainer) | ||
editor.getSession().setUseWorker(false) | ||
editor.getSession().setMode('ace/mode/javascript') | ||
editor.setTheme('ace/theme/ayu-mirage') | ||
editor.$blockScrolling = Infinity | ||
editor.setOptions({ | ||
fontSize: '14px' | ||
}) | ||
editor.setValue(this.props.initialValue) | ||
editor.clearSelection() | ||
editor.on('change', () => { | ||
this.props.onChange() | ||
}) | ||
this.props.onReady(editor) | ||
} | ||
|
||
render() { | ||
const height = this.props.height || '300px' | ||
return ( | ||
<div> | ||
<div style={{height}} ref={(ref) => this.editorContainer = ref } /> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
Editor.propTypes = { | ||
initialValue: PropTypes.string, | ||
height: PropTypes.string, | ||
onReady: PropTypes.func, | ||
onChange: PropTypes.func | ||
} | ||
|
||
export default Editor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
export default () => ( | ||
<footer className="Footer"> | ||
<style jsx>{` | ||
footer { | ||
margin: 0 auto; | ||
background-color: black; | ||
padding: 75px 50px 50px; | ||
color: #cccccc; | ||
} | ||
ul { | ||
list-style: none; | ||
padding: 0; | ||
margin: 0 0 10px; | ||
} | ||
li { | ||
display: inline; | ||
font-weight: 700; | ||
margin-right: 5px; | ||
} | ||
li:after { | ||
content: '.' | ||
} | ||
li a { | ||
color: white; | ||
} | ||
`}</style> | ||
<div className="container"> | ||
<ul> | ||
<li><a href="https://source-academy.comp.nus.edu.sg/">Source Academy</a></li> | ||
<li><a href="https://comp.nus.edu.sg">NUS School of Computing</a></li> | ||
</ul> | ||
<div>© 2017 - Source Academy Team</div> | ||
<div>Illustrations by Ng Tse Pei</div> | ||
</div> | ||
</footer> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.