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 (2579B)


  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. library.add(
  27. faWrench,
  28. faUser,
  29. faFilter,
  30. faPaintBrush,
  31. faPalette,
  32. faBell,
  33. faDownload,
  34. faEyeSlash,
  35. faInfo,
  36. faWindowRestore
  37. )
  38. const SettingsModalContent = {
  39. components: {
  40. TabSwitcher,
  41. DataImportExportTab,
  42. MutesAndBlocksTab,
  43. NotificationsTab,
  44. FilteringTab,
  45. SecurityTab,
  46. ProfileTab,
  47. GeneralTab,
  48. AppearanceTab,
  49. StyleTab,
  50. VersionTab,
  51. ThemeTab
  52. },
  53. computed: {
  54. isLoggedIn () {
  55. return !!this.$store.state.users.currentUser
  56. },
  57. open () {
  58. return this.$store.state.interface.settingsModalState !== 'hidden'
  59. },
  60. bodyLock () {
  61. return this.$store.state.interface.settingsModalState === 'visible'
  62. },
  63. expertLevel () {
  64. return this.$store.state.config.expertLevel
  65. },
  66. isMobileLayout () {
  67. return this.$store.state.interface.layoutType === 'mobile'
  68. }
  69. },
  70. methods: {
  71. onOpen () {
  72. const targetTab = this.$store.state.interface.settingsModalTargetTab
  73. // We're being told to open in specific tab
  74. if (targetTab) {
  75. const tabIndex = this.$refs.tabSwitcher.$slots.default().findIndex(elm => {
  76. return elm.props && elm.props['data-tab-name'] === targetTab
  77. })
  78. if (tabIndex >= 0) {
  79. this.$refs.tabSwitcher.setTab(tabIndex)
  80. }
  81. }
  82. // Clear the state of target tab, so that next time settings is opened
  83. // it doesn't force it.
  84. this.$store.dispatch('clearSettingsModalTargetTab')
  85. }
  86. },
  87. mounted () {
  88. this.onOpen()
  89. },
  90. watch: {
  91. open: function (value) {
  92. if (value) this.onOpen()
  93. }
  94. }
  95. }
  96. export default SettingsModalContent