mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Refine structure
This commit is contained in:
28
src/utils/fetches/relationshipsFetch.ts
Normal file
28
src/utils/fetches/relationshipsFetch.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import client from '@api/client'
|
||||
|
||||
export const relationshipsFetch = async ({
|
||||
queryKey,
|
||||
pageParam
|
||||
}: {
|
||||
queryKey: QueryKey.Relationships
|
||||
pageParam?: { direction: 'next'; id: Mastodon.Status['id'] }
|
||||
}): Promise<Mastodon.Account[]> => {
|
||||
const [_, type, { id }] = queryKey
|
||||
let params: { [key: string]: string } = {}
|
||||
|
||||
if (pageParam) {
|
||||
switch (pageParam.direction) {
|
||||
case 'next':
|
||||
params.max_id = pageParam.id
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const res = await client({
|
||||
method: 'get',
|
||||
instance: 'local',
|
||||
url: `accounts/${id}/${type}`,
|
||||
params
|
||||
})
|
||||
return Promise.resolve(res.body)
|
||||
}
|
@ -3,7 +3,7 @@ const Base = 4
|
||||
export const StyleConstants = {
|
||||
Font: {
|
||||
Size: { S: 14, M: 16, L: 18 },
|
||||
LineHeight: { S: 18, M: 22, L: 30 },
|
||||
LineHeight: { S: 18, M: 22, L: 26 },
|
||||
Weight: { Bold: '600' as '600' }
|
||||
},
|
||||
FontStyle: {
|
||||
@ -21,5 +21,5 @@ export const StyleConstants = {
|
||||
Global: { PagePadding: Base * 4 }
|
||||
},
|
||||
|
||||
Avatar: { S: 36, M: 52, L: 104 }
|
||||
Avatar: { S: 40, M: 52, L: 104 }
|
||||
}
|
||||
|
Reference in New Issue
Block a user