{"size": 891, "ext": "js", "max_stars_repo_path": "src/utils/font-utils.js", "max_stars_repo_name": "Yaniislav/react-native-starter", "max_stars_repo_stars_event_min_datetime": "2018-11-12T16:44:25.000Z", "max_stars_repo_stars_event_max_datetime": "2020-10-23T08:43:26.000Z", "max_issues_repo_path": "src/utils/font-utils.js", "max_issues_repo_name": "Yaniislav/react-native-starter", "max_issues_repo_issues_event_min_datetime": "2019-07-31T08:53:52.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-12T10:56:43.000Z", "max_forks_repo_path": "src/utils/font-utils.js", "max_forks_repo_name": "Yaniislav/react-native-starter", "max_forks_repo_forks_event_min_datetime": "2019-05-31T05:22:21.000Z", "max_forks_repo_forks_event_max_datetime": "2020-01-06T19:09:28.000Z"}
{"max_stars_count": 13, "max_issues_count": 6, "max_forks_count": 4, "avg_line_length": 24.75, "max_line_length": 90, "alphanum_fraction": 0.6599326599}
import { StyleSheet } from 'react-native';

const getAndroidTextStyle = (style, isHanzipen) => {
  const fontWeight = style ? StyleSheet.flatten(style).fontWeight : null;
  const fontFamily = isHanzipen ? 'Hanzipen_SC_regular' : parseHelveticanFont(fontWeight);
  return {
    fontFamily,
    fontWeight: undefined,
  };
};

const parseHelveticanFont = (fontWeight) => {
  switch (fontWeight) { // eslint-disable-line
    // Thin
    case '100': return 'Helveticaneuecyr_thin';
    // Ultra Light
    case '200': return 'Helveticaneuecyr_ultralight';
    // Light
    case '300': return 'Helveticaneuecyr_light';
    // Regular
    case '400':
    // Medium
    case '500':
    // Semibold
    case '600':
    // Bold
    case '700':
    // Heavy
    case '800': return 'Helveticaneuecyr_bold';
    default:
      return 'Helveticaneuecyr_light';
  }
};

export default getAndroidTextStyle;
