Improving Performance
This commit is contained in:
17
public/layout/BoxSizer.jsx
Normal file
17
public/layout/BoxSizer.jsx
Normal file
@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
|
||||
export default (props) => {
|
||||
let height = 100;/* Percentage of width */
|
||||
|
||||
//TODO: Add more methods of resizing this box.
|
||||
if(props.ratioWidth && props.ratioHeight) {
|
||||
height = 100 / props.ratioWidth * props.ratioHeight;
|
||||
}
|
||||
|
||||
//Box Sizer
|
||||
return (
|
||||
<div className="o-box-sizer" style={{
|
||||
paddingBottom: height + '%'
|
||||
}} />
|
||||
);
|
||||
};
|
Reference in New Issue
Block a user