<commit_before>// @flow

import React from 'react'
import {Text, StyleSheet, Platform, Dimensions} from 'react-native'
import Icon from 'react-native-vector-icons/Entypo'
import type {ViewType} from '../views'
import {Touchable} from '../components/touchable'
import * as c from '../components/colors'

const Viewport = Dimensions.get('window')

export function HomeScreenButton({
  view,
  onPress,
}: {
  view: ViewType,
  onPress: () => any,
}) {
  return (
    <Touchable
      highlight={false}
      onPress={onPress}
      style={[styles.rectangle, {backgroundColor: view.tint}]}
    >
      <Icon name={view.icon} size={32} style={styles.rectangleButtonIcon} />
      <Text style={styles.rectangleButtonText}>
        {view.title}
      </Text>
    </Touchable>
  )
}

export const CELL_MARGIN = 10
const cellVerticalPadding = 8
const cellHorizontalPadding = 4
const cellWidth = Viewport.width / 2 - CELL_MARGIN * 1.5

const styles = StyleSheet.create({
  // Main buttons for actions on home screen
  rectangle: {
    width: cellWidth,
    alignItems: 'center',
    justifyContent: 'center',
    paddingTop: cellVerticalPadding,
    paddingBottom: cellVerticalPadding / 2,
    paddingHorizontal: cellHorizontalPadding,
    borderRadius: Platform.OS === 'ios' ? 6 : 3,<commit_msg>fetch Viewport on every render in homescreen<commit_after>// @flow

import React from 'react'
import {Text, StyleSheet, Platform, Dimensions} from 'react-native'
import Icon from 'react-native-vector-icons/Entypo'
import type {ViewType} from '../views'
import {Touchable} from '../components/touchable'
import * as c from '../components/colors'

export function HomeScreenButton({
  view,
  onPress,
}: {
  view: ViewType,
  onPress: () => any,
}) {
  const screenWidth = Dimensions.get('window').width
  const style = {
    width: screenWidth / 2 - CELL_MARGIN * 1.5,
    backgroundColor: view.tint,
  }

  return (
    <Touchable
      highlight={false}
      onPress={onPress}
      style={[styles.rectangle, style]}
    >
      <Icon name={view.icon} size={32} style={styles.rectangleButtonIcon} />
      <Text style={styles.rectangleButtonText}>
        {view.title}
      </Text>
    </Touchable>
  )
}

export const CELL_MARGIN = 10
const cellVerticalPadding = 8
const cellHorizontalPadding = 4

const styles = StyleSheet.create({
  // Main buttons for actions on home screen
  rectangle: {
    alignItems: 'center',
    justifyContent: 'center',
    paddingTop: cellVerticalPadding,
    paddingBottom: cellVerticalPadding / 2,
    paddingHorizontal: cellHorizontalPadding,
    borderRadius: Platform.OS === 'ios' ? 6 : 3,
{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.009174311926605505, 'mean_word_length': 3.6483126110124333, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, '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': '3073207', 'n_tokens_mistral': 813, 'n_tokens_neox': 791, 'n_words': 213}