Skip to content

Commit

Permalink
feat: add more update func
Browse files Browse the repository at this point in the history
  • Loading branch information
CorrectRoadH committed Aug 15, 2024
1 parent 4d8680d commit 6e231c1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/ysk/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ func (yskCard YSKCard) WithList(params []YSKCardListItem) YSKCard {
return yskCard
}

func (yskCard YSKCard) WithIconText(icon YSKCardIcon, description string) YSKCard {
yskCard.Content.BodyIconWithText = &YSKCardIconWithText{
Icon: icon,
Description: description,
}
return yskCard
}

// replace the all old action
func (yskCard YSKCard) WithFooterActions(actions []YSKCardFooterAction) YSKCard {
yskCard.Content.FooterActions = actions
return yskCard
}

// it will replace the old action by same side and style
func (YSKCard YSKCard) UpsertFooterAction(action YSKCardFooterAction) YSKCard {
for i, a := range YSKCard.Content.FooterActions {
Expand Down

0 comments on commit 6e231c1

Please sign in to comment.