Merge branch 'master' into sndev-profiles

This commit is contained in:
Keyan 2024-03-18 09:28:12 -05:00 committed by GitHub
commit 501ca3c0a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 24 additions and 6 deletions

View File

@ -154,6 +154,8 @@ We want your help.
- improvements to development documentation
- helpfulness
[View a current list of granted awards](awards.csv)
<br>
## Just in case

View File

@ -457,7 +457,8 @@ export default {
LEFT JOIN "Sub" ON "Sub"."name" = "Item"."subName"
${joinZapRankPersonalView(me, models)}
${whereClause(
'"Item"."pinId" IS NULL',
// in "home" (sub undefined), we want to show pinned items (but without the pin icon)
sub ? '"Item"."pinId" IS NULL' : '',
'"Item"."deletedAt" IS NULL',
'"Item"."parentId" IS NULL',
'"Item".bio = false',

View File

@ -64,6 +64,7 @@ export default gql`
input SettingsInput {
autoDropBolt11s: Boolean!
diagnostics: Boolean!
noReferralLinks: Boolean!
fiatCurrency: String!
greeterMode: Boolean!
hideBookmarks: Boolean!
@ -128,6 +129,7 @@ export default gql`
"""
autoDropBolt11s: Boolean!
diagnostics: Boolean!
noReferralLinks: Boolean!
fiatCurrency: String!
greeterMode: Boolean!
hideBookmarks: Boolean!

View File

@ -1,4 +1,4 @@
name,type,pr id,issue ids,difficulty,priority,changes requested,notes,amount,receive method,date paid
jp-melanson,pr,#898,#680,good-first-issue,,,,20k,jpmelanson@getalby.com,2024-03-16
NEEDcreations,issue,,#680,good-first-issue,,,,2k,NEEDcreations@stacker.news,2024-03-16
SatsAllDay,docs,#925,,,,,typo,200,weareallsatoshi@getalby.com,2024-03-16
SatsAllDay,docs,#925,,,,,typo,100,weareallsatoshi@getalby.com,2024-03-16

1 name type pr id issue ids difficulty priority changes requested notes amount receive method date paid
2 jp-melanson pr #898 #680 good-first-issue 20k jpmelanson@getalby.com 2024-03-16
3 NEEDcreations issue #680 good-first-issue 2k NEEDcreations@stacker.news 2024-03-16
4 SatsAllDay docs #925 typo 200 100 weareallsatoshi@getalby.com 2024-03-16

View File

@ -9,7 +9,8 @@ import { commentSubTreeRootId } from '../lib/item'
import { useRouter } from 'next/router'
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) {
return `${window.location.protocol}//${window.location.host}${path}`
}

View File

@ -80,8 +80,8 @@ export default memo(function Text ({ rel, imgproxyUrls, children, tab, itemId, o
const Heading = useCallback(({ children, node, ...props }) => {
const [copied, setCopied] = useState(false)
const id = useMemo(() =>
noFragments ? undefined : slugger?.slug(toString(node).replace(/[^\w\-\s]+/gi, '')), [node, noFragments, slugger])
const nodeText = toString(node)
const id = useMemo(() => noFragments ? undefined : slugger?.slug(nodeText.replace(/[^\w\-\s]+/gi, '')), [nodeText, noFragments, slugger])
const h = useMemo(() => {
if (topLevel) {
return node?.TagName

View File

@ -12,6 +12,7 @@ export const ME = gql`
privates {
autoDropBolt11s
diagnostics
noReferralLinks
fiatCurrency
greeterMode
hideCowboyHat
@ -87,6 +88,7 @@ export const SETTINGS_FIELDS = gql`
imgproxyOnly
hideWalletBalance
diagnostics
noReferralLinks
nostrPubkey
nostrCrossposting
nostrRelays

View File

@ -531,6 +531,7 @@ export const settingsSchema = object({
hideTwitter: boolean(),
hideWalletBalance: boolean(),
diagnostics: boolean(),
noReferralLinks: boolean(),
hideIsContributor: boolean()
})

View File

@ -94,7 +94,8 @@ export default function Settings ({ ssrData }) {
hideBookmarks: settings?.hideBookmarks,
hideWalletBalance: settings?.hideWalletBalance,
diagnostics: settings?.diagnostics,
hideIsContributor: settings?.hideIsContributor
hideIsContributor: settings?.hideIsContributor,
noReferralLinks: settings?.noReferralLinks
}}
schema={settingsSchema}
onSubmit={async ({ tipDefault, withdrawMaxFeeDefault, nostrPubkey, nostrRelays, ...values }) => {
@ -410,6 +411,11 @@ export default function Settings ({ ssrData }) {
</div>
}
name='diagnostics'
groupClassName='mb-0'
/>
<Checkbox
label={<>don't create referral links on copy</>}
name='noReferralLinks'
/>
<div className='form-label'>content</div>
<Checkbox

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "users" ADD COLUMN "noReferralLinks" BOOLEAN NOT NULL DEFAULT false;

View File

@ -98,6 +98,7 @@ model User {
hideGithub Boolean @default(true)
hideNostr Boolean @default(true)
hideTwitter Boolean @default(true)
noReferralLinks Boolean @default(false)
githubId String?
twitterId String?
followers UserSubscription[] @relation("follower")