diff options
| author | jackyzha0 <[email protected]> | 2020-05-11 21:11:16 -0700 |
|---|---|---|
| committer | jackyzha0 <[email protected]> | 2020-05-11 21:11:16 -0700 |
| commit | 433466a3947e75a36b811795bc21be1fff10b5e8 (patch) | |
| tree | 9e42dad77e7b8bdb3eefbbcfdc3eb7fa90817344 /frontend/src/components/CharLimit.js | |
| parent | add basic link + route (diff) | |
| download | ctrl-v-433466a3947e75a36b811795bc21be1fff10b5e8.tar.xz ctrl-v-433466a3947e75a36b811795bc21be1fff10b5e8.zip | |
backend redir
Diffstat (limited to 'frontend/src/components/CharLimit.js')
| -rw-r--r-- | frontend/src/components/CharLimit.js | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/frontend/src/components/CharLimit.js b/frontend/src/components/CharLimit.js deleted file mode 100644 index 623b378..0000000 --- a/frontend/src/components/CharLimit.js +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react'; -import styled, { css } from 'styled-components' - -// show char limit if length > half of max -const Chars = styled.p` - color: #11111100; - font-family: 'Roboto Mono', monospace; - position: absolute; - font-size: 0.8em; - writing-mode: vertical-rl; - top: 50%; - transform: translate(5em, -50%); - right: 0; - transition: all 0.5s cubic-bezier(.25,.8,.25,1); - - ${props => - ((props.content.length / props.maxLength) > 0.5) && - css` - color: #111111; - `}; - - ${props => - ((props.content.length / props.maxLength) > 1) && - css` - color: #ee1111; - `}; -`; - -class CharLimit extends React.Component { - render() { - return ( - <Chars {...this.props} >{this.props.maxLength - this.props.content.length}/{this.props.maxLength}</Chars> - ); - } -} - -export default CharLimit
\ No newline at end of file |