-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
NeutralsPage.tsx
52 lines (48 loc) · 1.81 KB
/
NeutralsPage.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import * as React from 'react';
import { Markdown, ColorPalette, IPageSectionProps, IColorSwatch } from '@uifabric/example-app-base/lib/index2';
import { IStylesPageProps, StylesAreaPage } from '../StylesAreaPage';
import { ColorsNeutralsPageProps } from './NeutralsPage.doc';
import { Platforms } from '../../../interfaces/Platforms';
const baseUrl = 'https://github.com/OfficeDev/office-ui-fabric-react/tree/master/apps/fabric-website/src/pages/Styles/Colors/docs';
const neutralColors = require<IColorSwatch[]>('@uifabric/fabric-website/lib/data/colors-neutral.json');
export const ColorsNeutralsPage: React.StatelessComponent<IStylesPageProps> = props => {
const { platform } = props;
return (
<StylesAreaPage {...props} {...ColorsNeutralsPageProps[platform]} otherSections={_otherSections(platform) as IPageSectionProps[]} />
);
};
function _otherSections(platform: Platforms): IPageSectionProps<Platforms>[] {
switch (platform) {
case 'web':
return [
{
sectionName: 'Neutrals',
editUrl: `${baseUrl}/web/ColorsNeutrals.md`,
content: (
<>
<Markdown>
{require('!raw-loader!@uifabric/fabric-website/src/pages/Styles/Colors/docs/web/ColorsNeutrals.md') as string}
</Markdown>
<ColorPalette colors={neutralColors} />
</>
)
},
{
sectionName: 'Implementation',
editUrl: `${baseUrl}/web/ColorsImplementation.md`,
content: (
<Markdown>
{require('!raw-loader!@uifabric/fabric-website/src/pages/Styles/Colors/docs/web/ColorsImplementation.md') as string}
</Markdown>
)
}
];
default:
return [
{
sectionName: 'Coming soon',
content: '...'
}
];
}
}