-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2790-move-ErrorModal-to-ketcher-react
- Loading branch information
1 parent
19ed9d5
commit b67bb78
Showing
12 changed files
with
218 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
119 changes: 119 additions & 0 deletions
119
packages/ketcher-react/src/components/ErrorModal/ErrorModal.module.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
/**************************************************************************** | ||
* Copyright 2021 EPAM Systems | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
***************************************************************************/ | ||
|
||
.errorModalOverlay { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
bottom: 0; | ||
right: 0; | ||
z-index: 40; | ||
background: rgba(119, 119, 119, 0.2); | ||
} | ||
|
||
.errorModalOverlay .errorModalWindow { | ||
outline: 0; | ||
position: relative; | ||
vertical-align: middle; | ||
display: flex; | ||
flex-direction: column; | ||
width: 360px; | ||
max-height: 300px; | ||
text-align: left; | ||
background-color: #fff; | ||
border-radius: 8px; | ||
background-clip: padding-box; | ||
opacity: 1; | ||
transform: scale(1); | ||
transition: transform 0.3s, opacity 0.3s; | ||
font-family: Inter, FreeSans, Arimo, 'Droid Sans', Helvetica, 'Helvetica Neue', | ||
Arial, sans-serif; | ||
} | ||
|
||
.errorModalWindow header { | ||
display: flex; | ||
align-items: center; | ||
font-size: 14px; | ||
line-height: 14px; | ||
border-radius: 6px 6px 0 0; | ||
color: #333; | ||
font-weight: 500; | ||
padding: 12px; | ||
} | ||
|
||
.errorModalBody { | ||
font-size: 12px; | ||
line-height: 14px; | ||
overflow: auto; | ||
height: 100%; | ||
padding: 12px; | ||
} | ||
|
||
.errorModalBody::-webkit-scrollbar { | ||
background-color: #eff2f5; | ||
width: 6px; | ||
height: 6px; | ||
} | ||
|
||
.errorModalBody::-webkit-scrollbar-thumb { | ||
background-color:rgba(165,175,185,.85); | ||
border-radius: 10px; | ||
-webkit-border-radius: 10px; | ||
} | ||
|
||
.errorModalBody::-webkit-scrollbar-track { | ||
background-color: transparent; | ||
scrollbar-width: thin; | ||
} | ||
|
||
.errorModalBody::-webkit-scrollbar-thumb:active, | ||
&::-webkit-scrollbar-thumb:hover { | ||
background-color: #A5AFB9; | ||
} | ||
|
||
.errorModalWindow footer { | ||
display: flex; | ||
justify-content: flex-end; | ||
padding: 16px 12px 12px; | ||
gap: 8px; | ||
} | ||
|
||
.modalHidden { | ||
display: none; | ||
} | ||
|
||
.ok { | ||
min-width: 70px; | ||
height: 24px; | ||
border-radius: 4px; | ||
font-size: 12px; | ||
color: #fff; | ||
background-color: #167782; | ||
border: 1px solid transparent; | ||
} | ||
|
||
.ok:hover, .ok:active { | ||
background-color: #4fb3bf; | ||
} | ||
|
||
.ok:disabled { | ||
color: #333; | ||
background-color: #e1e5ea; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...tcher-react/src/components/ErrorModal/PasteErrorModalBody/PasteErrorModalBody.module.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.pasteErrorModalBody { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.shortcutsBlock { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.shortcuts { | ||
display: flex; | ||
flex-direction: column; | ||
margin-top: 12px; | ||
} | ||
|
||
.shortcut { | ||
font-size: 14px; | ||
color: #167782; | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/ketcher-react/src/components/ErrorModal/PasteErrorModalBody/PasteErrorModalBody.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { pasteErrorText, shortcuts } from '../constants' | ||
|
||
import styles from './PasteErrorModalBody.module.less' | ||
|
||
export const PasteErrorModalBody = (): JSX.Element => { | ||
return ( | ||
<div className={styles.pasteErrorModalBody}> | ||
<div>{pasteErrorText}</div> | ||
<div className={styles.shortcutsBlock}> | ||
{shortcuts.map(({ hotKey, label }) => { | ||
return ( | ||
<div className={styles.shortcuts} key={hotKey}> | ||
<div className={styles.shortcut}>{hotKey}</div> | ||
<div>{label}</div> | ||
</div> | ||
) | ||
})} | ||
</div> | ||
</div> | ||
) | ||
} |
1 change: 1 addition & 0 deletions
1
packages/ketcher-react/src/components/ErrorModal/PasteErrorModalBody/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './PasteErrorModalBody' |
13 changes: 13 additions & 0 deletions
13
packages/ketcher-react/src/components/ErrorModal/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const pasteErrorText = | ||
'This action is unavailable via menu. Please use shortcuts instead:' | ||
|
||
export const shortcuts = [ | ||
{ hotKey: 'CTRL/Cmd + C', label: 'for paste' }, | ||
{ hotKey: 'CTRL/Cmd + X', label: 'for cut' }, | ||
{ hotKey: 'CTRL/Cmd + V', label: 'for paste' } | ||
] | ||
|
||
export const error = { | ||
message: 'Error Message', | ||
close: 'Close' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/**************************************************************************** | ||
* Copyright 2021 EPAM Systems | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
***************************************************************************/ | ||
|
||
import ErrorModal from './ErrorModal' | ||
|
||
export { ErrorModal } |
File renamed without changes
Oops, something went wrong.