Added formatting for jobs lists and jobs detail components

This commit is contained in:
Patrick Fic
2020-10-14 22:37:49 -07:00
parent 76f8a17b92
commit 0456543574
24 changed files with 616 additions and 30 deletions

View File

@@ -0,0 +1,6 @@
import React from "react";
import Dinero from "dinero.js";
export default function CurrencyFormatterAtom({ children, ...restProps }) {
const m = Dinero({ amount: Math.round((children || 0) * 100) });
return <div>{m.toFormat()}</div>;
}

View File

@@ -0,0 +1,23 @@
import { Button, Result } from "antd";
import React from "react";
export default function ErrorResultAtom({
title,
errorMessage,
tryAgainCallback,
}) {
return (
<Result
status="500"
title={title}
subTitle={errorMessage}
extra={
tryAgainCallback ? (
<Button type="primary" onClick={() => tryAgainCallback()}>
Try Again
</Button>
) : null
}
/>
);
}

View File

@@ -0,0 +1,12 @@
import { Tooltip } from "antd";
import moment from "moment";
import React from "react";
export default function TimeAgoFormatter(props) {
const m = moment(props.children);
return props.children ? (
<Tooltip placement="top" title={m.format("MM/DD/YYY hh:mm A")}>
{m.fromNow()}
</Tooltip>
) : null;
}