Skip to content

Commit 0e0f7b7

Browse files
authored
Merge pull request #7653 from sagemathinc/fix-slide-icons-antd
frontend/slides: fix wrongly aligned icons
2 parents cdea4ab + 75eb8c9 commit 0e0f7b7

File tree

4 files changed

+22
-17
lines changed

4 files changed

+22
-17
lines changed

src/packages/frontend/frame-editors/whiteboard-editor/delete-page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Button, Popconfirm, Tooltip } from "antd";
2+
23
import { Icon } from "@cocalc/frontend/components/icon";
34
import { useFrameContext } from "./hooks";
45
import { COLORS } from "@cocalc/util/theme";
@@ -20,12 +21,11 @@ export default function DeletePage({ pageId }) {
2021
<Button
2122
type="text"
2223
size="small"
24+
icon={<Icon style={{ color: COLORS.FILE_ICON }} name="trash" />}
2325
onClick={(e) => {
2426
e?.stopPropagation();
2527
}}
26-
>
27-
<Icon style={{ color: COLORS.FILE_ICON }} name="trash" />
28-
</Button>
28+
/>
2929
</Tooltip>
3030
</Popconfirm>
3131
);

src/packages/frontend/frame-editors/whiteboard-editor/new-page.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { Button, Popover, Tooltip } from "antd";
2+
import { CSSProperties, ReactNode } from "react";
3+
24
import { Icon } from "@cocalc/frontend/components/icon";
3-
import { useFrameContext } from "./hooks";
45
import { COLORS } from "@cocalc/util/theme";
5-
import { CSSProperties, ReactNode } from "react";
6+
import { useFrameContext } from "./hooks";
67

78
function addPage(actions, afterPageId?) {
89
const frameId = actions.show_focused_frame_of_type(actions.mainFrameType);
@@ -57,10 +58,12 @@ export function AddPage({ pageId }: { pageId: string }) {
5758
const { actions } = useFrameContext();
5859
return (
5960
<Tooltip title="Insert new page" placement="right" mouseEnterDelay={1}>
60-
<Button type="text" size="small" onClick={() => addPage(actions, pageId)}>
61-
<Icon name="plus-circle" style={{ color: COLORS.FILE_ICON }} />
62-
<br />
63-
</Button>
61+
<Button
62+
type="text"
63+
size="small"
64+
onClick={() => addPage(actions, pageId)}
65+
icon={<Icon name="plus-circle" style={{ color: COLORS.FILE_ICON }} />}
66+
/>
6467
</Tooltip>
6568
);
6669
}

src/packages/frontend/frame-editors/whiteboard-editor/overview.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ of the "font_size" parameter for the frame.
66
77
*/
88

9-
import NewPage, { AddPage } from "./new-page";
10-
import DeletePage from "./delete-page";
11-
import { CSSProperties, useEffect, ReactNode } from "react";
9+
import { CSSProperties, ReactNode, useEffect } from "react";
10+
import type { GridItemProps } from "react-virtuoso";
1211
import { VirtuosoGrid } from "react-virtuoso";
13-
import { useFrameContext } from "./hooks";
12+
1413
import { useEditorRedux } from "@cocalc/frontend/app-framework";
1514
import { Loading } from "@cocalc/frontend/components";
16-
import { Overview as OnePage } from "./tools/navigation";
1715
import { State, elementsList } from "./actions";
18-
import type { GridItemProps } from "react-virtuoso";
16+
import DeletePage from "./delete-page";
17+
import { useFrameContext } from "./hooks";
18+
import NewPage, { AddPage } from "./new-page";
19+
import { Overview as OnePage } from "./tools/navigation";
1920

2021
export default function Overview() {
2122
const { actions, id: frameId, project_id, path, desc } = useFrameContext();
@@ -111,7 +112,7 @@ export default function Overview() {
111112
onClick={(e) => {
112113
e.stopPropagation(); // so doesn't focus this frame then page, causing flicker.
113114
const frameId = actions.show_focused_frame_of_type(
114-
actions.mainFrameType
115+
actions.mainFrameType,
115116
);
116117
actions.setPage(frameId, index + 1);
117118
actions.fitToScreen(frameId);

src/packages/frontend/frame-editors/whiteboard-editor/pages.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ where the page size expands to fit the width.
55

66
import { CSSProperties, useEffect, useRef, useState } from "react";
77
import { Virtuoso } from "react-virtuoso";
8+
import useResizeObserver from "use-resize-observer";
9+
810
import useVirtuosoScrollHook from "@cocalc/frontend/components/virtuoso-scroll-hook";
911
import { useFrameContext } from "./hooks";
1012
import { useEditorRedux } from "@cocalc/frontend/app-framework";
1113
import { Loading } from "@cocalc/frontend/components";
1214
import { Overview } from "./tools/navigation";
1315
import { State, elementsList } from "./actions";
14-
import useResizeObserver from "use-resize-observer";
1516
import {
1617
DragHandle,
1718
SortableList,

0 commit comments

Comments
 (0)