From adf213f32a3808150f6dc72ff50622f2b9050aa1 Mon Sep 17 00:00:00 2001 From: Prospector Date: Wed, 8 Jan 2025 17:03:00 -0800 Subject: [PATCH] Begin collections implementation --- .../src/pages/collection/Index.vue | 111 ++++++++++++++++++ .../src/pages/collection/index.js | 3 + .../src/pages/organization/Index.vue | 2 +- apps/app-frontend/src/pages/user/Index.vue | 15 ++- apps/app-frontend/src/routes.js | 11 ++ packages/ui/src/components/base/AutoLink.vue | 28 +++-- .../collection/CollectionHeader.vue | 58 +++++++++ .../collection/CollectionSidebarCurator.vue | 44 +++++++ .../CollectionSidebarDescription.vue | 25 ++++ .../collection/CollectionSidebarDetails.vue | 39 ++++++ .../collection/CollectionStatusBadge.vue | 48 ++++++++ packages/ui/src/components/index.ts | 8 ++ .../components/project/ProjectStatusBadge.vue | 26 +--- .../src/components/project/ProjectsList.vue | 4 +- .../user/UserSidebarCollections.vue | 62 ++++++++++ packages/ui/src/utils/common-messages.ts | 6 +- packages/utils/types.ts | 15 +++ 17 files changed, 463 insertions(+), 42 deletions(-) create mode 100644 apps/app-frontend/src/pages/collection/Index.vue create mode 100644 apps/app-frontend/src/pages/collection/index.js create mode 100644 packages/ui/src/components/collection/CollectionHeader.vue create mode 100644 packages/ui/src/components/collection/CollectionSidebarCurator.vue create mode 100644 packages/ui/src/components/collection/CollectionSidebarDescription.vue create mode 100644 packages/ui/src/components/collection/CollectionSidebarDetails.vue create mode 100644 packages/ui/src/components/collection/CollectionStatusBadge.vue create mode 100644 packages/ui/src/components/user/UserSidebarCollections.vue diff --git a/apps/app-frontend/src/pages/collection/Index.vue b/apps/app-frontend/src/pages/collection/Index.vue new file mode 100644 index 000000000..c71a3a42d --- /dev/null +++ b/apps/app-frontend/src/pages/collection/Index.vue @@ -0,0 +1,111 @@ + + + + diff --git a/apps/app-frontend/src/pages/collection/index.js b/apps/app-frontend/src/pages/collection/index.js new file mode 100644 index 000000000..b06d36585 --- /dev/null +++ b/apps/app-frontend/src/pages/collection/index.js @@ -0,0 +1,3 @@ +import Index from './Index.vue' + +export { Index } diff --git a/apps/app-frontend/src/pages/organization/Index.vue b/apps/app-frontend/src/pages/organization/Index.vue index d3b2f819f..6842ee958 100644 --- a/apps/app-frontend/src/pages/organization/Index.vue +++ b/apps/app-frontend/src/pages/organization/Index.vue @@ -6,7 +6,7 @@ diff --git a/packages/ui/src/components/collection/CollectionHeader.vue b/packages/ui/src/components/collection/CollectionHeader.vue new file mode 100644 index 000000000..fa1400ac6 --- /dev/null +++ b/packages/ui/src/components/collection/CollectionHeader.vue @@ -0,0 +1,58 @@ + + diff --git a/packages/ui/src/components/collection/CollectionSidebarCurator.vue b/packages/ui/src/components/collection/CollectionSidebarCurator.vue new file mode 100644 index 000000000..0417385f2 --- /dev/null +++ b/packages/ui/src/components/collection/CollectionSidebarCurator.vue @@ -0,0 +1,44 @@ + + diff --git a/packages/ui/src/components/collection/CollectionSidebarDescription.vue b/packages/ui/src/components/collection/CollectionSidebarDescription.vue new file mode 100644 index 000000000..83de3d284 --- /dev/null +++ b/packages/ui/src/components/collection/CollectionSidebarDescription.vue @@ -0,0 +1,25 @@ + + diff --git a/packages/ui/src/components/collection/CollectionSidebarDetails.vue b/packages/ui/src/components/collection/CollectionSidebarDetails.vue new file mode 100644 index 000000000..9af746a5a --- /dev/null +++ b/packages/ui/src/components/collection/CollectionSidebarDetails.vue @@ -0,0 +1,39 @@ + + diff --git a/packages/ui/src/components/collection/CollectionStatusBadge.vue b/packages/ui/src/components/collection/CollectionStatusBadge.vue new file mode 100644 index 000000000..586378514 --- /dev/null +++ b/packages/ui/src/components/collection/CollectionStatusBadge.vue @@ -0,0 +1,48 @@ + + + diff --git a/packages/ui/src/components/index.ts b/packages/ui/src/components/index.ts index b9bb86784..3622f4d5a 100644 --- a/packages/ui/src/components/index.ts +++ b/packages/ui/src/components/index.ts @@ -104,8 +104,16 @@ export { default as ThemeSelector } from './settings/ThemeSelector.vue' export { default as UserBadge } from './user/UserBadge.vue' export { default as UserHeader } from './user/UserHeader.vue' export { default as UserSidebarBadges } from './user/UserSidebarBadges.vue' +export { default as UserSidebarCollections } from './user/UserSidebarCollections.vue' export { default as UserSidebarOrganizations } from './user/UserSidebarOrganizations.vue' // Organization export { default as OrganizationHeader } from './organization/OrganizationHeader.vue' export { default as OrganizationSidebarMembers } from './organization/OrganizationSidebarMembers.vue' + +// Collection +export { default as CollectionHeader } from './collection/CollectionHeader.vue' +export { default as CollectionSidebarCurator } from './collection/CollectionSidebarCurator.vue' +export { default as CollectionSidebarDescription } from './collection/CollectionSidebarDescription.vue' +export { default as CollectionSidebarDetails } from './collection/CollectionSidebarDetails.vue' +export { default as CollectionStatusBadge } from './collection/CollectionStatusBadge.vue' diff --git a/packages/ui/src/components/project/ProjectStatusBadge.vue b/packages/ui/src/components/project/ProjectStatusBadge.vue index 4756e55e9..0eb008950 100644 --- a/packages/ui/src/components/project/ProjectStatusBadge.vue +++ b/packages/ui/src/components/project/ProjectStatusBadge.vue @@ -19,6 +19,7 @@ import type { Component } from 'vue' import { computed } from 'vue' import Badge from '../base/SimpleBadge.vue' import type { ProjectStatus } from '@modrinth/utils' +import { commonMessages } from '../../utils/common-messages' const props = defineProps<{ status: ProjectStatus @@ -34,17 +35,11 @@ const metadata = computed(() => ({ const statusMetadata: Record = { approved: { icon: GlobeIcon, - message: defineMessage({ - id: 'project.visibility.public', - defaultMessage: 'Public', - }), + message: commonMessages.publicLabel, }, unlisted: { icon: LinkIcon, - message: defineMessage({ - id: 'project.visibility.unlisted', - defaultMessage: 'Unlisted', - }), + message: commonMessages.unlistedLabel, }, withheld: { icon: LinkIcon, @@ -55,10 +50,7 @@ const statusMetadata: Record diff --git a/packages/ui/src/components/project/ProjectsList.vue b/packages/ui/src/components/project/ProjectsList.vue index c5dc8fa46..b5be4a098 100644 --- a/packages/ui/src/components/project/ProjectsList.vue +++ b/packages/ui/src/components/project/ProjectsList.vue @@ -1,8 +1,7 @@