Skip to content

Instantly share code, notes, and snippets.

@goatslacker
Created August 29, 2016 22:10
Show Gist options
  • Save goatslacker/6aa9f5166ea990cd649705b54dc22e47 to your computer and use it in GitHub Desktop.
Save goatslacker/6aa9f5166ea990cd649705b54dc22e47 to your computer and use it in GitHub Desktop.
function Matchup(props) {
const matchups = props.name ? idealMatchup.overall(props.name) : []
return (
$(B.View, [
$(B.Header, 'Ideal Matchup'),
$(B.Text, 'This is calculated based on the opposing Pokemon\'s type and assuming the opponent has the best possible moveset combination for their Pokemon. The results do not include legendaries. Pokemon type effectiveness and resistances are also taken into account.'),
$('hr'),
$(FormPokemonName, { name: props.name }),
matchups.length ? (
$(B.Table, {
border: true,
}, [
$('thead', [
$('tr', [
$('th', 'Name'),
$('th', 'Moves'),
], '/tr'),
], '/thead'),
$('tbody', matchups.map((value) => (
$('tr', [
$('td', [
$(B.Text, { strong: true }, value.name),
$(B.Text, `${value.net.toFixed(3)} Net TTL`),
], '/td'),
$('td', [
$(B.Text, value.quick),
$(B.Text, value.charge),
], '/td'),
], '/tr')
)), '/tbody'),
], '/table')
) : undefined,
])
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment