<commit_before>/* eslint-disable no-unused-vars,global-require */
import React, { Component } from 'react';
import { View, Text, ScrollView, Image, TouchableHighlight, ActivityIndicator } from 'react-native';
import Search from 'react-native-search-box';
import { Button, Card } from 'react-native-elements';
import { Actions } from 'react-native-router-flux';
import Carousel from 'react-native-snap-carousel';

class Home extends Component {
  static componentName = 'Home';
  static searchBox = null;

  constructor(props) {
    super(props);

    this.state = {
      inSearch: false,
      data: {},
    };
  }

  // Important: You must return a Promise
  onFocus = text => new Promise((resolve, reject) => {
    this.setState({
      inSearch: true,
    });
    resolve();
  });

  onCancel = text => new Promise((resolve, reject) => {
    this.setState({
      inSearch: false,
    });
    resolve();
  });

  onChangeText = text => new Promise((resolve, reject) => {
    this.setState({
      inSearch: true,
    });
    resolve();
  });

  afterFocus = text => new Promise((resolve, reject) => {
    this.setState({
      inSearch: false,
    });
    resolve();
  });

  render() {
    const homeView = (
      <View style={{ paddingBottom: 20 }}>
        <TouchableHighlight
          activeOpacity={1}
          onPress={() => Actions.growthView()}
        >
          <Image
            source={require('../../../assets/growth-ui/img/home-5.jpg')}
            resizeMode="cover"
            borderRadius={6}
            style={{ marginLeft: 20, marginRight: 20, marginTop: 10, width: null, height: 120 }}
          >
            <View style={{ height: 40, opacity: 0.8, top: 80, backgroundColor: '#fff' }}>
              <Text style={{ textAlign: 'center', fontSize: 20, top: 8, color: '#000' }}> Growth 指南 </Text>
            </View>
          </Image>
        </TouchableHighlight>
        <TouchableHighlight
          activeOpacity={1}
          onPress={() => Actions.skillTree()}
        >
          <Image
            source={require('../../../assets/growth-ui/img/home-6.jpg')}
            resizeMode="cover"
            borderRadius={6}
            style={{ marginLeft: 20, marginRight: 20, marginTop: 10, width: null, height: 120 }}
          >
            <View style={{ height: 40, opacity: 0.8, top: 80, backgroundColor: '#fff' }}>
              <Text style={{ textAlign: 'center', fontSize: 20, top: 8, color: '#000' }}> Growth 技能树 </Text>
            </View>
          </Image>
        </TouchableHighlight>


        <View style={{ paddingTop: 20 }}>
          <Carousel
          // ref={(carousel) => { this._carousel = carousel; }}
            sliderWidth={600}
            itemWidth={120}
            itemHeight={80}
            firstItem={2}
            sliderHeight={80}
          >
            <View style={{ height: 80, backgroundColor: '#fff', width: 120 }}><Text>fasdf</Text></View>
            <View style={{ height: 80, backgroundColor: '#fff', width: 120 }}><Text>fasdf</Text></View>
            <View style={{ height: 80, backgroundColor: '#fff', width: 120 }}><Text>fasdf</Text></View>
            <View style={{ height: 80, backgroundColor: '#fff', width: 120 }}><Text>fasdf</Text></View>
            <View style={{ height: 80, backgroundColor: '#fff', width: 120 }}><Text>fasdf</Text></View>
          </Carousel>
        </View>

        <View style={{ paddingTop: 20 }}>
          <Text style={{ paddingLeft: 20 }}>今日精选</Text>
          <Card
            title="LeetCode"
            image={require('../../../assets/growth-ui/img/home-4.jpg')}
          >
            <Text style={{ marginBottom: 10 }}>
              LeetCode 是一些经典的公司用来面试应聘者的面试题。在 Growth 3.0 中，您可以下载 LeetCode 的题目在本地练习。
            </Text>
            <Button
              icon={{ name: 'code' }}<commit_msg>[Home] slider: fix issue<commit_after>/* eslint-disable no-unused-vars,global-require */
import React, { Component } from 'react';
import { View, Text, ScrollView, Image, TouchableHighlight, ActivityIndicator, Dimensions } from 'react-native';
import Search from 'react-native-search-box';
import { Button, Card } from 'react-native-elements';
import { Actions } from 'react-native-router-flux';
import Carousel from 'react-native-snap-carousel';

const sliderWidth = Dimensions.get('window').width;

class Home extends Component {
  static componentName = 'Home';
  static searchBox = null;

  constructor(props) {
    super(props);

    this.state = {
      inSearch: false,
      data: {},
    };
  }

  // Important: You must return a Promise
  onFocus = text => new Promise((resolve, reject) => {
    this.setState({
      inSearch: true,
    });
    resolve();
  });

  onCancel = text => new Promise((resolve, reject) => {
    this.setState({
      inSearch: false,
    });
    resolve();
  });

  onChangeText = text => new Promise((resolve, reject) => {
    this.setState({
      inSearch: true,
    });
    resolve();
  });

  afterFocus = text => new Promise((resolve, reject) => {
    this.setState({
      inSearch: false,
    });
    resolve();
  });

  render() {
    const homeView = (
      <View style={{ paddingBottom: 20 }}>
        <TouchableHighlight
          activeOpacity={1}
          onPress={() => Actions.growthView()}
        >
          <Image
            source={require('../../../assets/growth-ui/img/home-5.jpg')}
            resizeMode="cover"
            borderRadius={6}
            style={{ marginLeft: 20, marginRight: 20, marginTop: 10, width: null, height: 120 }}
          >
            <View style={{ height: 40, opacity: 0.8, top: 80, backgroundColor: '#fff' }}>
              <Text style={{ textAlign: 'center', fontSize: 20, top: 8, color: '#000' }}> Growth 指南 </Text>
            </View>
          </Image>
        </TouchableHighlight>
        <TouchableHighlight
          activeOpacity={1}
          onPress={() => Actions.skillTree()}
        >
          <Image
            source={require('../../../assets/growth-ui/img/home-6.jpg')}
            resizeMode="cover"
            borderRadius={6}
            style={{ marginLeft: 20, marginRight: 20, marginTop: 10, width: null, height: 120 }}
          >
            <View style={{ height: 40, opacity: 0.8, top: 80, backgroundColor: '#fff' }}>
              <Text style={{ textAlign: 'center', fontSize: 20, top: 8, color: '#000' }}> Growth 技能树 </Text>
            </View>
          </Image>
        </TouchableHighlight>


        <View style={{ paddingTop: 20 }}>
          <Carousel
          // ref={(carousel) => { this._carousel = carousel; }}
            sliderWidth={sliderWidth}
            itemWidth={120}
            itemHeight={80}
            firstItem={2}
            sliderHeight={80}
          >
            <View style={{ height: 80, backgroundColor: '#fff', width: 120 }}><Text>fasdf</Text></View>
            <View style={{ height: 80, backgroundColor: '#fff', width: 120 }}><Text>fasdf</Text></View>
            <View style={{ height: 80, backgroundColor: '#fff', width: 120 }}><Text>fasdf</Text></View>
            <View style={{ height: 80, backgroundColor: '#fff', width: 120 }}><Text>fasdf</Text></View>
            <View style={{ height: 80, backgroundColor: '#fff', width: 120 }}><Text>fasdf</Text></View>
          </Carousel>
        </View>

        <View style={{ paddingTop: 20 }}>
          <Text style={{ paddingLeft: 20 }}>今日精选</Text>
          <Card
            title="LeetCode"
            image={require('../../../assets/growth-ui/img/home-4.jpg')}
          >
            <Text style={{ marginBottom: 10 }}>
              LeetCode 是一些经典的公司用来面试应聘者的面试题。在 Growth 3.0 中，您可以下载 LeetCode 的题目在本地练习。
            </Text>
            <Button
              icon={{ name: 'code' }}
{'fraction_non_alphanumeric': 0.16714100905562743, 'fraction_numerical': 0.024708926261319535, 'mean_word_length': 2.17104183757178, 'pattern_counts': {'":': 0, '<': 99, '<?xml version=': 0, '>': 119, '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': '1654972', 'n_tokens_mistral': 2486, 'n_tokens_neox': 2352, 'n_words': 561}