diff --git a/src/components/DocumentCard/DocumentCard.Props.ts b/src/components/DocumentCard/DocumentCard.Props.ts index ce204741f69af6..22bd40bb8b61e1 100644 --- a/src/components/DocumentCard/DocumentCard.Props.ts +++ b/src/components/DocumentCard/DocumentCard.Props.ts @@ -7,6 +7,7 @@ import { DocumentCardActivity } from './DocumentCardActivity'; import { DocumentCardActions } from './DocumentCardActions'; import { PersonaInitialsColor } from '../../Persona'; import { ImageFit } from '../../Image'; +import { IButtonProps } from '../../Button'; export interface IDocumentCardProps extends React.Props { /** @@ -145,22 +146,10 @@ export interface IDocumentCardActionsProps extends React.Props void; -} diff --git a/src/components/DocumentCard/DocumentCardActions.tsx b/src/components/DocumentCard/DocumentCardActions.tsx index 44ab8e26355404..8dbdcec9bc2554 100644 --- a/src/components/DocumentCard/DocumentCardActions.tsx +++ b/src/components/DocumentCard/DocumentCardActions.tsx @@ -10,16 +10,14 @@ export class DocumentCardActions extends React.Component - { actions && actions.map((action, index) => ( -
-
- )) } + { actions && actions.map((action, index) => { + action.buttonType = ButtonType.icon; + return ( +
+
+ ); + }) } { views && (
diff --git a/src/demo/pages/DocumentCardPage/examples/DocumentCard.Complete.Example.tsx b/src/demo/pages/DocumentCardPage/examples/DocumentCard.Complete.Example.tsx index 163fd4e2188c9e..10a86032caf31d 100644 --- a/src/demo/pages/DocumentCardPage/examples/DocumentCard.Complete.Example.tsx +++ b/src/demo/pages/DocumentCardPage/examples/DocumentCard.Complete.Example.tsx @@ -62,28 +62,37 @@ export class DocumentCardCompleteExample extends React.Component { } /> { - console.log('You clicked the share action.'); - ev.preventDefault(); - ev.stopPropagation(); - } + actions={ + [ + { + icon: 'share', + onClick: (ev: any) => { + console.log('You clicked the share action.'); + ev.preventDefault(); + ev.stopPropagation(); }, - { icon: 'pinLeft', onClick: (ev: any) => { - console.log('You clicked the pin action.'); - ev.preventDefault(); - ev.stopPropagation(); - } + ariaLabel: 'share action' + }, + { + icon: 'pinLeft', + onClick: (ev: any) => { + console.log('You clicked the pin action.'); + ev.preventDefault(); + ev.stopPropagation(); }, - { icon: 'bell', onClick: (ev: any) => { - console.log('You clicked the bell action.'); - ev.preventDefault(); - ev.stopPropagation(); - } + ariaLabel: 'pin left action' + }, + { + icon: 'bell', + onClick: (ev: any) => { + console.log('You clicked the bell action.'); + ev.preventDefault(); + ev.stopPropagation(); }, - ] - } + ariaLabel: 'bell action' + }, + ] + } views={ 432 } />