summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarie <github@yuugi.dev>2024-10-02 18:25:23 +0200
committerMarie <github@yuugi.dev>2024-10-02 18:25:23 +0200
commitcc1017b2af4225f64a8f989416617cd3eefa9ce3 (patch)
tree983e4e1b5db5806604b07dce3461bd332415efcc
parentfix: api returns all backers on users so check if tier exists (diff)
downloadsharkey-cc1017b2af4225f64a8f989416617cd3eefa9ce3.tar.gz
sharkey-cc1017b2af4225f64a8f989416617cd3eefa9ce3.tar.bz2
sharkey-cc1017b2af4225f64a8f989416617cd3eefa9ce3.zip
upd: add sponsors to instance information
-rw-r--r--packages/frontend/src/pages/about.overview.vue53
-rw-r--r--packages/misskey-js/src/autogen/apiClientJSDoc.ts2
-rw-r--r--packages/misskey-js/src/autogen/types.ts10
3 files changed, 60 insertions, 5 deletions
diff --git a/packages/frontend/src/pages/about.overview.vue b/packages/frontend/src/pages/about.overview.vue
index 6fbb23265c..72acd9bfca 100644
--- a/packages/frontend/src/pages/about.overview.vue
+++ b/packages/frontend/src/pages/about.overview.vue
@@ -116,6 +116,22 @@ SPDX-License-Identifier: AGPL-3.0-only
</FormSection>
</FormSuspense>
+ <FormSection v-if="sponsors[0].length > 0">
+ <template #label>Our lovely Sponsors</template>
+ <div :class="$style.contributors">
+ <span
+ v-for="sponsor in sponsors[0]"
+ :key="sponsor"
+ style="margin-bottom: 0.5rem;"
+ >
+ <a :href="sponsor.website || sponsor.profile" target="_blank" :class="$style.contributor">
+ <img :src="sponsor.image || `https://ui-avatars.com/api/?background=0D8ABC&color=fff&name=${sponsor.name}`" :class="$style.contributorAvatar">
+ <span :class="$style.contributorUsername">{{ sponsor.name }}</span>
+ </a>
+ </span>
+ </div>
+ </FormSection>
+
<FormSection>
<template #label>Well-known resources</template>
<div class="_gaps_s">
@@ -130,6 +146,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
+import { ref } from 'vue';
import sanitizeHtml from '@/scripts/sanitize-html.js';
import { host, version } from '@/config.js';
import { i18n } from '@/i18n.js';
@@ -144,7 +161,10 @@ import MkFolder from '@/components/MkFolder.vue';
import MkKeyValue from '@/components/MkKeyValue.vue';
import MkLink from '@/components/MkLink.vue';
+const sponsors = ref([]);
+
const initStats = () => misskeyApi('stats', {});
+await misskeyApi('sponsors', { instance: true }).then((res) => sponsors.value.push(res.sponsor_data));
</script>
<style lang="scss" module>
@@ -207,4 +227,37 @@ const initStats = () => misskeyApi('stats', {});
.ruleText {
padding-top: 6px;
}
+
+.contributors {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
+ grid-gap: 12px;
+}
+
+.contributor {
+ display: flex;
+ align-items: center;
+ padding: 12px;
+ background: var(--buttonBg);
+ border-radius: var(--radius-sm);
+
+ &:hover {
+ text-decoration: none;
+ background: var(--buttonHoverBg);
+ }
+
+ &.active {
+ color: var(--accent);
+ background: var(--buttonHoverBg);
+ }
+}
+
+.contributorAvatar {
+ width: 30px;
+ border-radius: var(--radius-full);
+}
+
+.contributorUsername {
+ margin-left: 12px;
+}
</style>
diff --git a/packages/misskey-js/src/autogen/apiClientJSDoc.ts b/packages/misskey-js/src/autogen/apiClientJSDoc.ts
index c13485621b..06a96b4ed5 100644
--- a/packages/misskey-js/src/autogen/apiClientJSDoc.ts
+++ b/packages/misskey-js/src/autogen/apiClientJSDoc.ts
@@ -4258,7 +4258,7 @@ declare module '../api.js' {
): Promise<SwitchCaseResponseType<E, P>>;
/**
- * Get Sharkey GH Sponsors
+ * Get Sharkey Sponsors or Instance Sponsors
*
* **Credential required**: *No*
*/
diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts
index 10354043fc..fdfd5a970a 100644
--- a/packages/misskey-js/src/autogen/types.ts
+++ b/packages/misskey-js/src/autogen/types.ts
@@ -3673,7 +3673,7 @@ export type paths = {
'/sponsors': {
/**
* sponsors
- * @description Get Sharkey GH Sponsors
+ * @description Get Sharkey Sponsors or Instance Sponsors
*
* **Credential required**: *No*
*/
@@ -5191,9 +5191,9 @@ export type operations = {
infoImageUrl: string | null;
notFoundImageUrl: string | null;
iconUrl: string | null;
- sidebarLogoUrl: string | null;
app192IconUrl: string | null;
app512IconUrl: string | null;
+ sidebarLogoUrl: string | null;
enableEmail: boolean;
enableServiceWorker: boolean;
translatorAvailable: boolean;
@@ -9705,9 +9705,9 @@ export type operations = {
infoImageUrl?: string | null;
notFoundImageUrl?: string | null;
iconUrl?: string | null;
- sidebarLogoUrl?: string | null;
app192IconUrl?: string | null;
app512IconUrl?: string | null;
+ sidebarLogoUrl?: string | null;
backgroundImageUrl?: string | null;
logoImageUrl?: string | null;
name?: string | null;
@@ -27990,7 +27990,7 @@ export type operations = {
};
/**
* sponsors
- * @description Get Sharkey GH Sponsors
+ * @description Get Sharkey Sponsors or Instance Sponsors
*
* **Credential required**: *No*
*/
@@ -28000,6 +28000,8 @@ export type operations = {
'application/json': {
/** @default false */
forceUpdate?: boolean;
+ /** @default false */
+ instance?: boolean;
};
};
};