feat(constants): create and use modal width const

This commit is contained in:
RadoslavDimchev 2024-04-16 11:14:31 +03:00 committed by Radoslav Dimchev
parent 46368accfb
commit 91942d25b6
4 changed files with 7 additions and 4 deletions

View File

@ -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',

View File

@ -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

View File

@ -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 (
<>

View File

@ -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)