diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js index 8d295db2b..ff6d0e477 100644 --- a/src/components/settings_modal/tabs/general_tab.js +++ b/src/components/settings_modal/tabs/general_tab.js @@ -8,6 +8,7 @@ import FloatSetting from '../helpers/float_setting.vue' import UnitSetting from '../helpers/unit_setting.vue' import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.vue' import Select from 'src/components/select/select.vue' +import ProfileSettingIndicator from '../helpers/profile_setting_indicator.vue' import SharedComputedObject from '../helpers/shared_computed_object.js' @@ -77,6 +78,7 @@ const GeneralTab = { FloatSetting, UnitSetting, InterfaceLanguageSwitcher, + ProfileSettingIndicator, ScopeSelector, Select }, diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index 409cc9e6b..5521ea411 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -58,18 +58,49 @@ library.add( ) export default { - props: [ - 'editable', - 'userId', - 'switcher', - 'selected', - 'hideBio', - 'rounded', - 'bordered', - 'avatarAction', // default - open profile, 'zoom' - zoom, function - call function - 'onClose', - 'hasNoteEditor' - ], + props: { + // Enables all the options for profile editing, used in settings -> profile tab + editable: { + required: false, + default: false, + type: Boolean + }, + // ID of user to show data of + userId: { + required: true, + type: String + }, + // Use a compact layout that hides bio, stats etc. + hideBio: { + required: false, + default: false, + type: Boolean + }, + // default - open profile, 'zoom' - zoom, function - call function + avatarAction: { + required: false, + type: String, + default: 'default' + }, + // Show note editor if supported + hasNoteEditor: { + required: false, + type: Boolean, + default: false + }, + // Show close icon (for popovers) + showClose: { + required: false, + type: Boolean, + default: false + }, + // Show close icon (for popovers) + showExpand: { + required: false, + type: Boolean, + default: false + } + }, components: { DialogModal, UserAvatar, @@ -155,14 +186,6 @@ export default { relationship () { return this.$store.getters.relationship(this.userId) }, - classes () { - return [{ - '-rounded-t': this.rounded === 'top', // set border-top-left-radius and border-top-right-radius - '-rounded': this.rounded === true, // set border-radius for all sides - '-bordered': this.bordered === true, // set border for all sides - '-popover': !!this.onClose // set popover rounding - }] - }, style () { return { backgroundImage: [ @@ -332,12 +355,6 @@ export default { unsubscribeUser () { return this.$store.dispatch('unsubscribeUser', this.user.id) }, - setProfileView (v) { - if (this.switcher) { - const store = this.$store - store.commit('setProfileView', { v }) - } - }, linkClicked ({ target }) { if (target.tagName === 'SPAN') { target = target.parentNode @@ -457,7 +474,7 @@ export default { fields_attributes: this.newFields.filter(el => el != null), show_role: !!this.newShowRole, birthday: this.newBirthday || '', - show_birthday: !!this.showBirthday, + show_birthday: !!this.newShowBirthday, } if (this.actorType) { diff --git a/src/components/user_card/user_card.scss b/src/components/user_card/user_card.scss index c948480ba..1ad2018ba 100644 --- a/src/components/user_card/user_card.scss +++ b/src/components/user_card/user_card.scss @@ -3,6 +3,9 @@ z-index: 1; overflow: hidden; + border-top-left-radius: calc(var(--roundness) - 1px); + border-top-right-radius: calc(var(--roundness) - 1px); + // editing headers h4 { line-height: 2; @@ -118,42 +121,12 @@ padding: 0; mask: linear-gradient(to top, transparent 0, white 5em) bottom no-repeat; background-size: cover; - border-top-left-radius: calc(var(--__roundnessTop, --panelRadius) - 1px); - border-top-right-radius: calc(var(--__roundnessTop, --panelRadius) - 1px); - border-bottom-left-radius: calc(var(--__roundnessBottom, --panelRadius) - 1px); - border-bottom-right-radius: calc(var(--__roundnessBottom, --panelRadius) - 1px); background-color: var(--profileBg); + border-top-left-radius: calc(var(--roundness) - 1px); + border-top-right-radius: calc(var(--roundness) - 1px); z-index: -2; } - &.-rounded-t { - border-top-left-radius: var(--roundness); - border-top-right-radius: var(--roundness); - - --__roundnessTop: var(--roundness); - --__roundnessBottom: 0; - } - - &.-rounded { - border-radius: var(--roundness); - - --__roundnessTop: var(--roundness); - --__roundnessBottom: var(--roundness); - } - - &.-popover { - border-radius: var(--roundness); - - --__roundnessTop: var(--roundness); - --__roundnessBottom: var(--roundness); - } - - &.-bordered { - border-width: 1px; - border-style: solid; - border-color: var(--border); - } - .bottom-buttons { display: flex; gap: 0.5em; diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index d913cf96e..a993a87a5 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -1,8 +1,5 @@