Switch (mostly) from blocklists to mutelists

This commit is contained in:
Paul Frazee
2023-05-05 12:41:27 -05:00
parent 806e52705d
commit caf289d1d5
4 changed files with 18 additions and 19 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ export class ListsListModel {
constructor(
public rootStore: RootStoreModel,
public source: 'blocklists' | string,
public source: 'mutelists' | string,
) {
makeAutoObservable(
this,
@@ -62,7 +62,7 @@ export class ListsListModel {
this._xLoading(replace)
try {
let res
if (this.source === 'blocklists') {
if (this.source === 'mutelists') {
res = await this.rootStore.agent.app.bsky.graph.getListBlocks({
limit: PAGE_SIZE,
cursor: replace ? undefined : this.loadMoreCursor,
+3 -4
View File
@@ -38,15 +38,14 @@ export function MyListsEmptyState() {
size={14}
/>
<Text type="lg-medium" style={palInverted.text}>
New blocklist
New mutelist
</Text>
</Button>
</View>
<View style={[pal.viewLight, styles.notice]}>
<Text type="lg" style={[pal.textLight, s.textCenter]}>
Currently only "blocklists" are available, which is kind of weird but
we wanted to prioritize user safety. Feedlists will be implemented
soon!
Currently only "mutelists" are available. Feed lists will be
implemented soon!
</Text>
</View>
</View>
@@ -9,7 +9,7 @@ import {Button} from '../util/forms/Button'
import {usePalette} from 'lib/hooks/usePalette'
import {s} from 'lib/styles'
export function SubscribedBlocklistsEmptyState() {
export function SubscribedMutelistsEmptyState() {
const pal = usePalette('default')
const palInverted = usePalette('inverted')
@@ -27,8 +27,8 @@ export function SubscribedBlocklistsEmptyState() {
/>
</View>
<Text type="xl-medium" style={[s.textCenter, pal.text]}>
You can subscribe to blocklists to automatically block all of the users
they include. Blocklists and your subscriptions are public.
You can subscribe to mutelists to automatically mute all of the users
they include. Mutelists are public but your subscription is not.
</Text>
<View style={styles.btns}>
<Button type="inverted" style={styles.btn} onPress={onPressCreateList}>
@@ -38,7 +38,7 @@ export function SubscribedBlocklistsEmptyState() {
size={14}
/>
<Text type="lg-medium" style={palInverted.text}>
New blocklist
New mutelist
</Text>
</Button>
</View>
+9 -9
View File
@@ -5,7 +5,7 @@ import {withAuthRequired} from 'view/com/auth/withAuthRequired'
import {TabBar} from '../com/pager/TabBar'
import {Pager, RenderTabBarFnProps} from 'view/com/pager/Pager'
import {MyListsEmptyState} from 'view/com/lists/MyListsEmptyState'
import {SubscribedBlocklistsEmptyState} from 'view/com/lists/SubscribedBlocklistsEmptyState'
import {SubscribedMutelistsEmptyState} from 'view/com/lists/SubscribedMutelistsEmptyState'
import {useStores} from 'state/index'
import {ListsListModel} from 'state/models/lists/lists-list'
import {ListsList} from 'view/com/lists/ListsList'
@@ -23,8 +23,8 @@ export const ListsScreen = withAuthRequired(({route}: Props) => {
return list
}, [store])
const blocklists: ListsListModel = React.useMemo(() => {
const list = new ListsListModel(store, 'blocklists')
const mutelists: ListsListModel = React.useMemo(() => {
const list = new ListsListModel(store, 'mutelists')
list.loadMore()
return list
}, [store])
@@ -46,7 +46,7 @@ export const ListsScreen = withAuthRequired(({route}: Props) => {
return (
<TabBar
{...props}
items={['My Lists', 'Blocklists']}
items={['My Lists', 'Mutelists']}
indicatorColor={pal.colors.link}
indicatorPosition="bottom"
testID="tabs"
@@ -58,8 +58,8 @@ export const ListsScreen = withAuthRequired(({route}: Props) => {
return <MyListsEmptyState />
}, [])
const renderBlockliststEmptyState = React.useCallback(() => {
return <SubscribedBlocklistsEmptyState />
const renderMutelistsEmptyState = React.useCallback(() => {
return <SubscribedMutelistsEmptyState />
}, [])
return (
@@ -76,9 +76,9 @@ export const ListsScreen = withAuthRequired(({route}: Props) => {
/>
<ListsList
key="2"
testID="blocklistsPage"
listsList={blocklists}
renderEmptyState={renderBlockliststEmptyState}
testID="mutelistsPage"
listsList={mutelists}
renderEmptyState={renderMutelistsEmptyState}
/>
</Pager>
)