mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at responsive-updates 257 lines 6.1 kB view raw
1import {Insets} from 'react-native' 2 3const HELP_DESK_LANG = 'en-us' 4export const HELP_DESK_URL = `https://blueskyweb.zendesk.com/hc/${HELP_DESK_LANG}` 5 6const BASE_FEEDBACK_FORM_URL = `${HELP_DESK_URL}/requests/new` 7export function FEEDBACK_FORM_URL({ 8 email, 9 handle, 10}: { 11 email?: string 12 handle?: string 13}): string { 14 let str = BASE_FEEDBACK_FORM_URL 15 if (email) { 16 str += `?tf_anonymous_requester_email=${encodeURIComponent(email)}` 17 if (handle) { 18 str += `&tf_17205412673421=${encodeURIComponent(handle)}` 19 } 20 } 21 return str 22} 23 24export const MAX_DISPLAY_NAME = 64 25export const MAX_DESCRIPTION = 256 26 27export const MAX_GRAPHEME_LENGTH = 300 28 29// Recommended is 100 per: https://www.w3.org/WAI/GL/WCAG20/tests/test3.html 30// but increasing limit per user feedback 31export const MAX_ALT_TEXT = 1000 32 33export function IS_LOCAL_DEV(url: string) { 34 return url.includes('localhost') 35} 36 37export function IS_STAGING(url: string) { 38 return !IS_LOCAL_DEV(url) && !IS_PROD(url) 39} 40 41export function IS_PROD(url: string) { 42 // NOTE 43 // until open federation, "production" is defined as the main server 44 // this definition will not work once federation is enabled! 45 // -prf 46 return url.startsWith('https://bsky.social') 47} 48 49export const PROD_TEAM_HANDLES = [ 50 'jay.bsky.social', 51 'pfrazee.com', 52 'divy.zone', 53 'dholms.xyz', 54 'why.bsky.world', 55 'iamrosewang.bsky.social', 56] 57export const STAGING_TEAM_HANDLES = [ 58 'arcalinea.staging.bsky.dev', 59 'paul.staging.bsky.dev', 60 'paul2.staging.bsky.dev', 61] 62export const DEV_TEAM_HANDLES = ['alice.test', 'bob.test', 'carla.test'] 63 64export function TEAM_HANDLES(serviceUrl: string) { 65 if (serviceUrl.includes('localhost')) { 66 return DEV_TEAM_HANDLES 67 } else if (serviceUrl.includes('staging')) { 68 return STAGING_TEAM_HANDLES 69 } else { 70 return PROD_TEAM_HANDLES 71 } 72} 73 74export const STAGING_DEFAULT_FEED = (rkey: string) => 75 `at://did:plc:wqzurwm3kmaig6e6hnc2gqwo/app.bsky.feed.generator/${rkey}` 76export const PROD_DEFAULT_FEED = (rkey: string) => 77 `at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/${rkey}` 78export async function DEFAULT_FEEDS( 79 serviceUrl: string, 80 resolveHandle: (name: string) => Promise<string>, 81) { 82 if (IS_LOCAL_DEV(serviceUrl)) { 83 // local dev 84 const aliceDid = await resolveHandle('alice.test') 85 return { 86 pinned: [`at://${aliceDid}/app.bsky.feed.generator/alice-favs`], 87 saved: [`at://${aliceDid}/app.bsky.feed.generator/alice-favs`], 88 } 89 } else if (IS_STAGING(serviceUrl)) { 90 // staging 91 return { 92 pinned: [STAGING_DEFAULT_FEED('whats-hot')], 93 saved: [ 94 STAGING_DEFAULT_FEED('bsky-team'), 95 STAGING_DEFAULT_FEED('with-friends'), 96 STAGING_DEFAULT_FEED('whats-hot'), 97 STAGING_DEFAULT_FEED('hot-classic'), 98 ], 99 } 100 } else { 101 // production 102 return { 103 pinned: [ 104 PROD_DEFAULT_FEED('whats-hot'), 105 PROD_DEFAULT_FEED('with-friends'), 106 ], 107 saved: [ 108 PROD_DEFAULT_FEED('bsky-team'), 109 PROD_DEFAULT_FEED('with-friends'), 110 PROD_DEFAULT_FEED('whats-hot'), 111 PROD_DEFAULT_FEED('hot-classic'), 112 ], 113 } 114 } 115} 116 117export const POST_IMG_MAX = { 118 width: 2000, 119 height: 2000, 120 size: 1000000, 121} 122 123export const STAGING_LINK_META_PROXY = 124 'https://cardyb.staging.bsky.dev/v1/extract?url=' 125 126export const PROD_LINK_META_PROXY = 'https://cardyb.bsky.app/v1/extract?url=' 127 128export function LINK_META_PROXY(serviceUrl: string) { 129 if (IS_LOCAL_DEV(serviceUrl)) { 130 return STAGING_LINK_META_PROXY 131 } else if (IS_STAGING(serviceUrl)) { 132 return STAGING_LINK_META_PROXY 133 } else { 134 return PROD_LINK_META_PROXY 135 } 136} 137 138export const STATUS_PAGE_URL = 'https://status.bsky.app/' 139 140// Hitslop constants 141export const createHitslop = (size: number): Insets => ({ 142 top: size, 143 left: size, 144 bottom: size, 145 right: size, 146}) 147export const HITSLOP_10 = createHitslop(10) 148export const HITSLOP_20 = createHitslop(20) 149export const HITSLOP_30 = createHitslop(30) 150export const BACK_HITSLOP = HITSLOP_30 151 152export const RECOMMENDED_FEEDS = [ 153 { 154 did: 'did:plc:hsqwcidfez66lwm3gxhfv5in', 155 rkey: 'aaaf2pqeodmpy', 156 }, 157 { 158 did: 'did:plc:gekdk2nd47gkk3utfz2xf7cn', 159 rkey: 'aaap4tbjcfe5y', 160 }, 161 { 162 did: 'did:plc:5rw2on4i56btlcajojaxwcat', 163 rkey: 'aaao6g552b33o', 164 }, 165 { 166 did: 'did:plc:jfhpnnst6flqway4eaeqzj2a', 167 rkey: 'for-science', 168 }, 169 { 170 did: 'did:plc:7q4nnnxawajbfaq7to5dpbsy', 171 rkey: 'bsky-news', 172 }, 173 { 174 did: 'did:plc:jcoy7v3a2t4rcfdh6i4kza25', 175 rkey: 'astro', 176 }, 177 { 178 did: 'did:plc:tenurhgjptubkk5zf5qhi3og', 179 rkey: 'h-nba', 180 }, 181 { 182 did: 'did:plc:vpkhqolt662uhesyj6nxm7ys', 183 rkey: 'devfeed', 184 }, 185 { 186 did: 'did:plc:cndfx4udwgvpjaakvxvh7wm5', 187 rkey: 'flipboard-tech', 188 }, 189 { 190 did: 'did:plc:w4xbfzo7kqfes5zb7r6qv3rw', 191 rkey: 'blacksky', 192 }, 193 { 194 did: 'did:plc:lptjvw6ut224kwrj7ub3sqbe', 195 rkey: 'aaaotfjzjplna', 196 }, 197 { 198 did: 'did:plc:gkvpokm7ec5j5yxls6xk4e3z', 199 rkey: 'formula-one', 200 }, 201 { 202 did: 'did:plc:q6gjnaw2blty4crticxkmujt', 203 rkey: 'positivifeed', 204 }, 205 { 206 did: 'did:plc:l72uci4styb4jucsgcrrj5ap', 207 rkey: 'aaao5dzfm36u4', 208 }, 209 { 210 did: 'did:plc:k3jkadxv5kkjgs6boyon7m6n', 211 rkey: 'aaaavlyvqzst2', 212 }, 213 { 214 did: 'did:plc:nkahctfdi6bxk72umytfwghw', 215 rkey: 'aaado2uvfsc6w', 216 }, 217 { 218 did: 'did:plc:epihigio3d7un7u3gpqiy5gv', 219 rkey: 'aaaekwsc7zsvs', 220 }, 221 { 222 did: 'did:plc:qiknc4t5rq7yngvz7g4aezq7', 223 rkey: 'aaaejxlobe474', 224 }, 225 { 226 did: 'did:plc:mlq4aycufcuolr7ax6sezpc4', 227 rkey: 'aaaoudweck6uy', 228 }, 229 { 230 did: 'did:plc:rcez5hcvq3vzlu5x7xrjyccg', 231 rkey: 'aaadzjxbcddzi', 232 }, 233 { 234 did: 'did:plc:lnxbuzaenlwjrncx6sc4cfdr', 235 rkey: 'aaab2vesjtszc', 236 }, 237 { 238 did: 'did:plc:x3cya3wkt4n6u4ihmvpsc5if', 239 rkey: 'aaacynbxwimok', 240 }, 241 { 242 did: 'did:plc:abv47bjgzjgoh3yrygwoi36x', 243 rkey: 'aaagt6amuur5e', 244 }, 245 { 246 did: 'did:plc:ffkgesg3jsv2j7aagkzrtcvt', 247 rkey: 'aaacjerk7gwek', 248 }, 249 { 250 did: 'did:plc:geoqe3qls5mwezckxxsewys2', 251 rkey: 'aaai43yetqshu', 252 }, 253 { 254 did: 'did:plc:2wqomm3tjqbgktbrfwgvrw34', 255 rkey: 'authors', 256 }, 257]