Add setting for no referral links on copy
This commit is contained in:
parent
b451ecaf8c
commit
2ba4063645
|
@ -64,6 +64,7 @@ export default gql`
|
||||||
input SettingsInput {
|
input SettingsInput {
|
||||||
autoDropBolt11s: Boolean!
|
autoDropBolt11s: Boolean!
|
||||||
diagnostics: Boolean!
|
diagnostics: Boolean!
|
||||||
|
noReferralLinks: Boolean!
|
||||||
fiatCurrency: String!
|
fiatCurrency: String!
|
||||||
greeterMode: Boolean!
|
greeterMode: Boolean!
|
||||||
hideBookmarks: Boolean!
|
hideBookmarks: Boolean!
|
||||||
|
@ -128,6 +129,7 @@ export default gql`
|
||||||
"""
|
"""
|
||||||
autoDropBolt11s: Boolean!
|
autoDropBolt11s: Boolean!
|
||||||
diagnostics: Boolean!
|
diagnostics: Boolean!
|
||||||
|
noReferralLinks: Boolean!
|
||||||
fiatCurrency: String!
|
fiatCurrency: String!
|
||||||
greeterMode: Boolean!
|
greeterMode: Boolean!
|
||||||
hideBookmarks: Boolean!
|
hideBookmarks: Boolean!
|
||||||
|
|
|
@ -9,7 +9,8 @@ import { commentSubTreeRootId } from '../lib/item'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
|
|
||||||
const referrurl = (ipath, me) => {
|
const referrurl = (ipath, me) => {
|
||||||
const path = `${ipath}${me ? `/r/${me.name}` : ''}`
|
const referral = me && !me.privates?.noReferralLinks
|
||||||
|
const path = `${ipath}${referral ? `/r/${me.name}` : ''}`
|
||||||
if (!SSR) {
|
if (!SSR) {
|
||||||
return `${window.location.protocol}//${window.location.host}${path}`
|
return `${window.location.protocol}//${window.location.host}${path}`
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ export const ME = gql`
|
||||||
privates {
|
privates {
|
||||||
autoDropBolt11s
|
autoDropBolt11s
|
||||||
diagnostics
|
diagnostics
|
||||||
|
noReferralLinks
|
||||||
fiatCurrency
|
fiatCurrency
|
||||||
greeterMode
|
greeterMode
|
||||||
hideCowboyHat
|
hideCowboyHat
|
||||||
|
@ -87,6 +88,7 @@ export const SETTINGS_FIELDS = gql`
|
||||||
imgproxyOnly
|
imgproxyOnly
|
||||||
hideWalletBalance
|
hideWalletBalance
|
||||||
diagnostics
|
diagnostics
|
||||||
|
noReferralLinks
|
||||||
nostrPubkey
|
nostrPubkey
|
||||||
nostrCrossposting
|
nostrCrossposting
|
||||||
nostrRelays
|
nostrRelays
|
||||||
|
|
|
@ -531,6 +531,7 @@ export const settingsSchema = object({
|
||||||
hideTwitter: boolean(),
|
hideTwitter: boolean(),
|
||||||
hideWalletBalance: boolean(),
|
hideWalletBalance: boolean(),
|
||||||
diagnostics: boolean(),
|
diagnostics: boolean(),
|
||||||
|
noReferralLinks: boolean(),
|
||||||
hideIsContributor: boolean()
|
hideIsContributor: boolean()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,8 @@ export default function Settings ({ ssrData }) {
|
||||||
hideBookmarks: settings?.hideBookmarks,
|
hideBookmarks: settings?.hideBookmarks,
|
||||||
hideWalletBalance: settings?.hideWalletBalance,
|
hideWalletBalance: settings?.hideWalletBalance,
|
||||||
diagnostics: settings?.diagnostics,
|
diagnostics: settings?.diagnostics,
|
||||||
hideIsContributor: settings?.hideIsContributor
|
hideIsContributor: settings?.hideIsContributor,
|
||||||
|
noReferralLinks: settings?.noReferralLinks
|
||||||
}}
|
}}
|
||||||
schema={settingsSchema}
|
schema={settingsSchema}
|
||||||
onSubmit={async ({ tipDefault, withdrawMaxFeeDefault, nostrPubkey, nostrRelays, ...values }) => {
|
onSubmit={async ({ tipDefault, withdrawMaxFeeDefault, nostrPubkey, nostrRelays, ...values }) => {
|
||||||
|
@ -410,6 +411,11 @@ export default function Settings ({ ssrData }) {
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
name='diagnostics'
|
name='diagnostics'
|
||||||
|
groupClassName='mb-0'
|
||||||
|
/>
|
||||||
|
<Checkbox
|
||||||
|
label={<>don't create referral links on copy</>}
|
||||||
|
name='noReferralLinks'
|
||||||
/>
|
/>
|
||||||
<div className='form-label'>content</div>
|
<div className='form-label'>content</div>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "users" ADD COLUMN "noReferralLinks" BOOLEAN NOT NULL DEFAULT false;
|
|
@ -98,6 +98,7 @@ model User {
|
||||||
hideGithub Boolean @default(true)
|
hideGithub Boolean @default(true)
|
||||||
hideNostr Boolean @default(true)
|
hideNostr Boolean @default(true)
|
||||||
hideTwitter Boolean @default(true)
|
hideTwitter Boolean @default(true)
|
||||||
|
noReferralLinks Boolean @default(false)
|
||||||
githubId String?
|
githubId String?
|
||||||
twitterId String?
|
twitterId String?
|
||||||
followers UserSubscription[] @relation("follower")
|
followers UserSubscription[] @relation("follower")
|
||||||
|
|
Loading…
Reference in New Issue