This file contains hidden or 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
| const CourseCardHeader = function ({ headerText, courseComplexityType }) { | |
| return ( | |
| <div className="card-header d-flex justify-content-between align-items-center m-0"> | |
| <h5>{headerText}</h5> | |
| <CourseComplexity courseComplexityType={courseComplexityType} /> | |
| </div> | |
| ); | |
| }; |
This file contains hidden or 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
| const CourseComplexity = function ( props ) { | |
| const studentTypeClass = ["badge", "badge-pill"]; | |
| if (courseComplexityType === "Beginner") | |
| studentTypeClass.push("badge-primary"); | |
| else if (courseComplexityType === "Intermediate") | |
| studentTypeClass.push(" badge-warning"); | |
| return ( | |
| <span className={studentTypeClass.join(" ")}>{ props.courseComplexityType }</span> |
This file contains hidden or 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
| const CourseComplexity = function ({ courseComplexityType }) { | |
| const studentTypeClass = ["badge", "badge-pill"]; | |
| if (courseComplexityType === "Beginner") studentTypeClass.push("badge-primary"); | |
| else if (courseComplexityType === "Intermediate") | |
| studentTypeClass.push(" badge-warning"); | |
| return ( | |
| <span className={studentTypeClass.join(" ")}>{courseComplexityType}</span> | |
| ); |
This file contains hidden or 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
| import React, { Component } from 'react'; | |
| import App from './App'; | |
| class App extends Component { | |
| render() { | |
| return ( | |
| <h1>Hello {this.props.message}</h1> | |
| ); | |
| } | |
| } |
This file contains hidden or 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
| const React = require( 'react' ); | |
| const CreateReactClass = require( 'create-react-class' ); | |
| const App = CreateReactClass( { | |
| getDefaultProps() { | |
| return { | |
| message: 'world' | |
| } | |
| }, | |
| render() { |
This file contains hidden or 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
| import React, { Component } from 'react'; | |
| class App2 extends Component { | |
| state = { | |
| message: 'world' | |
| } | |
| render() { | |
| return ( | |
| <h1>Hello {this.state.message} in ES6 classes outside of constuctor</h1> |
This file contains hidden or 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
| import React, { Component } from 'react'; | |
| class App2 extends Component { | |
| constructor( props ) { | |
| super( props ); | |
| this.state = { | |
| message: 'world' | |
| } | |
| } | |
| render() { |
This file contains hidden or 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
| const React = require( 'react' ); | |
| const CreateReactClass = require( 'create-react-class' ); | |
| const App = CreateReactClass( { | |
| getInitialState() { | |
| return { | |
| message: 'world' | |
| } | |
| }, | |
| render() { |
This file contains hidden or 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
| const React = require( 'react' ); | |
| class App extends React.Component{ | |
| render() { | |
| return ( | |
| <h1>Hello world</h1> | |
| ) | |
| } | |
| } |