-
Notifications
You must be signed in to change notification settings - Fork 518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show new event button in Agenda view when it's empty (for single and two columns layout) #7143
Show new event button in Agenda view when it's empty (for single and two columns layout) #7143
Conversation
00cd332
to
023aa4e
Compare
dcf2a1c
to
6f4e46d
Compare
src/gui/base/buttons/BaseButton.ts
Outdated
@@ -61,3 +64,20 @@ export class BaseButton implements ClassComponent<BaseButtonAttrs> { | |||
function booleanToAttributeValue(value: boolean | null | undefined): string | null { | |||
return value != null ? String(value) : null | |||
} | |||
|
|||
export function renderNewEventButton(buttonAttrs: { label: TranslationKey; click: ClickHandler; style?: Record<string, any> }): Children { |
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.
The name should be more generic in this case since this button is also used to create a new email.
src/gui/base/buttons/BaseButton.ts
Outdated
@@ -61,3 +64,20 @@ export class BaseButton implements ClassComponent<BaseButtonAttrs> { | |||
function booleanToAttributeValue(value: boolean | null | undefined): string | null { | |||
return value != null ? String(value) : null | |||
} | |||
|
|||
export function renderNewEventButton(buttonAttrs: { label: TranslationKey; click: ClickHandler; style?: Record<string, any> }): Children { |
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.
This isn't a base button, it's worthwhile to have it's own file
label: "newEvent_action", | ||
click: () => attrs.onCreateEvent?.(), | ||
style: { | ||
"margin-top": ".6rem", |
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.
We have some utility classes for sizing and margins that we should use to keep the spacing standardized, take a look at main-styles.ts#L266
7c8d073
to
2469943
Compare
2469943
to
0b908e7
Compare
0b908e7
to
e3259b4
Compare
e3259b4
to
24f5c3c
Compare
Closes #7139