2020-08-05 19:59:13 +03:00
|
|
|
import * as React from "react";
|
|
|
|
import * as System from "~/components/system";
|
|
|
|
import * as Constants from "~/common/constants";
|
|
|
|
|
|
|
|
import SystemPage from "~/components/system/SystemPage";
|
|
|
|
import ViewSourceLink from "~/components/system/ViewSourceLink";
|
|
|
|
import CodeBlock from "~/components/system/CodeBlock";
|
|
|
|
import Group from "~/components/system/Group";
|
|
|
|
|
|
|
|
const images = [
|
|
|
|
"https://image.flaticon.com/icons/svg/145/145843.svg",
|
|
|
|
"https://image.flaticon.com/icons/svg/387/387561.svg",
|
|
|
|
"https://image.flaticon.com/icons/svg/3227/3227891.svg",
|
|
|
|
"https://image.flaticon.com/icons/svg/3227/3227891.svg",
|
|
|
|
"https://image.flaticon.com/icons/svg/3227/3227891.svg",
|
|
|
|
"https://image.flaticon.com/icons/svg/3227/3227891.svg",
|
|
|
|
];
|
|
|
|
|
|
|
|
export default class SystemAvatarGroup extends React.Component {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<SystemPage
|
|
|
|
title="SDS: Avatar Group"
|
|
|
|
description="..."
|
2020-08-07 02:06:54 +03:00
|
|
|
url="https://slate.host/_/system/avatar-group"
|
2020-08-05 19:59:13 +03:00
|
|
|
>
|
|
|
|
<System.H1>
|
|
|
|
Avatar Group <ViewSourceLink file="system/avatar-group.js" />
|
|
|
|
</System.H1>
|
|
|
|
<br />
|
|
|
|
<br />
|
2021-07-07 23:50:57 +03:00
|
|
|
<System.P1>
|
2021-03-08 13:13:56 +03:00
|
|
|
The AvatarGroup component is a compact way to show a group users or contributors.
|
2021-07-07 23:50:57 +03:00
|
|
|
</System.P1>
|
2020-08-05 19:59:13 +03:00
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<System.H2>Imports</System.H2>
|
|
|
|
<hr />
|
|
|
|
<br />
|
2021-07-07 23:50:57 +03:00
|
|
|
<System.P1>Import React and the AvatarGroup Component.</System.P1>
|
2020-08-05 19:59:13 +03:00
|
|
|
<br />
|
|
|
|
<CodeBlock>
|
|
|
|
{`import * as React from "react";
|
2021-03-08 13:13:56 +03:00
|
|
|
import { AvatarGroup } from "slate-react-system";`}
|
2020-08-05 19:59:13 +03:00
|
|
|
</CodeBlock>
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<System.H2>Usage</System.H2>
|
|
|
|
<hr />
|
|
|
|
<br />
|
2021-07-07 23:50:57 +03:00
|
|
|
<System.P1>Create an array of images.</System.P1>
|
2020-08-05 19:59:13 +03:00
|
|
|
<br />
|
|
|
|
<CodeBlock>
|
|
|
|
{`const images = [
|
|
|
|
"avatar-01.jpg",
|
|
|
|
"avatar-02.jpg",
|
|
|
|
"avatar-04.jpg",
|
|
|
|
"avatar-05.jpg",
|
|
|
|
"avatar-06.jpg",
|
|
|
|
];`}
|
|
|
|
</CodeBlock>
|
|
|
|
<br />
|
|
|
|
<br />
|
2021-07-07 23:50:57 +03:00
|
|
|
<System.P1>Declare the AvatarGroup component.</System.P1>
|
2020-08-05 19:59:13 +03:00
|
|
|
<br />
|
|
|
|
<CodeBlock>{`<AvatarGroup avatars={images} />`}</CodeBlock>
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<System.H2>Output</System.H2>
|
|
|
|
<hr />
|
|
|
|
<br />
|
|
|
|
<System.AvatarGroup avatars={images} size="48" />
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<System.H2>Accepted React Properties</System.H2>
|
|
|
|
<hr />
|
|
|
|
<br />
|
|
|
|
<Group title="AvatarGroup">
|
|
|
|
<System.Table
|
|
|
|
data={{
|
|
|
|
columns: [
|
|
|
|
{ key: "a", name: "Name", width: "128px" },
|
|
|
|
{ key: "b", name: "Type", width: "88px", type: "OBJECT_TYPE" },
|
|
|
|
{ key: "c", name: "Default", width: "88px" },
|
|
|
|
{ key: "d", name: "Description", width: "100%" },
|
|
|
|
],
|
|
|
|
rows: [
|
|
|
|
{
|
|
|
|
id: 1,
|
|
|
|
a: "size",
|
|
|
|
b: "int",
|
|
|
|
c: "32",
|
|
|
|
d: "Size of the avatar images in pixels",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 2,
|
|
|
|
a: "limit",
|
|
|
|
b: "int",
|
|
|
|
c: "3",
|
|
|
|
d: "Limit the number of visable avatars",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 3,
|
|
|
|
a: "avatars",
|
|
|
|
b: "array",
|
|
|
|
c: "[]",
|
|
|
|
d: "An array of images",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 5,
|
|
|
|
a: "border",
|
|
|
|
b: "string",
|
|
|
|
c: "white",
|
|
|
|
d: "Avatar border color",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</Group>
|
|
|
|
</SystemPage>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|