mirror of
https://github.com/zuiidea/antd-admin
synced 2026-11-12 20:24:27 +00:00
Added Prettierrc. Optimize the configuration file .umirc.js, and Added annotations. Replace eslint-plugin-umi to eslint-plugin-react-app as eslint bese plugin. And so on.
28 lines
712 B
JavaScript
28 lines
712 B
JavaScript
import React from 'react'
|
|
import PropTypes from 'prop-types'
|
|
import { ResponsiveContainer } from 'recharts'
|
|
import styles from './Container.less'
|
|
|
|
const Container = ({
|
|
children,
|
|
ratio = 5 / 2,
|
|
minHeight = 250,
|
|
maxHeight = 350,
|
|
}) => (
|
|
<div className={styles.container} style={{ minHeight, maxHeight }}>
|
|
<div style={{ marginTop: `${100 / ratio}%` || '100%' }} />
|
|
<div className={styles.content} style={{ minHeight, maxHeight }}>
|
|
<ResponsiveContainer>{children}</ResponsiveContainer>
|
|
</div>
|
|
</div>
|
|
)
|
|
|
|
Container.propTypes = {
|
|
children: PropTypes.element.isRequired,
|
|
ratio: PropTypes.number,
|
|
minHeight: PropTypes.number,
|
|
maxHeight: PropTypes.number,
|
|
}
|
|
|
|
export default Container
|