Skip to content

Commit 9b7f814

Browse files
Toast fix
1 parent f455ae0 commit 9b7f814

14 files changed

Lines changed: 103 additions & 48 deletions

File tree

src/common/services/fetch-api.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import axios from 'axios'
2+
import isFunction from 'lodash/isFunction'
3+
24
import { security } from './security'
35
import { clientAppSettings } from './client-app-settings'
4-
import isFunction from 'lodash/isFunction'
56
import { hasDifferentOwner } from './api-utils'
67

78
// Time needed to cancel the request

src/components/Atomic/Editor/Editor.styles.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { css } from '@emotion/react'
2+
23
import { colors } from '../_utils/colors'
34
import { ThemeType, get } from '../_theme'
45
import { fontPrimary } from '../_utils/commonStyles'
56

67
export const editor = (theme: ThemeType) => css`
7-
//max-height: 80%;
8+
position: relative;
89
910
&.disabled:after {
1011
//display: none;
@@ -75,6 +76,8 @@ export const editor = (theme: ThemeType) => css`
7576
`
7677

7778
export const fullSizeBtn = (theme: ThemeType) => css`
79+
display: flex;
80+
align-items: center;
7881
position: absolute;
7982
top: 12px;
8083
right: 12px;

src/components/Atomic/Editor/Editor.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// @ts-nocheck
22
import React, { FC, MutableRefObject, useEffect, useRef, useState } from 'react'
3-
import { defaultProps, Props } from './Editor.types'
4-
import * as styles from './Editor.styles'
53
import classNames from 'classnames'
64
import JSONEditor from 'jsoneditor'
75
import 'jsoneditor/dist/jsoneditor.css'
86
import isFunction from 'lodash/isFunction'
7+
8+
import { defaultProps, Props } from './Editor.types'
9+
import * as styles from './Editor.styles'
910
import IconShowPassword from '../Icon/components/IconShowPassword'
1011

1112
const Editor: FC<Props> = (props) => {

src/components/Atomic/FormSelect/FormSelect.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export type Props = {
2424
inlineStyle?: boolean
2525
isSearchable?: boolean
2626
menuIsOpen?: boolean
27+
menuPortalTarget?: HTMLElement | null
2728
name?: string
2829
onChange?: (v: any) => void
2930
options: Option[]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { css } from '@emotion/react'
22
import { get, ThemeType } from '../_theme'
33

4-
export const test = (theme: ThemeType) => css`
4+
export const toastGlobal = (theme: ThemeType) => css`
55
.plgd-toast {
66
background: ${get(theme, 'Toast.background')};
7-
border: 1px solid ${get(theme, 'Toast.borderColor')};
87
}
98
`

src/components/Atomic/Notification/ToastContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const ToastContainer = (props: Props) => {
1313
hideProgressBar
1414
newestOnTop
1515
autoClose={TOAST_HIDE_TIME}
16-
css={styles.test}
16+
css={styles.toastGlobal}
1717
icon={false}
1818
limit={MAX_NUMBER_OF_VISIBLE_TOASTS}
1919
pauseOnFocusLoss={false}

src/components/Atomic/Notification/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export const toastVariants = {
1111
} as const
1212

1313
export const DEFAULT_CONTAINER_ID = 'default-container'
14-
export const ERROR_CONTAINER_ID = 'error-container'
1514

1615
export const TOAST_HIDE_TIME = 5000
1716

src/components/Atomic/PageLoader/PageLoader.scss

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,7 @@
11
@import '../../../common/styles/colors';
22
@import '../../../common/styles/sizes';
33

4-
@keyframes increase {
5-
from {
6-
left: -5%;
7-
width: 5%;
8-
}
9-
to {
10-
left: 130%;
11-
width: 100%;
12-
}
13-
}
14-
@keyframes decrease {
15-
from {
16-
left: -80%;
17-
width: 80%;
18-
}
19-
to {
20-
left: 110%;
21-
width: 10%;
22-
}
23-
}
4+
245

256
#page-loader {
267
position: fixed;
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { css, keyframes } from '@emotion/react'
2+
import { ThemeType, get } from '../_theme'
3+
4+
const increase = keyframes`
5+
from {
6+
left: -5%;
7+
width: 5%;
8+
}
9+
to {
10+
left: 130%;
11+
width: 100%;
12+
}
13+
`
14+
15+
const decrease = keyframes`
16+
from {
17+
left: -80%;
18+
width: 80%;
19+
}
20+
to {
21+
left: 110%;
22+
width: 10%;
23+
}
24+
`
25+
26+
export const pageLoader = css`
27+
position: fixed;
28+
top: 85px;
29+
right: 0;
30+
width: 100%;
31+
z-index: 9;
32+
`
33+
34+
export const bar = css`
35+
width: 100%;
36+
height: 5px;
37+
overflow: hidden;
38+
position: relative;
39+
`
40+
41+
export const progress = css`
42+
width: 100%;
43+
height: 5px;
44+
background-color: transparent;
45+
`
46+
47+
export const subline = (theme: ThemeType) => css`
48+
position: absolute;
49+
background-color: ${get(theme, `PageLoader.bar.background`)};
50+
height: 5px;
51+
`
52+
53+
export const inc = css`
54+
animation: ${increase} 2s infinite;
55+
`
56+
57+
export const dec = css`
58+
animation: ${decrease} 2s 0.5s infinite;
59+
`

src/components/Atomic/PageLoader/PageLoader.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { FC, memo } from 'react'
2+
23
import { Props } from './PageLoader.types'
4+
import * as styles from './PageLoader.styles'
35

46
const PageLoader: FC<Props> = memo(({ loading, className }) =>
57
loading ? (
6-
<div id='page-loader' role='alert' aria-busy='true' className={className}>
7-
<div className='bar'>
8-
<div className='progress'>
9-
<div className='subline inc' />
10-
<div className='subline dec' />
8+
<div aria-busy='true' className={className} css={styles.pageLoader} role='alert'>
9+
<div css={styles.bar}>
10+
<div css={styles.progress}>
11+
<div css={[styles.subline, styles.inc]} />
12+
<div css={[styles.subline, styles.dec]} />
1113
</div>
1214
</div>
1315
</div>

0 commit comments

Comments
 (0)