pleroma-fe/src/components/settings_modal/tabs/layout_tab.js

57 lines
1.5 KiB
JavaScript
Raw Normal View History

import { useInstanceStore } from 'src/stores/instance.js'
2025-11-24 17:06:55 +02:00
import BooleanSetting from '../helpers/boolean_setting.vue'
import ChoiceSetting from '../helpers/choice_setting.vue'
import ProfileSettingIndicator from '../helpers/profile_setting_indicator.vue'
import SharedComputedObject from '../helpers/shared_computed_object.js'
2026-01-06 16:23:17 +02:00
import UnitSetting from '../helpers/unit_setting.vue'
2025-11-24 17:06:55 +02:00
const GeneralTab = {
props: {
parentCollapsed: {
required: true,
2026-01-06 16:22:52 +02:00
type: Boolean,
},
2025-11-24 17:06:55 +02:00
},
2026-01-06 16:22:52 +02:00
data() {
2025-11-24 17:06:55 +02:00
return {
2026-01-06 16:22:52 +02:00
thirdColumnModeOptions: ['none', 'notifications', 'postform'].map(
(mode) => ({
key: mode,
value: mode,
label: this.$t(`settings.third_column_mode_${mode}`),
}),
),
2025-11-24 17:06:55 +02:00
}
},
components: {
BooleanSetting,
ChoiceSetting,
UnitSetting,
2026-01-06 16:22:52 +02:00
ProfileSettingIndicator,
2025-11-24 17:06:55 +02:00
},
computed: {
2026-01-06 16:22:52 +02:00
postFormats() {
2026-01-29 20:33:59 +02:00
return useInstanceStore().featureSet.postFormats || []
2025-11-24 17:06:55 +02:00
},
2026-01-06 16:22:52 +02:00
instanceShoutboxPresent() {
2026-01-29 20:33:59 +02:00
return useInstanceStore().featureSet.shoutAvailable
2026-01-06 16:22:52 +02:00
},
columns() {
2025-11-24 17:06:55 +02:00
const mode = this.$store.getters.mergedConfig.thirdColumnMode
const notif = mode === 'none' ? [] : ['notifs']
2026-01-06 16:22:52 +02:00
if (
this.$store.getters.mergedConfig.sidebarRight ||
mode === 'postform'
) {
2025-11-24 17:06:55 +02:00
return [...notif, 'content', 'sidebar']
} else {
return ['sidebar', 'content', ...notif]
}
},
...SharedComputedObject(),
2026-01-06 16:22:52 +02:00
},
2025-11-24 17:06:55 +02:00
}
export default GeneralTab