From bf8a64c29b42a062287f1da8e8494158fc4c23b4 Mon Sep 17 00:00:00 2001 From: Abhishek Jakhar Date: Fri, 30 Oct 2020 19:54:43 +0530 Subject: [PATCH] chore: remove GridBlockWithButton component from microsite (#3179) --- microsite/core/GridBlockWithButton.js | 100 -------------------------- 1 file changed, 100 deletions(-) delete mode 100644 microsite/core/GridBlockWithButton.js diff --git a/microsite/core/GridBlockWithButton.js b/microsite/core/GridBlockWithButton.js deleted file mode 100644 index 0f77a6a148..0000000000 --- a/microsite/core/GridBlockWithButton.js +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright (c) 2017-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -const React = require('react'); -const classNames = require('classnames'); - -const CompLibrary = require(`${process.cwd()}/node_modules/docusaurus/lib/core/CompLibrary.js`); -const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */ - -class GridBlockWithButton extends React.Component { - renderBlock(origBlock) { - const blockDefaults = { - imageAlign: 'left', - }; - - const block = { - ...blockDefaults, - ...origBlock, - }; - - const blockClasses = classNames('blockElement', this.props.className, { - alignCenter: this.props.align === 'center', - alignRight: this.props.align === 'right', - fourByGridBlock: this.props.layout === 'fourColumn', - imageAlignSide: - block.image && - (block.imageAlign === 'left' || block.imageAlign === 'right'), - imageAlignTop: block.image && block.imageAlign === 'top', - imageAlignRight: block.image && block.imageAlign === 'right', - imageAlignBottom: block.image && block.imageAlign === 'bottom', - imageAlignLeft: block.image && block.imageAlign === 'left', - threeByGridBlock: this.props.layout === 'threeColumn', - twoByGridBlock: this.props.layout === 'twoColumn', - }); - - const topLeftImage = - (block.imageAlign === 'top' || block.imageAlign === 'left') && - this.renderBlockImage(block.image, block.imageLink, block.imageAlt); - - const bottomRightImage = - (block.imageAlign === 'bottom' || block.imageAlign === 'right') && - this.renderBlockImage(block.image, block.imageLink, block.imageAlt); - - return ( -
- {topLeftImage} -
- {this.renderBlockTitle(block.title)} - {block.content} -
- - {block.buttonContent} - -
-
- {bottomRightImage} -
- ); - } - - renderBlockImage(image) { - if (!image) { - return null; - } - - return
{image}
; - } - - renderBlockTitle(title) { - if (!title) { - return null; - } - - return ( -

- {title} -

- ); - } - - render() { - return ( -
- {this.props.contents.map(this.renderBlock, this)} -
- ); - } -} - -GridBlockWithButton.defaultProps = { - align: 'left', - contents: [], - layout: 'twoColumn', -}; - -module.exports = GridBlockWithButton;