Skip to content

Commit ea65f58

Browse files
committed
Merge branch 'main' of github.com:devtron-labs/devtron-fe-common-lib into feat/release
2 parents aa1d592 + 66f752a commit ea65f58

33 files changed

+387
-74
lines changed

package-lock.json

Lines changed: 8 additions & 8 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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.0.79-beta-14",
3+
"version": "0.0.81-beta-1",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",
@@ -87,7 +87,6 @@
8787
"@typeform/embed-react": "2.20.0",
8888
"yaml": "^2.4.1",
8989
"react-mde": "^11.5.0"
90-
9190
},
9291
"dependencies": {
9392
"react-monaco-editor": "^0.54.0",

src/Common/ClipboardButton/ClipboardButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export default function ClipboardButton({
5555
content={copied ? copiedTippyText : 'Copy'}
5656
placement="bottom"
5757
visible={copied || enableTippy}
58+
arrow={false}
5859
>
5960
<button
6061
type="button"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { useContext } from 'react'
2+
import { context } from './UseRegisterShortcutContext'
3+
4+
const useRegisterShortcut = () => useContext(context)
5+
6+
export default useRegisterShortcut
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { createContext } from 'react'
2+
import { UseRegisterShortcutContextType } from './types'
3+
4+
export const context = createContext<UseRegisterShortcutContextType>(null)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { useMemo, useState } from 'react'
2+
import { context } from './UseRegisterShortcutContext'
3+
import { UseRegisterShortcutProviderType } from './types'
4+
5+
const UseRegisterShortcutProvider = ({ children }: UseRegisterShortcutProviderType) => {
6+
const [registerShortcut, setRegisterShortcut] = useState(true)
7+
8+
const providerValue = useMemo(
9+
() => ({
10+
registerShortcut,
11+
setRegisterShortcut: (allowShortcut: boolean) => setRegisterShortcut(allowShortcut),
12+
}),
13+
[registerShortcut],
14+
)
15+
16+
return <context.Provider value={providerValue}>{children}</context.Provider>
17+
}
18+
19+
export default UseRegisterShortcutProvider
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default as useRegisterShortcut } from './UseRegisterShortcut'
2+
export { default as UseRegisterShortcutProvider } from './UseRegisterShortcutProvider'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export interface UseRegisterShortcutContextType {
2+
registerShortcut: boolean
3+
setRegisterShortcut: (allowShortcut: boolean) => void
4+
}
5+
6+
export interface UseRegisterShortcutProviderType {
7+
children: React.ReactElement
8+
}

src/Common/Hooks/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ export { useSuperAdmin } from './UseSuperAdmin/UseSuperAdmin'
22
export { useClickOutside } from './UseClickOutside/UseClickOutside'
33
export { useWindowSize } from './UseWindowSize/UseWindowSize'
44
export * from './useUrlFilters'
5+
export * from './UseRegisterShortcut'

src/Common/Markdown/markdown.scss

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,25 @@
3939

4040
pre {
4141
padding: 16px;
42-
background-color: #f6f8fa;
43-
border-radius: 4px;
4442
border: unset;
43+
overflow: auto;
44+
font-size: 85%;
45+
line-height: 1.45;
46+
background-color: #f7f7f7;
47+
border-radius: 3px;
48+
49+
code {
50+
display: inline;
51+
margin: 0;
52+
overflow: visible;
53+
line-height: inherit;
54+
word-wrap: normal;
55+
white-space: pre;
56+
border: 0
57+
}
4558
}
4659

60+
4761
a.anchor {
4862
color: var(--N900);
4963
}

0 commit comments

Comments
 (0)