Added formatting for jobs lists and jobs detail components
This commit is contained in:
@@ -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>;
|
||||
}
|
||||
23
src/components/atoms/error-result/error-result.atom.jsx
Normal file
23
src/components/atoms/error-result/error-result.atom.jsx
Normal 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
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user