From 1ebd7755737895cf0735b4bbd4bdf728858fffae Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Fri, 17 Jul 2020 22:07:26 -0700 Subject: refactor decorators --- frontend/src/components/decorators/CharLimit.js | 10 ++++------ .../src/components/decorators/FloatingLabel.js | 22 ++++++++++------------ 2 files changed, 14 insertions(+), 18 deletions(-) (limited to 'frontend/src') diff --git a/frontend/src/components/decorators/CharLimit.js b/frontend/src/components/decorators/CharLimit.js index 623b378..5a6fdca 100644 --- a/frontend/src/components/decorators/CharLimit.js +++ b/frontend/src/components/decorators/CharLimit.js @@ -26,12 +26,10 @@ const Chars = styled.p` `}; `; -class CharLimit extends React.Component { - render() { - return ( - {this.props.maxLength - this.props.content.length}/{this.props.maxLength} - ); - } +const CharLimit = (props) => { + return ( + {props.maxLength - props.content.length}/{props.maxLength} + ); } export default CharLimit \ No newline at end of file diff --git a/frontend/src/components/decorators/FloatingLabel.js b/frontend/src/components/decorators/FloatingLabel.js index e1fc0ba..ef56b44 100644 --- a/frontend/src/components/decorators/FloatingLabel.js +++ b/frontend/src/components/decorators/FloatingLabel.js @@ -17,18 +17,16 @@ const StyledLabel = styled.label` `}; ` -class FloatingLabel extends React.Component { - render() { - return ( - - {this.props.label} - - ); - } +const FloatingLabel = (props) => { + return ( + + {props.label} + + ); } export default FloatingLabel \ No newline at end of file -- cgit v1.2.3