- Fix LineChart and allow the use of URLs - Add applyFullWidthDirective back - Fix favicon - Remove data_1.csv and data_2.csv in favour of data.csv - Remove vestiges of Vercel
22 lines
617 B
TypeScript
22 lines
617 B
TypeScript
export default function applyFullWidthDirective({
|
|
Component,
|
|
defaultWFull = true,
|
|
}) {
|
|
return (props) => {
|
|
const newProps = { ...props };
|
|
|
|
let newClassName = newProps.className || "";
|
|
if (newProps.fullWidth === true) {
|
|
newClassName += " w-[90vw] ml-[calc(50%-45vw)] max-w-none";
|
|
} else if (defaultWFull) {
|
|
// So that charts and tables will have the
|
|
// same width as the text content, but images
|
|
// can have its width set using the width prop
|
|
newClassName += " w-full";
|
|
}
|
|
newProps.className = newClassName;
|
|
|
|
return <Component {...newProps} />;
|
|
};
|
|
}
|