Skip to content

Commit 193ea35

Browse files
committed
fix(admin-ui): move css to applicationStyles
Signed-off-by: Jeet Viramgama <[email protected]>
1 parent f39f728 commit 193ea35

File tree

3 files changed

+33
-28
lines changed

3 files changed

+33
-28
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react'
2+
3+
const ShortCodesIcon = () => {
4+
return (
5+
<svg
6+
xmlns='http://www.w3.org/2000/svg'
7+
fill='none'
8+
viewBox='0 0 24 24'
9+
strokeWidth='1.5'
10+
stroke='currentColor'
11+
style={{ width: '18px' }}
12+
>
13+
<path
14+
strokeLinecap='round'
15+
strokeLinejoin='round'
16+
d='M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5'
17+
/>
18+
</svg>
19+
)
20+
}
21+
22+
export default ShortCodesIcon

admin-ui/app/routes/Apps/Gluu/styles/applicationstyle.js

+7
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,11 @@ export default {
5959
marginTop: '0px',
6060
marginRight: '-10px',
6161
},
62+
shortCodesWrapperStyles: {
63+
position: 'absolute',
64+
right: 0,
65+
marginRight: '0.5rem',
66+
top: '50%',
67+
transform: 'translateY(-70%)',
68+
}
6269
}

admin-ui/plugins/admin/components/Webhook/ShortcodePopover.js

+4-28
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,8 @@ import { useTranslation } from 'react-i18next'
99
import { HelpOutline } from '@mui/icons-material'
1010
import { Tooltip as ReactTooltip } from 'react-tooltip'
1111
import PropTypes from 'prop-types'
12-
13-
const Icon = () => (
14-
<svg
15-
xmlns='http://www.w3.org/2000/svg'
16-
fill='none'
17-
viewBox='0 0 24 24'
18-
strokeWidth='1.5'
19-
stroke='currentColor'
20-
style={{ width: '18px' }}
21-
>
22-
<path
23-
strokeLinecap='round'
24-
strokeLinejoin='round'
25-
d='M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5'
26-
/>
27-
</svg>
28-
)
12+
import applicationstyle from "Routes/Apps/Gluu/styles/applicationstyle"
13+
import ShortCodesIcon from 'Components/SVG/menu/ShortCodesIcon'
2914

3015
export default function ShortcodePopover({
3116
codes,
@@ -44,24 +29,15 @@ export default function ShortcodePopover({
4429
const open = Boolean(anchorEl)
4530
const id = open ? 'simple-popover' : undefined
4631

47-
const wrapperStyles = {
48-
position: 'absolute',
49-
right: 0,
50-
marginRight: '0.5rem',
51-
top: '50%',
52-
transform: 'translateY(-70%)',
53-
...buttonWrapperStyles,
54-
}
55-
5632
return (
57-
<div style={wrapperStyles}>
33+
<div style={{ ...applicationstyle.shortCodesWrapperStyles, buttonWrapperStyles }}>
5834
<Button
5935
aria-describedby={id}
6036
variant='text'
6137
sx={{ border: 0 }}
6238
onClick={handleClick}
6339
>
64-
<Icon />
40+
<ShortCodesIcon />
6541
</Button>
6642
<Popover
6743
id={id}

0 commit comments

Comments
 (0)