wix-style-react
Version:
wix-style-react
16 lines (13 loc) • 474 B
JavaScript
import { proportionDriverFactory as publicDriverFactory } from './Proportion.driver';
export const proportionPrivateDriverFactory = base => {
return {
...publicDriverFactory(base),
// Add here driver methods that considered "private"
/** Get the component's aspect ratio */
getAspectRatio: async () => {
const width = await base.attr('offsetWidth');
const height = await base.attr('offsetHeight');
return width / height;
},
};
};