Skip to content

Instantly share code, notes, and snippets.

<body>
<div id="app"></div>
<script type="text/javascript">
window.CSRF = 'j3IOfRLD-dVe0ZKTe_ZCmCpK1sXLW1Kv96uY'
window.VERSION = '0.5.5'
window.INITIAL_STATE = null
window.BASE_URL = 'http://www.airbank.cz'
const html = __DATA__.articles.map(article => {
return DOM.article({}, article.body)
})
</body>
<script>__DATA__=<?php echo json_encode($data) ?></script>
DOM.article({}, `
Tohle je článek, který právě píšu, bude mít několik set znaků
a je statický, protože HTML bylo navrženo pro statické stránky
a také tak slouží. Tahle stránka bude prostě naservírováná webserver
a navíc je maličká, takže celý přenost bude bleskově rychlý a nikoho tím
neurazíme. Naopak, potěšíme všechny rychlostí, protože to je to hlavní,
na co bychom měli při tvorbě webu myslet!`
)
// před tim
<TouchableOpacity onPress={() => this.handleToggleDay('Mo')} style={[styles.weekIcontouch, this.selected('Mo')]}>
<Text style={[styles.weekIcon, this.selectedText('Mo')]}>{I18n.t('_general.week.mondayShort')}</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => this.handleToggleDay('Tu')}>
<Text>{I18n.t('_general.week.tuesdayShort')}</Text>
</TouchableOpacity>
... a dalsi dny v tydnu
//komponenta
// před tim
<TouchableOpacity onPress={() => this.handleToggleDay('Mo')} style={[styles.weekIcontouch, this.selected('Mo')]}>
<Text style={[styles.weekIcon, this.selectedText('Mo')]}>{I18n.t('_general.week.mondayShort')}</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => this.handleToggleDay('Tu')}>
<Text>{I18n.t('_general.week.tuesdayShort')}</Text>
</TouchableOpacity>
... a dalsi dny v tydnu
//komponenta
// @flow
const arr = [[], []]
const fun = (x: number) => arr[x]
const a = fun(100).map(ba => ba.toLowerCase())
import React from 'react'
export default class React extends React.Component {
state = this._getState(this.props)
_getState() {
return {
shouldDisplayOnboarding: this.context.onboardingStore.shouldDisplayCommonOnboarding(this.props.appLocation)
const asyncFn = (email) => {
return new Promise((resolve, reject) => {
$.get('//idnes.cz/' + email, (err, result) => {
if (err) {
return resolve({
status: 'fail',
email: email,
})
}
import classes from './styles'
export default ({ visible }) => {
return (
<div className={visible ? classes.visible : classes.invisible}>This is some text</div>
)
}