|
|
@@ -1,13 +1,9 @@
|
|
|
-import React, { useMemo } from 'react';
|
|
|
+import React from 'react';
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
function ExpandOrContractButton(props) {
|
|
|
const { isWindowExpanded, contractWindow, expandWindow } = props;
|
|
|
|
|
|
- const getClassName = useMemo(() => {
|
|
|
- return isWindowExpanded ? 'icon-size-actual' : 'icon-size-fullscreen';
|
|
|
- }, [isWindowExpanded]);
|
|
|
-
|
|
|
const clickContractButtonHandler = () => {
|
|
|
if (contractWindow != null) {
|
|
|
contractWindow();
|
|
|
@@ -22,7 +18,7 @@ function ExpandOrContractButton(props) {
|
|
|
|
|
|
return (
|
|
|
<button type="button" className="close" onClick={isWindowExpanded ? clickContractButtonHandler : clickExpandButtonHandler}>
|
|
|
- <i className={getClassName} style={{ fontSize: '0.8em' }} aria-hidden="true"></i>
|
|
|
+ <i className={`${isWindowExpanded ? 'icon-size-actual' : 'icon-size-fullscreen'}`} style={{ fontSize: '0.8em' }} aria-hidden="true"></i>
|
|
|
</button>
|
|
|
);
|
|
|
}
|