-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show new event button in Agenda view when it's empty (for single and …
…two columns layout)
- Loading branch information
1 parent
f97dedb
commit 892b95f
Showing
4 changed files
with
41 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { lang, TranslationKey } from "../misc/LanguageViewModel.js" | ||
import { ClickHandler } from "./base/GuiUtils.js" | ||
import m, { Children } from "mithril" | ||
import { theme } from "./theme.js" | ||
import { px, size } from "./size.js" | ||
import { BaseButton, BaseButtonAttrs } from "./base/buttons/BaseButton.js" | ||
|
||
export interface MainCreateButtonAttrs { | ||
label: TranslationKey | ||
click: ClickHandler | ||
class?: string | ||
} | ||
|
||
/** | ||
* Main button used to open the creation dialog for emails,contacts and events. | ||
*/ | ||
export const MainCreateButton = (buttonAttrs: MainCreateButtonAttrs): Children => { | ||
const label = lang.get(buttonAttrs.label) | ||
return m(BaseButton, { | ||
label, | ||
text: label, | ||
onclick: buttonAttrs.click, | ||
class: `full-width border-radius-big center b flash ${buttonAttrs.class}`, | ||
style: { | ||
border: `2px solid ${theme.content_accent}`, | ||
// matching toolbar | ||
height: px(size.button_height + size.vpad_xs * 2), | ||
color: theme.content_accent, | ||
}, | ||
} satisfies BaseButtonAttrs) | ||
} |