Fixed socials order.
This commit is contained in:
parent
b41ee2e5cf
commit
3c598bdb6f
|
@ -32,30 +32,34 @@ body {
|
||||||
color: var(--primary);
|
color: var(--primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon.icon-twitter {
|
.icon.icon-social.icon-twitter {
|
||||||
fill: #008ad8;
|
fill: #008ad8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon.icon-onlyfans {
|
.icon.icon-social.icon-onlyfans {
|
||||||
fill: #00adef;
|
fill: #00adef;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon.icon-fansly {
|
.icon.icon-social.icon-fansly {
|
||||||
fill: #2699f6;
|
fill: #2699f6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon.icon-linktree {
|
.icon.icon-social.icon-linktree {
|
||||||
fill: #43e660;
|
fill: #43e660;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon.icon-pornhub {
|
.icon.icon-social.icon-pornhub {
|
||||||
fill: #ff9000;
|
fill: #ff9000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon.icon-cashapp {
|
.icon.icon-social.icon-cashapp {
|
||||||
fill: #00c853;
|
fill: #00c853;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon.icon-loyalfans {
|
.icon.icon-social.icon-loyalfans {
|
||||||
fill: #d90a16;
|
fill: #d90a16;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon.icon-social {
|
||||||
|
fill: var(--highlight-strong-10);
|
||||||
|
}
|
||||||
|
|
|
@ -75,15 +75,11 @@
|
||||||
>
|
>
|
||||||
|
|
||||||
<datalist id="platforms">
|
<datalist id="platforms">
|
||||||
<option value="onlyfans">OnlyFans</option>
|
<option
|
||||||
<option value="twitter">Twitter/X</option>
|
v-for="platformSlug in Object.keys(env.socials.urls)"
|
||||||
<option value="instagram">Instagram</option>
|
:key="`platform-${platformSlug}`"
|
||||||
<option value="pornhub">PornHub</option>
|
:value="platformSlug"
|
||||||
<option value="linktree">Linktree</option>
|
>{{ platformSlug }}</option>
|
||||||
<option value="fansly">Fansly</option>
|
|
||||||
<option value="loyalfans">LoyalFans</option>
|
|
||||||
<option value="manyvids">ManyVids</option>
|
|
||||||
<option value="cashapp">Cash App</option>
|
|
||||||
</datalist>
|
</datalist>
|
||||||
|
|
||||||
<input
|
<input
|
||||||
|
|
|
@ -70,11 +70,13 @@ module.exports = {
|
||||||
urls: {
|
urls: {
|
||||||
cashapp: 'https://cash.app/${handle}', // eslint-disable-line no-template-curly-in-string
|
cashapp: 'https://cash.app/${handle}', // eslint-disable-line no-template-curly-in-string
|
||||||
fansly: 'https://fansly.com/{handle}',
|
fansly: 'https://fansly.com/{handle}',
|
||||||
|
instagram: 'https://www.instagram.com/{handle}',
|
||||||
linktree: 'https://linktr.ee/{handle}',
|
linktree: 'https://linktr.ee/{handle}',
|
||||||
loyalfans: 'https://www.loyalfans.com/{handle}',
|
loyalfans: 'https://www.loyalfans.com/{handle}',
|
||||||
manyvids: 'https://www.manyvids.com/Profile/{handle}/slug/Store/Videos',
|
manyvids: 'https://www.manyvids.com/Profile/{handle}/slug/Store/Videos',
|
||||||
onlyfans: 'https://onlyfans.com/{handle}',
|
onlyfans: 'https://onlyfans.com/{handle}',
|
||||||
pornhub: 'https://www.pornhub.com/model/{handle}',
|
pornhub: 'https://www.pornhub.com/model/{handle}',
|
||||||
|
reddit: 'https://www.reddit.com/u/{handle}',
|
||||||
twitter: 'https://x.com/{handle}',
|
twitter: 'https://x.com/{handle}',
|
||||||
},
|
},
|
||||||
prefix: {
|
prefix: {
|
||||||
|
|
|
@ -55,7 +55,7 @@ const keyMap = {
|
||||||
isCircumcised: 'circumcised',
|
isCircumcised: 'circumcised',
|
||||||
};
|
};
|
||||||
|
|
||||||
const socialsOrder = ['onlyfans', 'twitter', null];
|
const socialsOrder = ['onlyfans', 'twitter', 'fansly', 'loyalfans', 'manyvids', 'pornhub', 'linktree', null];
|
||||||
|
|
||||||
export function curateActor(actor, context = {}) {
|
export function curateActor(actor, context = {}) {
|
||||||
return {
|
return {
|
||||||
|
@ -121,7 +121,25 @@ export function curateActor(actor, context = {}) {
|
||||||
url: social.url,
|
url: social.url,
|
||||||
platform: social.platform,
|
platform: social.platform,
|
||||||
handle: social.handle,
|
handle: social.handle,
|
||||||
})).toSorted((socialA, socialB) => socialsOrder.indexOf(socialA.platform) - socialsOrder.indexOf(socialB.platform)),
|
})).toSorted((socialA, socialB) => {
|
||||||
|
if (socialA.platform && !socialB.platform) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (socialB.platform && !socialA.platform) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (socialsOrder.includes(socialA.platform) && !socialsOrder.includes(socialB.platform)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (socialsOrder.includes(socialB.platform) && !socialsOrder.includes(socialA.platform)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return socialsOrder.indexOf(socialA.platform) - socialsOrder.indexOf(socialB.platform);
|
||||||
|
}),
|
||||||
profiles: context.profiles?.map((profile) => ({
|
profiles: context.profiles?.map((profile) => ({
|
||||||
id: profile.id,
|
id: profile.id,
|
||||||
description: profile.description,
|
description: profile.description,
|
||||||
|
@ -561,6 +579,7 @@ async function applyActorSocialsDelta(actorId, delta, trx) {
|
||||||
platform: social.platform,
|
platform: social.platform,
|
||||||
handle: social.handle,
|
handle: social.handle,
|
||||||
url: social.url,
|
url: social.url,
|
||||||
|
verified_at: knex.fn.now(), // manual add implies verification
|
||||||
})))
|
})))
|
||||||
.transacting(trx);
|
.transacting(trx);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue