mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-08 09:34:40 +00:00
feat(constants): create and use modal width const
This commit is contained in:
parent
46368accfb
commit
91942d25b6
@ -256,6 +256,7 @@ export const VALIDATORS_DATA = [
|
||||
// Manage Validator
|
||||
export const VALIDATOR_SETTINGS_CARDS_TITLES = ['Exit', 'Migrate', 'Advanced']
|
||||
export const VALIDATOR_SETTING_ADVANCED_OPTIONS = ['Deposit']
|
||||
export const MODAL_WIDTH = 1160
|
||||
|
||||
export const MANAGE_VALIDATOR_TABS = [
|
||||
'Overview',
|
||||
|
@ -11,11 +11,12 @@ import ValidatorDataTabs from './ManageValidatorTable/ValidatorDataTabs'
|
||||
import ValidatorBlueSection from './ValidatorBlueSection/ValidatorBlueSection'
|
||||
import Footer from './PageParts/Footer'
|
||||
import { useWindowSize } from '../../../hooks/useWindowSize'
|
||||
import { MODAL_WIDTH } from '../../../constants'
|
||||
|
||||
const LeftManage = () => {
|
||||
const [isVisibleWarning, setIsVisibleWarning] = useState(true)
|
||||
const { width } = useWindowSize()
|
||||
const isModalWidth = width < 1160
|
||||
const isModalWidth = width < MODAL_WIDTH
|
||||
|
||||
return (
|
||||
<YStack
|
||||
|
@ -3,10 +3,11 @@ import { YStack } from 'tamagui'
|
||||
|
||||
import Icon from '../../../components/General/Icon'
|
||||
import { useWindowSize } from '../../../hooks/useWindowSize'
|
||||
import { MODAL_WIDTH } from '../../../constants'
|
||||
|
||||
const DefaultPanel = () => {
|
||||
const { width } = useWindowSize()
|
||||
const isModalWidth = width < 1160
|
||||
const isModalWidth = width < MODAL_WIDTH
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -2,7 +2,7 @@ import { useState } from 'react'
|
||||
import Modal from 'react-modal'
|
||||
import { useNavigate, useParams } from 'react-router-dom'
|
||||
|
||||
import { PATHS } from '../../../constants'
|
||||
import { MODAL_WIDTH, PATHS } from '../../../constants'
|
||||
import { useWindowSize } from '../../../hooks/useWindowSize'
|
||||
import PanelContent from './PanelContent'
|
||||
|
||||
@ -16,7 +16,7 @@ const PanelWrapper = ({ children, title }: PanelWrapperProps) => {
|
||||
const navigate = useNavigate()
|
||||
const { validatorName } = useParams()
|
||||
const { width } = useWindowSize()
|
||||
const isModalWidth = width < 1160
|
||||
const isModalWidth = width < MODAL_WIDTH
|
||||
|
||||
const closeModal = () => {
|
||||
setIsModalOpen(false)
|
||||
|
Loading…
x
Reference in New Issue
Block a user