GroupJoins.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div class="group-joins-component">
  3. <div class="row border-bottom m-0 p-0">
  4. <sidebar />
  5. <div class="col-12 col-md-9 px-0 mx-0">
  6. <loader v-if="!loaded" :loaded="loaded" />
  7. <template v-else>
  8. <div class="px-5 pt-4 pb-2">
  9. <h2 class="fw-bold">My Groups</h2>
  10. <self-groups :profile="profile" />
  11. </div>
  12. </template>
  13. </div>
  14. </div>
  15. </div>
  16. </template>
  17. <script type="text/javascript">
  18. import SidebarComponent from '@/groups/sections/Sidebar.vue';
  19. import LoaderComponent from '@/groups/sections/Loader.vue';
  20. import SelfGroups from '@/groups/partials/SelfGroups.vue';
  21. export default {
  22. components: {
  23. "sidebar": SidebarComponent,
  24. "loader": LoaderComponent,
  25. "self-groups": SelfGroups
  26. },
  27. data() {
  28. return {
  29. loaded: false,
  30. loadTimeout: undefined,
  31. config: {},
  32. groups: [],
  33. profile: {},
  34. }
  35. },
  36. methods: {
  37. init() {
  38. document.querySelectorAll("footer").forEach(e => e.parentNode.removeChild(e));
  39. document.querySelectorAll(".mobile-footer-spacer").forEach(e => e.parentNode.removeChild(e));
  40. document.querySelectorAll(".mobile-footer").forEach(e => e.parentNode.removeChild(e));
  41. this.loaded = true;
  42. },
  43. fetchConfig() {
  44. axios.get('/api/v0/groups/config')
  45. .then(res => {
  46. this.config = res.data;
  47. this.fetchProfile();
  48. });
  49. },
  50. fetchProfile() {
  51. axios.get('/api/pixelfed/v1/accounts/verify_credentials')
  52. .then(res => {
  53. this.profile = res.data;
  54. this.init();
  55. window._sharedData.curUser = res.data;
  56. window.App.util.navatar();
  57. })
  58. },
  59. },
  60. created() {
  61. this.fetchConfig();
  62. }
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. .group-joins-component {
  67. font-family: var(--font-family-sans-serif);
  68. }
  69. </style>