logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

settings_modal_user_content.js (2602B)


  1. import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
  2. import DataImportExportTab from './tabs/data_import_export_tab.vue'
  3. import MutesAndBlocksTab from './tabs/mutes_and_blocks_tab.vue'
  4. import NotificationsTab from './tabs/notifications_tab.vue'
  5. import FilteringTab from './tabs/filtering_tab.vue'
  6. import SecurityTab from './tabs/security_tab/security_tab.vue'
  7. import ProfileTab from './tabs/profile_tab.vue'
  8. import GeneralTab from './tabs/general_tab.vue'
  9. import AppearanceTab from './tabs/appearance_tab.vue'
  10. import VersionTab from './tabs/version_tab.vue'
  11. import ThemeTab from './tabs/theme_tab/theme_tab.vue'
  12. import StyleTab from './tabs/style_tab/style_tab.vue'
  13. import { library } from '@fortawesome/fontawesome-svg-core'
  14. import {
  15. faWrench,
  16. faUser,
  17. faFilter,
  18. faPaintBrush,
  19. faPalette,
  20. faBell,
  21. faDownload,
  22. faEyeSlash,
  23. faInfo,
  24. faWindowRestore
  25. } from '@fortawesome/free-solid-svg-icons'
  26. import { useInterfaceStore } from 'src/stores/interface'
  27. library.add(
  28. faWrench,
  29. faUser,
  30. faFilter,
  31. faPaintBrush,
  32. faPalette,
  33. faBell,
  34. faDownload,
  35. faEyeSlash,
  36. faInfo,
  37. faWindowRestore
  38. )
  39. const SettingsModalContent = {
  40. components: {
  41. TabSwitcher,
  42. DataImportExportTab,
  43. MutesAndBlocksTab,
  44. NotificationsTab,
  45. FilteringTab,
  46. SecurityTab,
  47. ProfileTab,
  48. GeneralTab,
  49. AppearanceTab,
  50. StyleTab,
  51. VersionTab,
  52. ThemeTab
  53. },
  54. computed: {
  55. isLoggedIn () {
  56. return !!this.$store.state.users.currentUser
  57. },
  58. open () {
  59. return useInterfaceStore().settingsModalState !== 'hidden'
  60. },
  61. bodyLock () {
  62. return useInterfaceStore().settingsModalState === 'visible'
  63. },
  64. expertLevel () {
  65. return this.$store.state.config.expertLevel
  66. },
  67. isMobileLayout () {
  68. return useInterfaceStore().layoutType === 'mobile'
  69. }
  70. },
  71. methods: {
  72. onOpen () {
  73. const targetTab = useInterfaceStore().settingsModalTargetTab
  74. // We're being told to open in specific tab
  75. if (targetTab) {
  76. const tabIndex = this.$refs.tabSwitcher.$slots.default().findIndex(elm => {
  77. return elm.props && elm.props['data-tab-name'] === targetTab
  78. })
  79. if (tabIndex >= 0) {
  80. this.$refs.tabSwitcher.setTab(tabIndex)
  81. }
  82. }
  83. // Clear the state of target tab, so that next time settings is opened
  84. // it doesn't force it.
  85. useInterfaceStore().clearSettingsModalTargetTab()
  86. }
  87. },
  88. mounted () {
  89. this.onOpen()
  90. },
  91. watch: {
  92. open: function (value) {
  93. if (value) this.onOpen()
  94. }
  95. }
  96. }
  97. export default SettingsModalContent