1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Refine structure

This commit is contained in:
Zhiyuan Zheng
2021-01-04 18:29:02 +01:00
parent 811964e10f
commit dcb36a682d
21 changed files with 561 additions and 382 deletions

View 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)
}

View File

@ -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 }
}