about summary refs log tree commit diff
path: root/src/state/queries/preferences/const.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/queries/preferences/const.ts')
-rw-r--r--src/state/queries/preferences/const.ts51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/state/queries/preferences/const.ts b/src/state/queries/preferences/const.ts
new file mode 100644
index 000000000..b7f9206e8
--- /dev/null
+++ b/src/state/queries/preferences/const.ts
@@ -0,0 +1,51 @@
+import {
+  UsePreferencesQueryResponse,
+  ThreadViewPreferences,
+} from '#/state/queries/preferences/types'
+import {DEFAULT_LOGGED_OUT_LABEL_PREFERENCES} from '#/state/queries/preferences/moderation'
+
+export const DEFAULT_HOME_FEED_PREFS: UsePreferencesQueryResponse['feedViewPrefs'] =
+  {
+    hideReplies: false,
+    hideRepliesByUnfollowed: false,
+    hideRepliesByLikeCount: 0,
+    hideReposts: false,
+    hideQuotePosts: false,
+    lab_mergeFeedEnabled: false, // experimental
+  }
+
+export const DEFAULT_THREAD_VIEW_PREFS: ThreadViewPreferences = {
+  sort: 'newest',
+  prioritizeFollowedUsers: true,
+  lab_treeViewEnabled: false,
+}
+
+const DEFAULT_PROD_FEED_PREFIX = (rkey: string) =>
+  `at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/${rkey}`
+export const DEFAULT_PROD_FEEDS = {
+  pinned: [DEFAULT_PROD_FEED_PREFIX('whats-hot')],
+  saved: [DEFAULT_PROD_FEED_PREFIX('whats-hot')],
+}
+
+export const DEFAULT_LOGGED_OUT_PREFERENCES: UsePreferencesQueryResponse = {
+  birthDate: new Date('2022-11-17'), // TODO(pwi)
+  adultContentEnabled: false,
+  feeds: {
+    saved: [],
+    pinned: [],
+    unpinned: [],
+  },
+  // labels are undefined until set by user
+  contentLabels: {
+    nsfw: DEFAULT_LOGGED_OUT_LABEL_PREFERENCES.nsfw,
+    nudity: DEFAULT_LOGGED_OUT_LABEL_PREFERENCES.nudity,
+    suggestive: DEFAULT_LOGGED_OUT_LABEL_PREFERENCES.suggestive,
+    gore: DEFAULT_LOGGED_OUT_LABEL_PREFERENCES.gore,
+    hate: DEFAULT_LOGGED_OUT_LABEL_PREFERENCES.hate,
+    spam: DEFAULT_LOGGED_OUT_LABEL_PREFERENCES.spam,
+    impersonation: DEFAULT_LOGGED_OUT_LABEL_PREFERENCES.impersonation,
+  },
+  feedViewPrefs: DEFAULT_HOME_FEED_PREFS,
+  threadViewPrefs: DEFAULT_THREAD_VIEW_PREFS,
+  userAge: 13, // TODO(pwi)
+}