Skip to content

Commit f385643

Browse files
jyxjjjxrgzs
andauthored
fix(toolbar): adjust toolbar position to center (#464)
* fix(toolbar): fix position * fix(toolbar): adjust toolbar position to center Signed-off-by: MadDogOwner <xiaoran@xrgzs.top> --------- Signed-off-by: MadDogOwner <xiaoran@xrgzs.top> Co-authored-by: MadDogOwner <xiaoran@xrgzs.top>
1 parent 38dee86 commit f385643

1 file changed

Lines changed: 51 additions & 47 deletions

File tree

src/pages/home/toolbar/Center.tsx

Lines changed: 51 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -30,61 +30,65 @@ export const Center = () => {
3030
class="center-toolbar"
3131
pos="fixed"
3232
bottom="$4"
33-
right="50%"
33+
left="50%"
3434
w="max-content"
3535
color="$neutral11"
36-
as={Motion.div}
37-
initial={{ opacity: 0, scale: 0.9, x: "50%", y: 10 }}
38-
animate={{ opacity: 1, scale: 1, x: "50%", y: 0 }}
39-
exit={{ opacity: 0, scale: 0.9 }}
40-
// @ts-ignore
41-
transition={{ duration: 0.2 }}
36+
transform="translateX(-50%)"
4237
>
43-
<HStack
44-
p="$2"
45-
bgColor={useColorModeValue("white", "#000000d0")()}
46-
spacing="$1"
47-
shadow="0px 10px 30px -5px rgba(0, 0, 0, 0.3)"
48-
rounded="$lg"
49-
css={{
50-
backdropFilter: "blur(8px)",
51-
}}
38+
<Box
39+
as={Motion.div}
40+
initial={{ opacity: 0, scale: 0.9, y: 10 }}
41+
animate={{ opacity: 1, scale: 1, y: 0 }}
42+
exit={{ opacity: 0, scale: 0.9 }}
43+
// @ts-ignore
44+
transition={{ duration: 0.2 }}
5245
>
53-
<Show when={!isShare() && objStore.write}>
54-
<For
55-
each={
56-
["rename", "move", "copy", "delete", "decompress"] as const
57-
}
58-
>
59-
{(name) => {
60-
return userCan(name) ? (
61-
<CenterIcon
62-
name={name}
63-
onClick={() => {
64-
bus.emit("tool", name)
65-
}}
66-
/>
67-
) : null
68-
}}
69-
</For>
70-
</Show>
71-
<Show when={userCan("share")}>
46+
<HStack
47+
p="$2"
48+
bgColor={useColorModeValue("white", "#000000d0")()}
49+
spacing="$1"
50+
shadow="0px 10px 30px -5px rgba(0, 0, 0, 0.3)"
51+
rounded="$lg"
52+
css={{
53+
backdropFilter: "blur(8px)",
54+
}}
55+
>
56+
<Show when={!isShare() && objStore.write}>
57+
<For
58+
each={
59+
["rename", "move", "copy", "delete", "decompress"] as const
60+
}
61+
>
62+
{(name) => {
63+
return userCan(name) ? (
64+
<CenterIcon
65+
name={name}
66+
onClick={() => {
67+
bus.emit("tool", name)
68+
}}
69+
/>
70+
) : null
71+
}}
72+
</For>
73+
</Show>
74+
<Show when={userCan("share")}>
75+
<CenterIcon
76+
name="share"
77+
onClick={() => {
78+
bus.emit("tool", "share")
79+
}}
80+
/>
81+
</Show>
82+
<CopyLink />
83+
<Download />
7284
<CenterIcon
73-
name="share"
85+
name="cancel_select"
7486
onClick={() => {
75-
bus.emit("tool", "share")
87+
selectAll(false)
7688
}}
7789
/>
78-
</Show>
79-
<CopyLink />
80-
<Download />
81-
<CenterIcon
82-
name="cancel_select"
83-
onClick={() => {
84-
selectAll(false)
85-
}}
86-
/>
87-
</HStack>
90+
</HStack>
91+
</Box>
8892
</Box>
8993
</Show>
9094
</Presence>

0 commit comments

Comments
 (0)