Skip to content

Commit fb4a7de

Browse files
xqvvuc121914yu
authored andcommitted
chore: ui improvement (#5266)
1 parent 5f4b0dc commit fb4a7de

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

projects/app/src/pageComponents/chat/SliderApps.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ const SliderApps = ({ apps, activeAppId }: { apps: AppListItemType[]; activeAppI
5353

5454
return (
5555
<Flex flexDirection={'column'} w={'100%'} h={'100%'}>
56-
<Box mt={4} pl={4}>
56+
<Box mt={4} pl={3}>
5757
<Flex alignItems={'center'} py={2}>
5858
<Skeleton
59-
w="135px"
59+
w="143px"
6060
h="33px"
61+
pl={2}
6162
borderRadius="md"
6263
startColor="gray.100"
6364
endColor="gray.300"
@@ -81,13 +82,13 @@ const SliderApps = ({ apps, activeAppId }: { apps: AppListItemType[]; activeAppI
8182
{!isTeamChat && (
8283
<>
8384
<HStack
84-
px={4}
85+
px={3}
8586
my={2}
8687
color={'myGray.500'}
8788
fontSize={'sm'}
8889
justifyContent={'space-between'}
8990
>
90-
<Box>{t('common:core.chat.Recent use')}</Box>
91+
<Box pl={2}>{t('common:core.chat.Recent use')}</Box>
9192
<MyPopover
9293
placement="bottom-end"
9394
offset={[20, 10]}
@@ -135,7 +136,7 @@ const SliderApps = ({ apps, activeAppId }: { apps: AppListItemType[]; activeAppI
135136
<Flex
136137
key={item._id}
137138
py={2}
138-
px={3}
139+
px={2}
139140
mb={3}
140141
cursor={'pointer'}
141142
borderRadius={'md'}
@@ -162,7 +163,7 @@ const SliderApps = ({ apps, activeAppId }: { apps: AppListItemType[]; activeAppI
162163
))}
163164
</MyBox>
164165

165-
<Box p="4">
166+
<Box px={3} py={4}>
166167
{userInfo ? (
167168
<UserAvatarPopover>
168169
<Flex alignItems="center" gap={2} w="100%">

projects/app/src/pages/chat/index.tsx

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,25 @@ const useChatHook = (appId: string) => {
5252
const [isInitedUser, setIsIntedUser] = useState(false);
5353

5454
// get app list
55-
const {
56-
data: myApps = [],
57-
runAsync: loadMyApps,
58-
loading: isLoadingApps
59-
} = useRequest2(() => getMyApps({ getRecentlyChat: true }), {
60-
manual: false,
61-
refreshDeps: [userInfo],
62-
errorToast: '',
63-
async onSuccess(apps) {
64-
// if no appId and there are available apps, automatically jump to the first app
65-
if (!appId && apps.length > 0) {
66-
router.replace({
67-
query: {
68-
...router.query,
69-
appId: lastChatAppId || apps[0]._id
70-
}
71-
});
55+
const { data: myApps = [], loading: isLoadingApps } = useRequest2(
56+
() => getMyApps({ getRecentlyChat: true }),
57+
{
58+
manual: false,
59+
refreshDeps: [userInfo],
60+
errorToast: '',
61+
async onSuccess(apps) {
62+
// if no appId and there are available apps, automatically jump to the first app
63+
if (!appId && apps.length > 0) {
64+
router.replace({
65+
query: {
66+
...router.query,
67+
appId: lastChatAppId || apps[0]._id
68+
}
69+
});
70+
}
7271
}
7372
}
74-
});
73+
);
7574

7675
// initialize user info
7776
useMount(async () => {

0 commit comments

Comments
 (0)