Skip to content

Commit e258f95

Browse files
committed
[gephi-lite] homogeneous buttons in modal
Fix #200 - Cancel button must be dark outline - Action button in primary - Button should not have icons
1 parent 3baa605 commit e258f95

File tree

10 files changed

+30
-20
lines changed

10 files changed

+30
-20
lines changed

packages/gephi-lite/src/components/forms/GraphMetadataForm.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export const GraphMetadataForm: FC = () => {
8585
</label>
8686
<select
8787
id="graph-type"
88+
className="form-control"
8889
value={metadata?.type || "undirected"}
8990
onChange={(e) => {
9091
setGraphMeta({

packages/gephi-lite/src/views/graphPage/modals/ConfirmModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ const ConfirmModal: FC<
2929
>
3030
<>{message}</>
3131
<>
32-
<button type="reset" className="btn btn-outline-primary" onClick={() => cancel()}>
32+
<button type="reset" className="btn btn-outline-dark" onClick={() => cancel()}>
3333
{cancelMsg || (t("common.cancel") as string)}
3434
</button>
35-
<button type="submit" className="btn btn-danger">
35+
<button type="submit" className="btn btn-primary">
3636
{confirmMsg || (t("common.confirm") as string)}
3737
</button>
3838
</>

packages/gephi-lite/src/views/graphPage/modals/FunctionEditorModal.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export function FunctionEditorModal<T>(props: ModalProps<FunctionEditorModalProp
100100
>
101101
{t("common.cancel")}
102102
</button>
103+
103104
<button
104105
type="button"
105106
title={t("common.save").toString()}
@@ -109,6 +110,7 @@ export function FunctionEditorModal<T>(props: ModalProps<FunctionEditorModalProp
109110
<SaveIcon className="me-1" />
110111
{t("common.save")}
111112
</button>
113+
112114
{withSaveAndRun && (
113115
<button type="submit" title={t("common.save-and-run").toString()} className="btn btn-primary">
114116
<RunIcon className="me-1" />

packages/gephi-lite/src/views/graphPage/modals/edition/UpdateEdgeModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ const UpdateEdgeModal: FC<ModalProps<{ edgeId?: string }>> = ({ cancel, submit,
342342
<button type="button" className="btn btn-outline-dark" onClick={() => cancel()}>
343343
{t("common.cancel")}
344344
</button>
345+
345346
<button type="submit" className="btn btn-primary">
346347
{isNew ? t("edition.create_edges") : t("edition.update_edges")}
347348
</button>

packages/gephi-lite/src/views/graphPage/modals/edition/UpdateNodeModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ const UpdateNodeModal: FC<ModalProps<{ nodeId?: string }>> = ({ cancel, submit,
269269
<button type="button" className="btn btn-outline-dark" onClick={() => cancel()}>
270270
{t("common.cancel")}
271271
</button>
272+
272273
<button type="submit" className="btn btn-primary">
273274
{isNew ? t("edition.create_nodes") : t("edition.update_nodes")}
274275
</button>

packages/gephi-lite/src/views/graphPage/modals/open/CloudFileModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import byteSize from "byte-size";
22
import cx from "classnames";
33
import { FC, useEffect, useState } from "react";
44
import { useTranslation } from "react-i18next";
5-
import { FaExternalLinkAlt, FaFolderOpen, FaLock, FaSync } from "react-icons/fa";
5+
import { FaExternalLinkAlt, FaLock, FaSync } from "react-icons/fa";
66

77
import { Loader } from "../../../../components/Loader";
88
import { Modal } from "../../../../components/modals";
@@ -122,6 +122,7 @@ export const CloudFileModal: FC<ModalProps<unknown>> = ({ cancel }) => {
122122
<button title="Cancel" className="btn btn-outline-dark" onClick={() => cancel()}>
123123
{t("common.cancel").toString()}
124124
</button>
125+
125126
<button
126127
className="btn btn-primary"
127128
disabled={!selected}
@@ -150,7 +151,6 @@ export const CloudFileModal: FC<ModalProps<unknown>> = ({ cancel }) => {
150151
}
151152
}}
152153
>
153-
<FaFolderOpen className="me-1" />
154154
{t("common.open").toString()}
155155
</button>
156156
</>

packages/gephi-lite/src/views/graphPage/modals/open/LocalFileModal.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { FC, useState } from "react";
22
import { useTranslation } from "react-i18next";
3-
import { FaFolderOpen, FaTimes } from "react-icons/fa";
43

54
import { DropInput } from "../../../../components/DropInput";
65
import { Loader } from "../../../../components/Loader";
@@ -34,10 +33,10 @@ export const LocalFileModal: FC<ModalProps<unknown>> = ({ cancel }) => {
3433
{importStateType === "loading" && <Loader />}
3534
</>
3635
<>
37-
<button title={t("common.cancel").toString()} className="btn btn-danger" onClick={() => cancel()}>
38-
<FaTimes className="me-1" />
36+
<button title={t("common.cancel").toString()} className="btn btn-outline-dark" onClick={() => cancel()}>
3937
{t("common.cancel").toString()}
4038
</button>
39+
4140
<button
4241
className="btn btn-primary"
4342
disabled={!file}
@@ -68,7 +67,6 @@ export const LocalFileModal: FC<ModalProps<unknown>> = ({ cancel }) => {
6867
}
6968
}}
7069
>
71-
<FaFolderOpen className="me-1" />
7270
{t("common.open").toString()}
7371
</button>
7472
</>

packages/gephi-lite/src/views/graphPage/modals/open/RemoteFileModal.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { FC, useCallback, useMemo, useState } from "react";
22
import { useTranslation } from "react-i18next";
3-
import { FaFolderOpen, FaTimes } from "react-icons/fa";
43

54
import { Loader } from "../../../../components/Loader";
65
import { Modal } from "../../../../components/modals";
@@ -73,8 +72,12 @@ export const RemoteFileModal: FC<ModalProps<unknown>> = ({ cancel }) => {
7372
</>
7473

7574
<>
76-
<button type="reset" title={t("common.cancel").toString()} className="btn btn-danger" onClick={() => cancel()}>
77-
<FaTimes className="me-1" />
75+
<button
76+
type="reset"
77+
title={t("common.cancel").toString()}
78+
className="btn btn-outline-dark"
79+
onClick={() => cancel()}
80+
>
7881
{t("common.cancel").toString()}
7982
</button>
8083
<button
@@ -83,7 +86,6 @@ export const RemoteFileModal: FC<ModalProps<unknown>> = ({ cancel }) => {
8386
disabled={!isFormValid || fileStateType === "loading"}
8487
title={url ? t("common.open_file", { filename: extractFilename(url) }).toString() : ""}
8588
>
86-
<FaFolderOpen className="me-1" />
8789
{t("common.open").toString()}
8890
</button>
8991
</>

packages/gephi-lite/src/views/graphPage/modals/save/ExportPNGModal.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import fileSaver from "file-saver";
22
import { FC, useCallback, useState } from "react";
33
import { useTranslation } from "react-i18next";
4-
import { FaSave, FaTimes } from "react-icons/fa";
54

65
import { Modal } from "../../../../components/modals";
76
import { useAppearance, useSigmaAtom } from "../../../../core/context/dataContexts";
@@ -114,12 +113,15 @@ export const ExportPNGModal: FC<ModalProps<unknown>> = ({ cancel }) => {
114113
</>
115114

116115
<>
117-
<button type="reset" title={t("common.cancel").toString()} className="btn btn-danger" onClick={() => cancel()}>
118-
<FaTimes className="me-1" />
116+
<button
117+
type="reset"
118+
title={t("common.cancel").toString()}
119+
className="btn btn-outline-dark"
120+
onClick={() => cancel()}
121+
>
119122
{t("common.cancel").toString()}
120123
</button>
121124
<button type="submit" title={t("common.save").toString()} className="btn btn-primary ms-2">
122-
<FaSave className="me-1" />
123125
{t("common.save").toString()}
124126
</button>
125127
</>

packages/gephi-lite/src/views/graphPage/modals/save/SaveCloudFileModal.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { FC, useCallback, useEffect, useState } from "react";
22
import { useTranslation } from "react-i18next";
3-
import { FaSave, FaTimes } from "react-icons/fa";
43

54
import { Loader } from "../../../../components/Loader";
65
import { Modal } from "../../../../components/modals";
@@ -112,18 +111,22 @@ export const SaveCloudFileModal: FC<ModalProps<unknown>> = ({ cancel }) => {
112111
</>
113112

114113
<>
115-
<button type="reset" title={t("common.cancel").toString()} className="btn btn-danger" onClick={() => cancel()}>
116-
<FaTimes className="me-1" />
114+
<button
115+
type="reset"
116+
title={t("common.cancel").toString()}
117+
className="btn btn-outline-dark"
118+
onClick={() => cancel()}
119+
>
117120
{t("common.cancel").toString()}
118121
</button>
122+
119123
<button
120124
type="submit"
121125
title={t("common.save").toString()}
122126
className="btn btn-primary"
123127
disabled={!isValid || loading}
124128
onClick={() => save()}
125129
>
126-
<FaSave className="me-1" />
127130
{t("common.save").toString()}
128131
</button>
129132
</>

0 commit comments

Comments
 (0)