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