<commit_before>'use strict'

const { h } = require('preact')
const { css } = require('glamor')

const { LIGHT } = require('../styles/colors')

const NavItem = require('./NavItem')

const style = {

	self: css({
		flex: '0 0 auto',
		display: 'flex',
		flexDirection: 'column',
		position: 'relative',
		padding: '0 .5em 0 1em',
		minWidth: '10vw',
		width: '300px',
		maxWidth: '90vw'
	}),

	scroller: css({
		flex: '1 1 auto',
		padding: '1em 0',
		height: '100%',
		overflow: 'auto'
	})

}

module.exports = ({ components, currentComponent, setCurrentComponent }) => (

	h('nav', { class: style.self.toString() },
		h('div', { class: style.scroller.toString() },
			components.map((component) =>
				h(NavItem, {
					id: component.id,
					label: component.id,
					active: component.id===(currentComponent || {}).id,
					setCurrentComponent
				})
			)
		)
	)

)<commit_msg>Better scrolling for Nav<commit_after>'use strict'

const { h } = require('preact')
const { css } = require('glamor')

const { LIGHT } = require('../styles/colors')

const NavItem = require('./NavItem')

const style = {

	self: css({
		flex: '0 0 auto',
		display: 'flex',
		flexDirection: 'column',
		position: 'relative',
		padding: '0 .5em 0 1em',
		minWidth: '10vw',
		width: '300px',
		maxWidth: '90vw'
	}),

	scroller: css({
		flex: '1 1 auto',
		padding: '1em 0',
		height: '100%',
		overflow: 'auto',
		WebkitOverflowScrolling: 'touch'
	})

}

module.exports = ({ components, currentComponent, setCurrentComponent }) => (

	h('nav', { class: style.self.toString() },
		h('div', { class: style.scroller.toString() },
			components.map((component) =>
				h(NavItem, {
					id: component.id,
					label: component.id,
					active: component.id===(currentComponent || {}).id,
					setCurrentComponent
				})
			)
		)
	)

)
{'fraction_non_alphanumeric': 0.1883656509695291, 'fraction_numerical': 0.0221606648199446, 'mean_word_length': 3.4702970297029703, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2447531', 'n_tokens_mistral': 754, 'n_tokens_neox': 641, 'n_words': 149}