Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,74 +1,43 @@
import * as React from 'react';
import {
ExampleCard,
ComponentPage,
IComponentDemoPageProps,
PropertiesTableSet,
PageMarkdown
} from '@uifabric/example-app-base';
import { ComponentStatus } from '../../demo/ComponentStatus/ComponentStatus';
import { ActivityItemStatus } from './ActivityItem.checklist';
import { ActivityItemBasicExample } from './examples/ActivityItem.Basic.Example';
import { ActivityItemPersonaExample } from './examples/ActivityItem.Persona.Example';
import { ActivityItemCompactExample } from './examples/ActivityItem.Compact.Example';
import { IDemoPageProps } from '../../demo/components/IDemoPageProps';
import { DemoPage } from 'office-ui-fabric-react/lib/demo/components/DemoPage';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

office-ui-fabric-react/lib/demo [](start = 26, length = 31)

Did you mean to do a relative path import from here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I did actually mean to do relative.


const ActivityItemBasicExampleCode = require('!raw-loader!office-ui-fabric-react/src/components/ActivityItem/examples/ActivityItem.Basic.Example.tsx') as string;
const ActivityItemPersonaExampleCode = require('!raw-loader!office-ui-fabric-react/src/components/ActivityItem/examples/ActivityItem.Persona.Example.tsx') as string;
const ActivityItemCompactExampleCode = require('!raw-loader!office-ui-fabric-react/src/components/ActivityItem/examples/ActivityItem.Compact.Example.tsx') as string;

export class ActivityItemPage extends React.Component<IComponentDemoPageProps, {}> {
public render(): JSX.Element {
return (
<ComponentPage
title='ActivityItem'
componentName='ActivityItem'
componentUrl='https://github.com/OfficeDev/office-ui-fabric-react/tree/master/packages/office-ui-fabric-react/src/components/ActivityItem'
exampleCards={
<div>
<ExampleCard title='Activity Items with Icons' code={ ActivityItemBasicExampleCode }>
<ActivityItemBasicExample />
</ExampleCard>
<ExampleCard title='Activity Items with Personas' code={ ActivityItemPersonaExampleCode }>
<ActivityItemPersonaExample />
</ExampleCard>
<ExampleCard title='Compact Activity Items' code={ ActivityItemCompactExampleCode }>
<ActivityItemCompactExample />
</ExampleCard>
</div>
}
propertiesTables={
<PropertiesTableSet
sources={ [
require<string>('!raw-loader!office-ui-fabric-react/src/components/ActivityItem/ActivityItem.types.ts')
] }
/>
}
overview={
<PageMarkdown>
{ require<string>('!raw-loader!office-ui-fabric-react/src/components/ActivityItem/docs/ActivityItemOverview.md') }
</PageMarkdown>
}
bestPractices={
<div />
}
dos={
<PageMarkdown>
{ require<string>('!raw-loader!office-ui-fabric-react/src/components/ActivityItem/docs/ActivityItemDos.md') }
</PageMarkdown>
}
donts={
<PageMarkdown>
{ require<string>('!raw-loader!office-ui-fabric-react/src/components/ActivityItem/docs/ActivityItemDonts.md') }
</PageMarkdown>
}
isHeaderVisible={ this.props.isHeaderVisible }
componentStatus={
<ComponentStatus
{ ...ActivityItemStatus }
/>
}
/>
);
}
export const ActivityItemPageProps: IDemoPageProps = {
title: 'ActivityItem',
componentName: 'ActivityItem',
componentUrl: 'https://github.com/OfficeDev/office-ui-fabric-react/tree/master/packages/office-ui-fabric-react/src/components/ActivityItem',
componentStatus: ActivityItemStatus,
examples: [
{
title: 'Activity Items with Icons',
code: ActivityItemBasicExampleCode,
view: <ActivityItemBasicExample />
},
{
title: 'Activity Items with Personas',
code: ActivityItemPersonaExampleCode,
view: <ActivityItemPersonaExample />
},
{
title: 'Compact Activity Items',
code: ActivityItemCompactExampleCode,
view: <ActivityItemCompactExample />
}
],
propertiesTablesSources: [require<string>('!raw-loader!office-ui-fabric-react/src/components/ActivityItem/ActivityItem.types.ts')],
overview: require<string>('!raw-loader!office-ui-fabric-react/src/components/ActivityItem/docs/ActivityItemOverview.md'),
bestPractices: '',
dos: require<string>('!raw-loader!office-ui-fabric-react/src/components/ActivityItem/docs/ActivityItemDos.md'),
donts: require<string>('!raw-loader!office-ui-fabric-react/src/components/ActivityItem/docs/ActivityItemDonts.md'),
isHeaderVisible: true,
};

}
export const ActivityItemPage = (props: { isHeaderVisible: boolean }) => (<DemoPage { ...{ ...ActivityItemPageProps, ...props } } />);
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { IDemoPageProps } from './IDemoPageProps';
import { ComponentPage, ExampleCard, PropertiesTableSet, PageMarkdown } from '@uifabric/example-app-base';
import * as React from 'react';
import { ComponentStatus } from 'office-ui-fabric-react/lib/demo/ComponentStatus/ComponentStatus';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto-import keeps giving me non relative stuff

export function DemoPage(componentPageProps: IDemoPageProps) {
return (
<ComponentPage
title={ componentPageProps.title }
componentName={ componentPageProps.componentName }
componentUrl={ componentPageProps.componentUrl }
exampleCards={
<div>
{ componentPageProps.examples.map(example => (
<ExampleCard title={ example.title } code={ example.code } key={ example.title }>
{ example.view }
</ExampleCard>
)) }
</div>
}
propertiesTables={
<PropertiesTableSet
sources={ componentPageProps.propertiesTablesSources }
/>
}
overview={
<PageMarkdown>
{ componentPageProps.overview }
</PageMarkdown>
}
bestPractices={
<PageMarkdown>
{ componentPageProps.bestPractices }
</PageMarkdown>
}
dos={
<PageMarkdown>
{ componentPageProps.dos }
</PageMarkdown>
}
donts={
<PageMarkdown>
{ componentPageProps.donts }
</PageMarkdown>
}
isHeaderVisible={ componentPageProps.isHeaderVisible }
componentStatus={
<ComponentStatus
{ ...componentPageProps.componentStatus }
/>
}
/>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { IComponentStatusProps } from 'office-ui-fabric-react/lib/demo/ComponentStatus/ComponentStatus.types';

export interface IDemoPageProps {
title: string;
componentName: string;
componentUrl: string;
componentStatus: IComponentStatusProps;
examples: {
title: string;
code: string;
view: JSX.Element;
}[];
propertiesTablesSources: string[];
overview: string;
dos: string;
donts: string;
bestPractices: string;
isHeaderVisible: boolean;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 things:

  1. we no longer call props pages ComponentProps.ts in Fabric. Instead, it is presently .types.ts
  2. need js doc here :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it matter that this isn't going to be something we document with api documenter tool?