Skip to content

Instantly share code, notes, and snippets.

// @flow
const arr = [[], []]
const fun = (x: number) => arr[x]
const a = fun(100).map(ba => ba.toLowerCase())
// 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
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!`
)
</body>
<script>__DATA__=<?php echo json_encode($data) ?></script>
const html = __DATA__.articles.map(article => {
return DOM.article({}, article.body)
})
<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'
<!doctype html>
<html lang="cs">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<!--[if lt IE 10]>
<body><div id="app"></div></body>
require.ensure([], (require) => {
const page = React.createFactory(require('./druha-stranka'))
this.setState({ page, url })
})