{"size": 1153, "ext": "js", "max_stars_repo_path": "src/components/ScrollToBottomButton.js", "max_stars_repo_name": "iamprayush/chatwoot-mobile-app", "max_stars_repo_stars_event_min_datetime": "2020-01-14T08:03:24.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-23T14:31:25.000Z", "max_issues_repo_path": "src/components/ScrollToBottomButton.js", "max_issues_repo_name": "iamprayush/chatwoot-mobile-app", "max_issues_repo_issues_event_min_datetime": "2020-01-14T17:49:49.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T19:10:57.000Z", "max_forks_repo_path": "src/components/ScrollToBottomButton.js", "max_forks_repo_name": "iamprayush/chatwoot-mobile-app", "max_forks_repo_forks_event_min_datetime": "2020-01-18T10:01:47.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:59:24.000Z"}
{"max_stars_count": 318, "max_issues_count": 236, "max_forks_count": 136, "avg_line_length": 22.6078431373, "max_line_length": 89, "alphanum_fraction": 0.6426712923}
import React from 'react';
import { TouchableOpacity } from 'react-native';
import { useStyleSheet, StyleService, Icon } from '@ui-kitten/components';
import PropTypes from 'prop-types';
import { theme } from '../theme';

const styles = StyleService.create({
  button: {
    shadowColor: '#000',
    shadowOffset: {
      width: 0,
      height: 2,
    },
    shadowOpacity: 0.25,
    shadowRadius: 3.84,
    elevation: 5,
    alignItems: 'center',
    justifyContent: 'center',
    width: 40,
    position: 'absolute',
    bottom: 10,
    right: 10,
    height: 40,
    backgroundColor: theme['color-basic-100'],
    borderRadius: 100,
  },
});

const propTypes = {
  scrollToBottom: PropTypes.func.isRequired,
};

const ScrollToButton = ({ scrollToBottom }) => {
  const style = useStyleSheet(styles);

  return (
    <TouchableOpacity onPress={scrollToBottom} style={style.button} activeOpacity={0.95}>
      <Icon
        name="arrowhead-down-outline"
        width={16}
        height={16}
        fill={theme['color-primary-default']}
      />
    </TouchableOpacity>
  );
};

ScrollToButton.propTypes = propTypes;

export default ScrollToButton;
