Skip to content

Commit

Permalink
Update "Save" and "Save and Edit" to new button style #1790
Browse files Browse the repository at this point in the history
  • Loading branch information
olatechpro committed Oct 14, 2024
1 parent ef56185 commit e61ab76
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
5 changes: 3 additions & 2 deletions modules/calendar/lib/async-calendar/js/Functions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,11 @@ export function getDateWithNoTimezoneOffset(dateString) {
}

export function getPostLinksElement(linkData, handleOnClick) {
var className = linkData.className ? linkData.className : '';
if (linkData.url) {
return (<a key={`link-${linkData.url}-${linkData.label}`} href={linkData.url}>{linkData.label}</a>);
return (<a key={`link-${linkData.url}-${linkData.label}`} href={linkData.url} className={className}>{linkData.label}</a>);
} else if (linkData.action) {
return (<a key={`link-${linkData.url}-${linkData.label}`} onClick={(e) => handleOnClick(e, linkData)}>{linkData.label}</a>);
return (<a key={`link-${linkData.url}-${linkData.label}`} className={className} onClick={(e) => handleOnClick(e, linkData)}>{linkData.label}</a>);
}
}

Expand Down
4 changes: 3 additions & 1 deletion modules/calendar/lib/async-calendar/js/ItemFormPopup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,14 @@ export default function ItemFormPopup(props) {
const formLinks = [
{
'id': 'create',
'className': 'button-primary calendar-create-btn',
'label': props.strings.save,
'labelLoading': props.strings.saving,
'action': 'publishpress_calendar_create_item'
},
{
'id': 'edit',
'className': 'button-secondary calendar-edit-btn',
'label': props.strings.saveAndEdit,
'labelLoading': props.strings.saving,
'action': 'publishpress_calendar_create_item'
Expand All @@ -393,7 +395,7 @@ export default function ItemFormPopup(props) {
} else {
links.push(getPostLinksElement(linkData, handleLinkOnClick));
}
links.push(<span key={`link-separator-${links.length}`}>|</span>);
links.push(<span key={`link-separator-${links.length}`}></span>);
}

links.pop();
Expand Down
2 changes: 1 addition & 1 deletion modules/calendar/lib/async-calendar/js/index.min.js

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion modules/calendar/lib/async-calendar/styles/async-calendar.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e61ab76

Please sign in to comment.