slate/pages/system/stats.js

74 lines
1.9 KiB
JavaScript
Raw Normal View History

2020-07-18 20:27:54 +03:00
import * as React from "react";
import * as System from "~/components/system";
2020-07-18 20:27:54 +03:00
import SystemPage from "~/components/system/SystemPage";
import ViewSourceLink from "~/components/system/ViewSourceLink";
import CodeBlock from "~/components/system/CodeBlock";
export default class SystemPageStats extends React.Component {
render() {
return (
2020-07-18 20:27:54 +03:00
<SystemPage
title="SDS: Stats"
description="..."
url="https://slate.host/system/stats"
2020-07-18 20:27:54 +03:00
>
<System.H1>
Stats <ViewSourceLink file="system/stats.js" />
</System.H1>
<br />
<br />
2020-07-18 20:27:54 +03:00
<System.P>
The System Stats component is used to show a system stat with an
upload or a download icon.
</System.P>
<br />
<br />
<br />
<System.H2>Imports</System.H2>
<hr />
<br />
<System.P>
Import React and the StatUpload and/or the StatDownload Components.
</System.P>
<br />
<br />
<CodeBlock>
2020-07-28 23:27:53 +03:00
{`import * as React from "react";
import { StatUpload, StatDownload } from "slate-react-system";`}
</CodeBlock>
<br />
<br />
2020-06-24 05:02:55 +03:00
<System.H2>Usage</System.H2>
<hr />
<br />
2020-07-18 20:27:54 +03:00
<System.P>
Delcare the StatUpload and/or the StatDownload components. Decimal
prop is optional as it defaults to 2
</System.P>
2020-06-24 05:02:55 +03:00
<br />
<CodeBlock>
{`class ExampleOne extends React.Component {
2020-07-28 23:27:53 +03:00
render() {
return <StatUpload size="40000000" decimal="5" />;
}
}
2020-06-24 05:02:55 +03:00
class ExampleTwo extends React.Component {
2020-07-28 23:27:53 +03:00
render() {
return <StatDownload size="40000000" />;
}
}`}
</CodeBlock>
2020-06-24 05:02:55 +03:00
<br />
<br />
<System.H2>Output</System.H2>
<hr />
<br />
2020-07-18 20:27:54 +03:00
<System.StatUpload size="40000000" decimal="5" />{" "}
<System.StatDownload size="40000000" />
</SystemPage>
);
}
}