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 from 'react' | |
import ReactDom from 'react-dom' | |
import App from '.' | |
it('renders without crashing', () => { | |
const div = document.createElement{'div'}; | |
ReactDOM.render(<App/ >, div); | |
ReactDOM.unmountComponentAtNode(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
class SateInsideConstructor extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
counter: 0 | |
} | |
} | |
/* your logic */ | |
} |
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 from 'react' | |
class MyComponent extends React.Component { | |
state = { | |
counter: 0 | |
} | |
/* your logic */ | |
} |
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 from 'react'; | |
import { Col, Row } from 'shards-react'; | |
import MediumCard from './MediumCard'; | |
// wrapper for items | |
class Slider extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { itemRows: [], avatar: '', profileLink: '' }; |
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
export default function ToText(node) { | |
let tag = document.createElement("div"); | |
tag.innerHTML = node; | |
node = tag.innerText; | |
return node; | |
} | |
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
export default function ShortenText(text, startingPoint, maxLength) { | |
return text.length > maxLength | |
? text.slice(startingPoint, maxLength) | |
: text; | |
} |
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 from 'react'; | |
import { Card, CardBody } from 'shards-react'; | |
import ShortenText from '../utils/ShortenText'; | |
import ToText from '../utils/ToText'; | |
import { faUser, faCalendarAlt } from '@fortawesome/free-solid-svg-icons'; | |
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | |
// functional card component to display single item | |
export default function MediumCard(props) { | |
var shortMonthName = new Intl.DateTimeFormat('en-US', { | |
month: 'short' |
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 from 'react'; | |
import Slider from './Slider'; | |
import { Col } from 'shards-react'; | |
function App() { | |
return ( | |
<React.Fragment> | |
<Col xs="12" sm="4" className="text-sm-left text-center text-md-left mb-sm-0"> | |
<span className="text-uppercase page-subtitle">Components</span> | |
<h3 className="page-title">Posts</h3> |
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
export class Maps extends React.Component { | |
render() { | |
const mapStyles = { | |
width: "100%", | |
height: "100%", | |
}; | |
return ( | |
<Map | |
google={this.props.google} | |
zoom={15} |