diff options
| author | jackyzha0 <[email protected]> | 2020-05-15 22:11:13 -0700 |
|---|---|---|
| committer | jackyzha0 <[email protected]> | 2020-05-15 22:11:13 -0700 |
| commit | 0b37c8b715b8f5ebea4472c9e7d6104ca8adbdc8 (patch) | |
| tree | ab7fe8b5f50d2705fc3804562b66bc3dc773ef4b /frontend/src/components/PasteInfo.js | |
| parent | Merge pull request #25 from jackyzha0/security (diff) | |
| download | ctrl-v-0b37c8b715b8f5ebea4472c9e7d6104ca8adbdc8.tar.xz ctrl-v-0b37c8b715b8f5ebea4472c9e7d6104ca8adbdc8.zip | |
add view raw button
Diffstat (limited to 'frontend/src/components/PasteInfo.js')
| -rw-r--r-- | frontend/src/components/PasteInfo.js | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/frontend/src/components/PasteInfo.js b/frontend/src/components/PasteInfo.js index dabbb94..5217901 100644 --- a/frontend/src/components/PasteInfo.js +++ b/frontend/src/components/PasteInfo.js @@ -1,5 +1,6 @@ import React from 'react'; import styled from 'styled-components' +import { useHistory } from 'react-router-dom'; import { LangInput, ThemeInput } from './Inputs' const Bold = styled.span` @@ -7,10 +8,17 @@ const Bold = styled.span` ` const StyledDiv = styled.div` - margin: 2em 0; display: inline-block; ` +const Button = styled.button` + margin-left: 0 !important; +` + +const ButtonRow = styled.div` + display: inline; +` + const Flex = styled.div` float: right; display: flex; @@ -19,6 +27,12 @@ const Flex = styled.div` ` const PasteInfo = (props) => { + const history = useHistory(); + const redir = () => { + const redirUrl = `/raw/${props.hash}` + history.push(redirUrl); + } + return ( <div> <Flex> @@ -32,6 +46,15 @@ const PasteInfo = (props) => { id="themeInput" /> </Flex> <StyledDiv> + <ButtonRow> + <Button + className="lt-shadow lt-hover" + type="button" + onClick={redir} + > + view raw + </Button> + </ButtonRow> <Bold>expires: </Bold>{props.expiry} </StyledDiv> </div> |