Refactor lists to use new queries (#1875)
* Refactor lists queries to react-query * Delete old lists-list model * Implement list, list-members, and list-memberships react-queries * Update CreateOrEditList modal * First pass at my-follows and actor-autocomplete queries * Update ListAddUserModal to use new queries, change to ListAddRemoveUsersModal * Update UserAddRemoveLists modal * Remove old TODO * Fix indent, autocomplete query * Add a todo --------- Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
parent
05b728fffc
commit
d9e0a927c1
25 changed files with 1303 additions and 1545 deletions
|
@ -1,11 +1,10 @@
|
|||
import React from 'react'
|
||||
import {AppBskyActorDefs, ModerationUI} from '@atproto/api'
|
||||
import {AppBskyActorDefs, AppBskyGraphDefs, ModerationUI} from '@atproto/api'
|
||||
import {StyleProp, ViewStyle, DeviceEventEmitter} from 'react-native'
|
||||
import {Image as RNImage} from 'react-native-image-crop-picker'
|
||||
|
||||
import {ProfileModel} from '#/state/models/content/profile'
|
||||
import {ImageModel} from '#/state/models/media/image'
|
||||
import {ListModel} from '#/state/models/content/list'
|
||||
import {GalleryModel} from '#/state/models/media/gallery'
|
||||
|
||||
export interface ConfirmModal {
|
||||
|
@ -55,7 +54,7 @@ export type ReportModal = {
|
|||
export interface CreateOrEditListModal {
|
||||
name: 'create-or-edit-list'
|
||||
purpose?: string
|
||||
list?: ListModel
|
||||
list?: AppBskyGraphDefs.ListView
|
||||
onSave?: (uri: string) => void
|
||||
}
|
||||
|
||||
|
@ -67,10 +66,13 @@ export interface UserAddRemoveListsModal {
|
|||
onRemove?: (listUri: string) => void
|
||||
}
|
||||
|
||||
export interface ListAddUserModal {
|
||||
name: 'list-add-user'
|
||||
list: ListModel
|
||||
onAdd?: (profile: AppBskyActorDefs.ProfileViewBasic) => void
|
||||
export interface ListAddRemoveUsersModal {
|
||||
name: 'list-add-remove-users'
|
||||
list: AppBskyGraphDefs.ListView
|
||||
onChange?: (
|
||||
type: 'add' | 'remove',
|
||||
profile: AppBskyActorDefs.ProfileViewBasic,
|
||||
) => void
|
||||
}
|
||||
|
||||
export interface EditImageModal {
|
||||
|
@ -184,7 +186,7 @@ export type Modal =
|
|||
// Lists
|
||||
| CreateOrEditListModal
|
||||
| UserAddRemoveListsModal
|
||||
| ListAddUserModal
|
||||
| ListAddRemoveUsersModal
|
||||
|
||||
// Posts
|
||||
| AltTextImageModal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue