Skip to content

Commit 385d2aa

Browse files
committed
fix
1 parent 1015359 commit 385d2aa

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

packages/react-grab/src/components/toolbar/index.tsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -272,18 +272,11 @@ export const Toolbar: Component<ToolbarProps> = (props) => {
272272
if (isVertical()) {
273273
const placementClass =
274274
tooltipSide === "left" ? "right-full mr-0.5" : "left-full ml-0.5";
275-
return `top-1/2 ${placementClass}`;
275+
return `top-1/2 -translate-y-1/2 ${placementClass}`;
276276
}
277277
const placementClass =
278278
tooltipSide === "top" ? "bottom-full mb-0.5" : "top-full mt-0.5";
279-
return `left-1/2 ${placementClass}`;
280-
};
281-
282-
const hintTranslateStyle = (): string => {
283-
if (isVertical()) {
284-
return `0 calc(-50% - ${TOOLBAR_HINT_CENTER_OFFSET_PX}px)`;
285-
}
286-
return `calc(-50% - ${TOOLBAR_HINT_CENTER_OFFSET_PX}px) 0`;
279+
return `left-1/2 -translate-x-1/2 ${placementClass}`;
287280
};
288281

289282
const stopEventPropagation = (event: Event) => {
@@ -1287,7 +1280,8 @@ export const Toolbar: Component<ToolbarProps> = (props) => {
12871280
)}
12881281
style={{
12891282
"z-index": String(Z_INDEX_HOST),
1290-
translate: hintTranslateStyle(),
1283+
[isVertical() ? "top" : "left"]:
1284+
`calc(50% - ${TOOLBAR_HINT_CENTER_OFFSET_PX}px)`,
12911285
}}
12921286
>
12931287
<Show when={selectionHintIndex() === 0}>
@@ -1336,7 +1330,8 @@ export const Toolbar: Component<ToolbarProps> = (props) => {
13361330
)}
13371331
style={{
13381332
"z-index": String(Z_INDEX_HOST),
1339-
translate: hintTranslateStyle(),
1333+
[isVertical() ? "top" : "left"]:
1334+
`calc(50% - ${TOOLBAR_HINT_CENTER_OFFSET_PX}px)`,
13401335
}}
13411336
>
13421337
Enable to continue

packages/website/next.config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ const nextConfig: NextConfig = {
4242
},
4343
];
4444
},
45+
headers: async () => {
46+
return [
47+
{
48+
source: "/",
49+
headers: [
50+
{
51+
key: "Vary",
52+
value: "Accept",
53+
},
54+
],
55+
},
56+
];
57+
},
4558
rewrites: async () => {
4659
return {
4760
beforeFiles: [

0 commit comments

Comments
 (0)