-
Notifications
You must be signed in to change notification settings - Fork 40
Add HorizontalActionList Component #511
Conversation
what if ActionLink accepted additional props to support this? then ActionLinkList would just need a |
@swese44 I like the idea of ActionLink accepting additional props to achieve the correct look, there are only two things that are different. The iconSize and gutterSize are smaller. I see couple of options to handle this. Right now I like adding a It would look like this:
|
@@ -16,7 +16,12 @@ export interface BaseActionLinkProps extends BaseComponentProps { | |||
/** | |||
* The visible text. | |||
*/ | |||
text: string; | |||
text: string | React.ReactNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this remain only string? it looks like you solved this with only string and we probably don't want to allow arbitrary markup here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
* A set of links that dispaly in a horizontal list below a message post. When a maxVisibleItemCount | ||
* prop is provided, items that exceed this value will show in a overflow menu. | ||
*/ | ||
export class MessageActionsList extends React.Component<MessageActionsListProps & CustomizableComponentProps> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice to name this something more generic so can be associated with a content item rather than Message. i'd expect to see yammer-web-components owning a <MessageActionsList>
component which feeds the correct message-specific actions to this reusable UI component. maybe this could just be HorizontalActionList, or CompactActionList, ContentActionList... i don't think i'm coming up with any winners though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. @cainhimself do you have any ideas or opinions here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've opted for HorizontalActionList
.
maxVisibleItemCount?: number; | ||
} | ||
|
||
export type MessageActionsListItem = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like we're duplicating ActionLink props, but losing the nuance of it's compound prop types (link or clickable). should we remove this interface and set line 9 to items: ActionItemProps[]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree this could be better. There are two things that led me to create the new interface here.
ActionLink
has an optionalariaLabel
,menuButton
requires it.- Currently unlinkedText is rendered by the list component, not the ActionLink.
I'll try to figure something out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so menuButton options have to be onclick handlers, not hyperlinks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your call on this, whether it makes sense to extend ActionItemProps[] or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think I've improved it. Let me know what you think.
@@ -15,7 +15,7 @@ export default class AppContainer extends React.Component<NestableBaseComponentP | |||
const { children, className, theme = defaultTheme } = this.props; | |||
const classNames = getClassNames({ theme }); | |||
return ( | |||
<Fabric> | |||
<Fabric theme={theme}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might need to double check this when you merge from master as Donnie's PR has been merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I see it's conflicting. I'll resolve it.
is there anything blocking this merge so we can start the MC import? |
@swese44, please feel free to merge this if it unblocks you. @cainhimself is looking for changes to the menuButton spacing, but I'm happy to do this in a new PR next week. |
cool thanks |
Mocks: https://app.zeplin.io/project/5907d6451d2b06c6b36b2852/screen/5b7b17c4336cfa21f21efe87
Introduces a variation to ActionLink called "compact", which makes the link bold, has a smaller icon, and smaller gutter.