Skip to content

Commit 7de7958

Browse files
YangGuoXuan-0503杨国璇
andauthored
fix: x icon (#227)
Co-authored-by: 杨国璇 <[email protected]>
1 parent fd9309d commit 7de7958

File tree

9 files changed

+49
-7
lines changed

9 files changed

+49
-7
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@seafile/seafile-editor",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "",
55
"main": "dist/index.js",
66
"scripts": {

src/components/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import LongTextModal from './longtext-modal';
22
import BrowserTip from './browser-tip';
3+
import ModalHeader from './modal-header';
34

45
export {
56
LongTextModal,
67
BrowserTip,
8+
ModalHeader,
79
};

src/components/modal-header/index.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.sf-editor-close-icon {
2+
border-radius: 3px;
3+
display: inline-flex;
4+
align-items: center;
5+
justify-content: center;
6+
height: 28px;
7+
width: 28px;
8+
}
9+
10+
.sf-editor-close-icon .iconfont {
11+
font-weight: 700;
12+
color: #666;
13+
}
14+
15+
.sf-editor-close-icon:hover {
16+
background-color: #efefef;
17+
cursor: pointer;
18+
}

src/components/modal-header/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react';
2+
import { ModalHeader as DefaultModalHeader } from 'reactstrap';
3+
4+
import './index.css';
5+
6+
function ModalHeader({ toggle, children }) {
7+
let close = null;
8+
if (toggle) {
9+
close = <span class="sf-editor-close-icon" onClick={toggle}><i class="iconfont icon-x" aria-hidden="true"></i></span>;
10+
}
11+
return (
12+
<DefaultModalHeader close={close}>
13+
{children}
14+
</DefaultModalHeader>
15+
);
16+
}
17+
18+
export default ModalHeader;

src/extension/plugins/formula/menu/formula-modal.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useCallback, useEffect, useRef, useState } from 'react';
2-
import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Input } from 'reactstrap';
2+
import { Button, Modal, ModalBody, ModalFooter, Input } from 'reactstrap';
33
import { useTranslation } from 'react-i18next';
4+
import { ModalHeader } from '../../../../components';
45
import { insertFormula, updateFormula } from '../helper';
56
import { getAboveBlockNode } from '../../../core';
67
import { TRANSLATE_NAMESPACE } from '../../../../constants';

src/extension/plugins/image/menu/image-menu-dialog.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React, { useState, useRef, useMemo } from 'react';
2-
import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Form, FormGroup, Label, Input, FormFeedback } from 'reactstrap';
2+
import { Button, Modal, ModalBody, ModalFooter, Form, FormGroup, Label, Input, FormFeedback } from 'reactstrap';
33
import PropTypes from 'prop-types';
44
import { useTranslation } from 'react-i18next';
5+
import { ModalHeader } from '../../../../components';
56
import isUrl from 'is-url';
67
import { insertImage } from '../helper';
78
import { TRANSLATE_NAMESPACE } from '../../../../constants';

src/extension/plugins/link/menu/link-modal.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React, { useCallback, useMemo, useRef, useState } from 'react';
2-
import { Button, Form, FormFeedback, FormGroup, Input, Label, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap';
2+
import { Button, Form, FormFeedback, FormGroup, Input, Label, Modal, ModalBody, ModalFooter } from 'reactstrap';
33
import PropTypes from 'prop-types';
44
import { useTranslation } from 'react-i18next';
5+
import { ModalHeader } from '../../../../components';
56
import { insertLink, isLinkType, updateLink } from '../helper';
67
import { TRANSLATE_NAMESPACE } from '../../../../constants';
78

src/extension/toolbar/user-help/shortcut-dialog.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { Fragment } from 'react';
2-
import { Modal, ModalHeader, ModalBody } from 'reactstrap';
2+
import { Modal, ModalBody } from 'reactstrap';
33
import { withTranslation } from 'react-i18next';
4+
import { ModalHeader } from '../../../components';
45

56
import './style.css';
67

0 commit comments

Comments
 (0)