move Person type to ui-types

This commit is contained in:
Sebastian Sdorra
2020-06-10 10:02:49 +02:00
parent 324c23e509
commit 53fc01b0ba
5 changed files with 20 additions and 37 deletions

View File

@@ -22,7 +22,7 @@
* SOFTWARE.
*/
import React, { FC } from "react";
import { Changeset } from "@scm-manager/ui-types";
import { Changeset, Person } from "@scm-manager/ui-types";
import styled from "styled-components";
import { useTranslation } from "react-i18next";
import { useBinder } from "@scm-manager/ui-extensions";
@@ -36,12 +36,6 @@ const SizedTd = styled.td`
width: 10rem;
`;
// TODO get from ui-types?
type Person = {
name: string;
mail?: string;
};
const Contributor: FC<{ person: Person }> = ({ person }) => {
const [t] = useTranslation("repos");
const binder = useBinder();
@@ -101,7 +95,7 @@ const ContributorTable: FC<Props> = ({ changeset }) => {
{getTrailersByType().map(trailer => (
<tr key={trailer.type}>
<SizedTd>{t("changeset.trailer.type." + trailer.type) + ":"}</SizedTd>
<td className="shorten-text is-marginless">
<td className="is-ellipsis-overflow is-marginless">
<CommaSeparatedList>
{trailer.persons.map(person => (
<Contributor key={person.name} person={person} />