diff options
| author | jackyzha0 <[email protected]> | 2021-03-06 16:18:50 -0800 |
|---|---|---|
| committer | jackyzha0 <[email protected]> | 2021-03-06 16:18:50 -0800 |
| commit | 9aab99beea5af56f2329eb6de421617994435354 (patch) | |
| tree | bbdd7fb4957f9c0112e841cacbc68902716c1310 /frontend | |
| parent | update watermark styling (diff) | |
| download | ctrl-v-9aab99beea5af56f2329eb6de421617994435354.tar.xz ctrl-v-9aab99beea5af56f2329eb6de421617994435354.zip | |
paste modal fixes
Diffstat (limited to 'frontend')
| -rw-r--r-- | frontend/src/components/Form/Button.js | 1 | ||||
| -rw-r--r-- | frontend/src/components/modals/PasswordModal.js | 26 | ||||
| -rw-r--r-- | frontend/src/components/modals/PasteModal.js | 47 | ||||
| -rw-r--r-- | frontend/src/components/modals/shared.js | 11 |
4 files changed, 35 insertions, 50 deletions
diff --git a/frontend/src/components/Form/Button.js b/frontend/src/components/Form/Button.js index 146919a..290e52a 100644 --- a/frontend/src/components/Form/Button.js +++ b/frontend/src/components/Form/Button.js @@ -6,6 +6,7 @@ const Base = css` ${Rounded} ${ButtonLike} margin-right: 2em; + cursor: pointer; ` const Primary = css` diff --git a/frontend/src/components/modals/PasswordModal.js b/frontend/src/components/modals/PasswordModal.js index 637e20a..64e984b 100644 --- a/frontend/src/components/modals/PasswordModal.js +++ b/frontend/src/components/modals/PasswordModal.js @@ -1,7 +1,7 @@ import React, { useRef } from 'react'; import Modal from 'react-modal'; import { Password } from '../Inputs' -import {RightPad, LeftPad, ModalHeader, Padding, modalStyles} from './shared' +import {RightPad, LeftPad, ModalHeader, Padding, modalStyles, Form} from './shared' import Error from '../Err'; const PasswordModal = (props) => { @@ -20,21 +20,15 @@ const PasswordModal = (props) => { style={modalStyles} contentLabel="enter paste password" > - <form onSubmit={submitPassword}> - <LeftPad> - <ModalHeader><span role="img" aria-label="warning">🚧 </span>err: password protected</ModalHeader> - </LeftPad> - <RightPad> - <Password - value={props.value} - onChange={props.onChange} /> - </RightPad> - <LeftPad> - <input className="lt-button lt-shadow lt-hover" type="submit" value="continue" /> - <Padding /> - <Error ref={ErrorLabel} /> - </LeftPad> - </form> + <Form onSubmit={submitPassword}> + <ModalHeader><span role="img" aria-label="warning">🚧 </span>err: password protected</ModalHeader> + <Password + value={props.value} + onChange={props.onChange} /> + <input className="lt-button lt-shadow lt-hover" type="submit" value="continue" /> + <Padding /> + <Error ref={ErrorLabel} /> + </Form> </Modal> ); } diff --git a/frontend/src/components/modals/PasteModal.js b/frontend/src/components/modals/PasteModal.js index ff2e639..a6d637f 100644 --- a/frontend/src/components/modals/PasteModal.js +++ b/frontend/src/components/modals/PasteModal.js @@ -1,6 +1,6 @@ import React from 'react'; import Modal from 'react-modal'; -import {LeftPad, ModalHeader, modalStyles, RightPad} from './shared' +import {Form, LeftPad, ModalHeader, modalStyles, RightPad} from './shared' import { useHistory } from 'react-router-dom'; import { Text } from '../Inputs' import { useClipboard } from 'use-clipboard-copy'; @@ -24,30 +24,27 @@ const PasteModal = (props) => { style={modalStyles} contentLabel="paste created" > - <form onSubmit={redir}> - <LeftPad> - <ModalHeader><span role="img" aria-label="success">📎 </span>paste created</ModalHeader> - </LeftPad> - <RightPad> - <Text - type="text" - value={fullURL} - readOnly - ref={clipboard.target} /> - </RightPad> - <LeftPad> - <Button - type="submit"> - view - </Button> - <Button - secondary - type="button" - onClick={clipboard.copy}> - {clipboard.copied ? 'copied' : 'copy url'} - </Button> - </LeftPad> - </form> + <Form onSubmit={redir}> + <ModalHeader> + <span role="img" aria-label="success">📎 </span>paste created + </ModalHeader> + <Text + label="url" + type="text" + value={fullURL} + readOnly + ref={clipboard.target} /> + <Button + type="submit"> + go to paste + </Button> + <Button + secondary + type="button" + onClick={clipboard.copy}> + {clipboard.copied ? 'copied' : 'copy url'} + </Button> + </Form> </Modal> ); } diff --git a/frontend/src/components/modals/shared.js b/frontend/src/components/modals/shared.js index 7c38dc2..0336818 100644 --- a/frontend/src/components/modals/shared.js +++ b/frontend/src/components/modals/shared.js @@ -12,15 +12,8 @@ export const modalStyles = { }; export const Form = styled.form` - z-index: 999; -` - -export const RightPad = styled.div` - margin-right: 3em; -` - -export const LeftPad = styled.div` - margin-left: 2em; + margin: 2em; + margin-right: 3em; ` export const ModalHeader = styled.h3` |