Jobs datamodel updates + creation of cards for jobs detail screen.

This commit is contained in:
Patrick Fic
2020-01-09 11:47:18 -08:00
parent 16eceb192f
commit e3357910b9
33 changed files with 907 additions and 22 deletions

View File

@@ -1,8 +1,29 @@
import React from "react";
import { useTranslation } from "react-i18next";
import { Card } from "antd";
import CardTemplate from "./job-detail-cards.template.component";
import PhoneFormatter from "../../utils/PhoneFormatter";
export default function JobDetailCardsCustomerComponent({ loading, data }) {
const { t } = useTranslation();
return <Card loading={loading}>Card has loaded.</Card>;
return (
<CardTemplate loading={loading} title={t("jobs.labels.cards.customer")}>
{data ? (
<span>
<div>{`${data?.pit_owner_first_name ??
""} ${data.pit_owner_last_name ?? ""}`}</div>
<div>
<PhoneFormatter>{`${data?.pit_owner_phone ?? ""}`}</PhoneFormatter>
</div>
{data?.pit_owner_email ? (
<a href={`mailto:${data.pit_owner_email}`}>
<div>{`${data?.pit_owner_email ?? ""}`}</div>
</a>
) : null}
<div>{`${data?.owner.preferred_contact ?? ""}`}</div>
</span>
) : null}
</CardTemplate>
);
}