-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first pass at setting up base components; installed syntax highlighters
- Loading branch information
Showing
21 changed files
with
350 additions
and
39 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,4 @@ | ||
.App { | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
height: 80px; | ||
} | ||
|
||
.App-header { | ||
background-color: #222; | ||
height: 150px; | ||
padding: 20px; | ||
color: white; | ||
} | ||
|
||
.App-title { | ||
font-size: 1.5em; | ||
} | ||
|
||
.App-intro { | ||
font-size: large; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { transform: rotate(0deg); } | ||
to { transform: rotate(360deg); } | ||
display: flex; | ||
flex: 1; | ||
} |
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
23 changes: 23 additions & 0 deletions
23
src/components/AssessmentQuiz/AssessmentQuiz/AssessmentQuiz.component.js
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,23 @@ | ||
import React, { PureComponent } from 'react'; | ||
|
||
import PropTypes from 'prop-types'; | ||
|
||
import { | ||
Quiz, | ||
VariableDeclarationQuestion, | ||
} from 'components'; | ||
|
||
|
||
export default class AssessmentQuiz extends PureComponent { | ||
static propTypes = {}; | ||
|
||
render() { | ||
const {} = this.props; | ||
|
||
return ( | ||
<Quiz> | ||
<VariableDeclarationQuestion/> | ||
</Quiz> | ||
); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/components/AssessmentQuiz/AssessmentQuiz/AssessmentQuiz.container.js
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,5 @@ | ||
import { connect } from 'react-redux'; | ||
|
||
import AssessmentQuiz from './AssessmentQuiz.component'; | ||
|
||
export default AssessmentQuiz; |
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 @@ | ||
export { default as AssessmentQuiz } from './AssessmentQuiz.container'; |
63 changes: 63 additions & 0 deletions
63
...nents/AssessmentQuiz/VariableDeclarationQuestion/VariableDeclarationQuestion.component.js
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,63 @@ | ||
import React, { PureComponent } from 'react'; | ||
|
||
import PropTypes from 'prop-types'; | ||
|
||
import { | ||
QuizQuestion, | ||
} from 'components'; | ||
|
||
const codeFigure = `var name = "Bill"; | ||
function caller(func){ | ||
var myObject = { | ||
name: "Joe" | ||
}; | ||
return func(myObject); | ||
} | ||
function callee(param) { | ||
return param.name | ||
} | ||
var c = caller(callee);`; | ||
|
||
const question = `Select the answer below that would set a variable named \`myVariable\` to \`3\``; | ||
|
||
const answers = [ | ||
{ | ||
type: `code`, | ||
text: `myVariable(3)`, | ||
}, | ||
{ | ||
type: `code`, | ||
text: `var myVariable = 3;`, | ||
}, | ||
{ | ||
type: `code`, | ||
text: `var myVariable[3]`, | ||
}, | ||
{ | ||
type: `code`, | ||
text: `var myVariable = { | ||
3 | ||
}`, | ||
}, | ||
]; | ||
|
||
|
||
export default class VariableDeclarationQuestion extends PureComponent { | ||
static propTypes = {}; | ||
|
||
render() { | ||
const {} = this.props; | ||
|
||
return ( | ||
<QuizQuestion | ||
codeFigure={codeFigure} | ||
question={question} | ||
answers={answers} | ||
/> | ||
); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...nents/AssessmentQuiz/VariableDeclarationQuestion/VariableDeclarationQuestion.container.js
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,5 @@ | ||
import { connect } from 'react-redux'; | ||
|
||
import VariableDeclarationQuestion from './VariableDeclarationQuestion.component'; | ||
|
||
export default VariableDeclarationQuestion; |
1 change: 1 addition & 0 deletions
1
src/components/AssessmentQuiz/VariableDeclarationQuestion/index.js
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 @@ | ||
export { default as VariableDeclarationQuestion } from './VariableDeclarationQuestion.container'; |
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,2 @@ | ||
export * from './AssessmentQuiz'; | ||
export * from './VariableDeclarationQuestion'; |
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,25 @@ | ||
import React, { PureComponent } from 'react'; | ||
|
||
import PropTypes from 'prop-types'; | ||
|
||
import { | ||
QuizQuestion | ||
} from 'components'; | ||
|
||
import './Quiz.css'; | ||
|
||
export default class Quiz extends PureComponent { | ||
static propTypes = { | ||
children: PropTypes.array, | ||
}; | ||
|
||
render() { | ||
const {children} = this.props; | ||
|
||
return ( | ||
<div className={`Quiz`}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
} |
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,6 @@ | ||
.Quiz { | ||
flex: 1; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} |
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 @@ | ||
export { default as Quiz } from './Quiz.component'; |
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,47 @@ | ||
import React, { PureComponent } from 'react'; | ||
|
||
import Highlight from 'react-highlight'; | ||
|
||
import Markdown from 'react-remarkable'; | ||
|
||
import 'highlight.js/styles/github-gist.css'; | ||
|
||
import PropTypes from 'prop-types'; | ||
|
||
import './QuizQuestion.css'; | ||
|
||
export default class QuizQuestion extends PureComponent { | ||
static propTypes = { | ||
codeFigure: PropTypes.string, | ||
question: PropTypes.string.isRequired, | ||
answers: PropTypes.arrayOf(PropTypes.shape({ | ||
text: PropTypes.string.isRequired, | ||
})) | ||
}; | ||
|
||
render() { | ||
const { codeFigure, question, answers } = this.props; | ||
|
||
return ( | ||
<div className={`QuizQuestion`}> | ||
{codeFigure && ( | ||
<div className={`QuizQuestion__code-figure`}> | ||
<Highlight className={`javascript`}>{codeFigure}</Highlight> | ||
</div> | ||
)} | ||
<div className={`QuizQuestion__question`}> | ||
<Markdown>{question}</Markdown> | ||
</div> | ||
<ol className={`QuizQuestion__answers-list`}> | ||
{answers.map(({ text }, i) => { | ||
return ( | ||
<li key={i}> | ||
<Highlight className={`javascript`}>{text}</Highlight> | ||
</li> | ||
); | ||
})} | ||
</ol> | ||
</div> | ||
); | ||
} | ||
} |
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,32 @@ | ||
.QuizQuestion { | ||
|
||
} | ||
|
||
.QuizQuestion__question p { | ||
font-size: 2rem; | ||
} | ||
|
||
.QuizQuestion__question code { | ||
color: #1b2733; | ||
background-color: #f7f9fa; | ||
border-color: #e6e8eb; | ||
font-family: SourceCodePro,monospace; | ||
} | ||
|
||
.QuizQuestion__code-figure { | ||
border: 1px solid #e6e8eb; | ||
background-color: #f7f9fa; | ||
} | ||
|
||
.QuizQuestion__code-figure > pre { | ||
margin: 0; | ||
} | ||
|
||
.QuizQuestion__code-figure .hljs { | ||
background-color: transparent; | ||
padding: 20px 15px; | ||
} | ||
|
||
.QuizQuestion__answers-list { | ||
|
||
} |
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 @@ | ||
export { default as QuizQuestion } from './QuizQuestion.component'; |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
export * from './App'; | ||
export * from './AssessmentQuiz'; | ||
export * from './Quiz'; | ||
export * from './QuizQuestion'; |
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 |
---|---|---|
@@ -1,5 +1,38 @@ | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
font-family: sans-serif; | ||
margin: 0; | ||
padding: 0; | ||
font-family: 'Open Sans', sans-serif; | ||
min-height: 100vh; | ||
min-width: 100vw; | ||
display: flex; | ||
} | ||
|
||
pre { | ||
font-family: monospace; | ||
} | ||
|
||
p, | ||
ul, | ||
ol, | ||
pre { | ||
line-height: 1.4; | ||
} | ||
|
||
ol { | ||
list-style-type: decimal; | ||
} | ||
|
||
ul > li, | ||
ol > li { | ||
margin-left: 20px; | ||
} | ||
|
||
pre > .hljs { | ||
padding: 0 | ||
} | ||
|
||
|
||
#root { | ||
flex: 1; | ||
display: flex; | ||
} |
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
Oops, something went wrong.