forked from staniel359/muffon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d17e6b8
commit ca66481
Showing
36 changed files
with
1,218 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/components/buttons/community/BaseCommunityCreateButton.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<template> | ||
<div>button</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'BaseCommunityCreateButton', | ||
components: {}, | ||
props: {}, | ||
data () { | ||
return {} | ||
}, | ||
computed: {}, | ||
methods: {} | ||
} | ||
</script> | ||
|
||
<style lang="sass" scoped></style> |
40 changes: 40 additions & 0 deletions
40
src/components/buttons/playlist/BasePlaylistCreateButton.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<BaseButton | ||
class="primary" | ||
icon="plus" | ||
:text="createText" | ||
@click="handleButtonClick" | ||
/> | ||
|
||
<BasePlaylistCreateModal | ||
ref="modal" | ||
/> | ||
</template> | ||
|
||
<script> | ||
import BaseButton from '*/components/buttons/BaseButton.vue' | ||
import BasePlaylistCreateModal | ||
from '*/components/modals/playlist/BasePlaylistCreateModal.vue' | ||
export default { | ||
name: 'BasePlaylistCreateButton', | ||
components: { | ||
BaseButton, | ||
BasePlaylistCreateModal | ||
}, | ||
computed: { | ||
createText () { | ||
return this.$t( | ||
'actions.add.playlist' | ||
) | ||
} | ||
}, | ||
methods: { | ||
handleButtonClick () { | ||
this.$refs.modal.show() | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="sass" scoped></style> |
81 changes: 81 additions & 0 deletions
81
src/components/containers/pages/communities/BaseCommunitiesPageContainer.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<template> | ||
<BasePageContainer | ||
:isShowLoader="!communitiesData" | ||
:isLoading="isLoading" | ||
:isError="!communitiesData && !!error" | ||
:error="error" | ||
@refresh="handleRefresh" | ||
> | ||
<slot | ||
v-if="communitiesData" | ||
:isLoading="isLoading" | ||
:error="error" | ||
:communitiesData="communitiesData" | ||
:fetchData="fetchData" | ||
:handleRefresh="handleRefresh" | ||
></slot> | ||
</BasePageContainer> | ||
</template> | ||
|
||
<script> | ||
import BasePageContainer | ||
from '*/components/containers/pages/BasePageContainer.vue' | ||
import navigationMixin from '*/mixins/navigationMixin' | ||
import { | ||
communities as formatCommunitiesPageNavigation | ||
} from '*/helpers/formatters/navigation' | ||
import formatCommunitiesPageTab from '*/helpers/formatters/tabs/communities' | ||
import getCommunities from '*/helpers/actions/api/communities/get' | ||
export default { | ||
name: 'BaseCommunitiesPageContainer', | ||
components: { | ||
BasePageContainer | ||
}, | ||
mixins: [ | ||
navigationMixin | ||
], | ||
props: { | ||
responsePageLimit: Number | ||
}, | ||
data () { | ||
return { | ||
communitiesData: null, | ||
error: null, | ||
isLoading: false | ||
} | ||
}, | ||
computed: { | ||
navigationSections () { | ||
return formatCommunitiesPageNavigation() | ||
}, | ||
tabData () { | ||
return formatCommunitiesPageTab() | ||
}, | ||
communitiesArgs () { | ||
return { | ||
limit: this.responsePageLimit | ||
} | ||
} | ||
}, | ||
mounted () { | ||
this.setNavigation() | ||
this.fetchData() | ||
}, | ||
methods: { | ||
handleRefresh (page) { | ||
this.fetchData(page) | ||
}, | ||
getCommunities, | ||
fetchData (page) { | ||
this.getCommunities({ | ||
...this.communitiesArgs, | ||
page | ||
}) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="sass" scoped></style> |
101 changes: 101 additions & 0 deletions
101
src/components/containers/pages/community/BaseCommunityPageContainer.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<template> | ||
<BasePageContainer | ||
:isShowLoader="!communityData" | ||
:isLoading="isLoading" | ||
:isError="!communityData && !!error" | ||
:error="error" | ||
@refresh="handleRefresh" | ||
> | ||
<slot | ||
v-if="communityData" | ||
:isLoading="isLoading" | ||
:error="error" | ||
:communityData="communityData" | ||
:fetchData="fetchData" | ||
:handleRefresh="handleRefresh" | ||
></slot> | ||
</BasePageContainer> | ||
</template> | ||
|
||
<script> | ||
import BasePageContainer | ||
from '*/components/containers/pages/BasePageContainer.vue' | ||
import navigationMixin from '*/mixins/navigationMixin' | ||
import formatCommunityPageNavigation | ||
from '*/helpers/formatters/navigation/community' | ||
import formatCommunityPageTab from '*/helpers/formatters/tabs/community' | ||
import getCommunity from '*/helpers/actions/api/community/get' | ||
export default { | ||
name: 'BaseCommunityPageContainer', | ||
components: { | ||
BasePageContainer | ||
}, | ||
mixins: [ | ||
navigationMixin | ||
], | ||
provide () { | ||
return { | ||
setCommunityData: this.setCommunityData | ||
} | ||
}, | ||
props: { | ||
communityId: String | ||
}, | ||
data () { | ||
return { | ||
communityData: null, | ||
error: null, | ||
isLoading: false | ||
} | ||
}, | ||
computed: { | ||
navigationSections () { | ||
return formatCommunityPageNavigation( | ||
this.navigationData | ||
) | ||
}, | ||
navigationData () { | ||
return { | ||
communityId: this.communityId, | ||
communityTitle: this.communityTitleFetched | ||
} | ||
}, | ||
tabData () { | ||
return formatCommunityPageTab( | ||
this.navigationData | ||
) | ||
}, | ||
communityTitleFetched () { | ||
return this.communityData?.title | ||
}, | ||
communityArgs () { | ||
return { | ||
communityId: this.communityId | ||
} | ||
} | ||
}, | ||
watch: { | ||
communityData: 'handleNavigationDataChange' | ||
}, | ||
mounted () { | ||
this.fetchData() | ||
}, | ||
methods: { | ||
handleRefresh () { | ||
this.fetchData() | ||
}, | ||
getCommunity, | ||
fetchData () { | ||
this.getCommunity( | ||
this.communityArgs | ||
) | ||
}, | ||
setCommunityData (value) { | ||
this.communityData = value | ||
} | ||
} | ||
} | ||
</script> | ||
<style lang="sass" scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/components/layout/panels/TheSidebarPanel/CommunitiesItem.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<template> | ||
<BaseSidebarItem | ||
icon="users" | ||
:text="communitiesText" | ||
:link="profileCommunitiesLink" | ||
/> | ||
</template> | ||
|
||
<script> | ||
import { mapState } from 'vuex' | ||
import BaseSidebarItem from '*/components/BaseSidebarItem.vue' | ||
import { | ||
communities as formatProfileCommunitiesLink | ||
} from '*/helpers/formatters/links/profile' | ||
export default { | ||
name: 'CommunitiesItem', | ||
components: { | ||
BaseSidebarItem | ||
}, | ||
computed: { | ||
...mapState('profile', { | ||
profileInfo: 'info' | ||
}), | ||
communitiesText () { | ||
return this.$t( | ||
'navigation.communities' | ||
) | ||
}, | ||
profileCommunitiesLink () { | ||
return formatProfileCommunitiesLink({ | ||
profileId: this.profileId | ||
}) | ||
}, | ||
profileId () { | ||
return this.profileInfo.id.toString() | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="sass" scoped></style> |
41 changes: 41 additions & 0 deletions
41
src/components/lists/communities/BaseCommunitiesSimpleList.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<template> | ||
<BaseListContainer class="selection"> | ||
<CommunityItem | ||
v-for="communityData in communitiesCollection" | ||
:key="communityData.uuid" | ||
:communityData="communityData" | ||
/> | ||
</BaseListContainer> | ||
</template> | ||
|
||
<script> | ||
import BaseListContainer | ||
from '*/components/containers/lists/BaseListContainer.vue' | ||
import CommunityItem from './BaseCommunitiesSimpleList/CommunityItem.vue' | ||
import { collection as formatCollection } from '*/helpers/formatters' | ||
export default { | ||
name: 'BaseCommunitiesSimpleList', | ||
components: { | ||
BaseListContainer, | ||
CommunityItem | ||
}, | ||
props: { | ||
communities: { | ||
type: Array, | ||
default () { | ||
return [] | ||
} | ||
} | ||
}, | ||
computed: { | ||
communitiesCollection () { | ||
return formatCollection( | ||
this.communities | ||
) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="sass" scoped></style> |
Oops, something went wrong.