Compare commits
2 Commits
3caa62d675
...
0ebc6b4897
| Author | SHA1 | Date | |
|---|---|---|---|
| 0ebc6b4897 | |||
| 3a8239c92d |
@ -105,7 +105,6 @@
|
||||
}
|
||||
|
||||
.electron-navigation-wrapper {
|
||||
z-index: 10000;
|
||||
user-select: none;
|
||||
--webkit-user-select: none;
|
||||
}
|
||||
|
||||
@ -1,11 +1,16 @@
|
||||
import { createContext, useContext } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { message } from 'antd'
|
||||
import { isElectrobunDesktop } from '../../../electrobun-bridge'
|
||||
|
||||
const MessageContext = createContext()
|
||||
|
||||
// antd's default message top is 8px; push messages down an extra 40px in the
|
||||
// desktop app so they clear the custom title bar / drag region.
|
||||
const MESSAGE_TOP = isElectrobunDesktop() ? 48 : undefined
|
||||
|
||||
export const MessageProvider = ({ children }) => {
|
||||
const [msgApi, contextHolder] = message.useMessage()
|
||||
const [msgApi, contextHolder] = message.useMessage({ top: MESSAGE_TOP })
|
||||
|
||||
const showMessage = (type, content, options = {}) => {
|
||||
return msgApi.open({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user