diff --git a/src/components/status_action_buttons/action_button.js b/src/components/status_action_buttons/action_button.js new file mode 100644 index 000000000..85e247f59 --- /dev/null +++ b/src/components/status_action_buttons/action_button.js @@ -0,0 +1,83 @@ +import StatusBookmarkFolderMenu from 'src/components/status_bookmark_folder_menu/status_bookmark_folder_menu.vue' +import Popover from 'src/components/popover/popover.vue' + +import { library } from '@fortawesome/fontawesome-svg-core' +import { + faPlus, + faMinus, + faCheck, + faTimes, + faWrench, + + faReply, + faRetweet, + faStar, + faSmileBeam, + + faEllipsisH, + faBookmark, + faEyeSlash, + faThumbtack, + faShareAlt, + faExternalLinkAlt, + faHistory +} from '@fortawesome/free-solid-svg-icons' +import { + faStar as faStarRegular +} from '@fortawesome/free-regular-svg-icons' + +library.add( + faPlus, + faMinus, + faCheck, + faTimes, + faWrench, + + faReply, + faRetweet, + faStar, + faStarRegular, + faSmileBeam, + + faEllipsisH, + faBookmark, + faEyeSlash, + faThumbtack, + faShareAlt, + faExternalLinkAlt, + faHistory +) + +export default { + props: [ + 'button', + 'extra', + 'status', + 'funcArg', + 'animationState', + 'getClass', + 'getComponent', + 'doAction', + 'close' + ], + components: { + StatusBookmarkFolderMenu, + Popover + }, + computed: { + buttonClass () { + if (!this.extra) console.log(this.button.name) + return [ + this.button.name + '-button', + { + 'main-button': this.extra, + 'button-unstyled': !this.extra, + '-extra': this.extra, + '-quick': !this.extra, + '-active': this.button.active?.(this.funcArg), + disabled: this.button.interactive ? !this.button.interactive(this.funcArg) : false + } + ] + } + } +} diff --git a/src/components/status_action_buttons/action_button.scss b/src/components/status_action_buttons/action_button.scss index 5bc8e714d..4827c9c8e 100644 --- a/src/components/status_action_buttons/action_button.scss +++ b/src/components/status_action_buttons/action_button.scss @@ -2,6 +2,12 @@ /* stylelint-disable declaration-no-important */ .action-button { + display: grid; + + &.-with-extra { + grid-template-columns: 1fr calc(var(--__line-height) + 2 * var(--__horizontal-gap)); + } + &.-quick { display: grid; grid-template-columns: max-content auto; diff --git a/src/components/status_action_buttons/action_button.vue b/src/components/status_action_buttons/action_button.vue index ea503589e..e32f0fea0 100644 --- a/src/components/status_action_buttons/action_button.vue +++ b/src/components/status_action_buttons/action_button.vue @@ -1,8 +1,11 @@ - {{ $t(button.label(funcArg)) }} + + + {{ $t(button.label(funcArg)) }} + + + {{ button.counter?.(funcArg) }} + + + + + - +