diff --git a/src/components/Issue/Segments.tsx b/src/components/Issue/Segments.tsx index df2130e..45d6bbc 100644 --- a/src/components/Issue/Segments.tsx +++ b/src/components/Issue/Segments.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { HTMLAttributes } from 'react'; +import { capitalizeFirstChar as capitalize } from 'src/util/strings'; import './Issue.css'; @@ -9,8 +10,6 @@ interface Props extends HTMLAttributes { children: any; } -const capitalize = (str: string) => `${str[0].toUpperCase()}${str.slice(1)}`; - export default ({ issue, children, ...props }: Props) => { const renderTitle = () => (

{issue.title}

diff --git a/src/components/IssueList/IssueListItem.tsx b/src/components/IssueList/IssueListItem.tsx index 769bac3..966c41f 100644 --- a/src/components/IssueList/IssueListItem.tsx +++ b/src/components/IssueList/IssueListItem.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import { HTMLAttributes } from 'react'; import * as classnames from 'classnames'; +import { capitalizeFirstChar } from 'src/util/strings'; interface Props extends HTMLAttributes { issue: Issue; @@ -15,12 +16,12 @@ export default ({ issue, className, ...props }: Props) => (

{new Date(issue.dateUpdated).toDateString()}

-

{issue.type} | {issue.severity}

+

{capitalizeFirstChar(issue.type)} | {capitalizeFirstChar(issue.severity)}

{issue.creator.username}

-

{issue.status}

+

{capitalizeFirstChar(issue.status)}

); diff --git a/src/util/strings.ts b/src/util/strings.ts new file mode 100644 index 0000000..43f4cea --- /dev/null +++ b/src/util/strings.ts @@ -0,0 +1,2 @@ +export const capitalizeFirstChar = (str: string): string => + `${str[0].toUpperCase()}${str.slice(1)}`;