Skip to content

Commit

Permalink
migrate UnorderedList to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
JKobrynski committed Oct 31, 2023
1 parent 4d75c0c commit 8687ed3
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import PropTypes from 'prop-types';
import React from 'react';
import {View} from 'react-native';
import _ from 'underscore';
import styles from '@styles/styles';
import Text from './Text';

const propTypes = {
type UnorderedListProps = {
/** An array of strings to display as an unordered list */
items: PropTypes.arrayOf(PropTypes.string),
};
const defaultProps = {
items: [],
items: string[];
};

function UnorderedList(props) {
function UnorderedList({items = []}: UnorderedListProps) {
return (
<>
{_.map(props.items, (itemText) => (
{items.map((itemText) => (
<View
key={itemText}
style={[styles.flexRow, styles.alignItemsStart, styles.ml2]}
Expand All @@ -30,7 +25,4 @@ function UnorderedList(props) {
}

UnorderedList.displayName = 'UnorderedList';
UnorderedList.propTypes = propTypes;
UnorderedList.defaultProps = defaultProps;

export default UnorderedList;

0 comments on commit 8687ed3

Please sign in to comment.