From c73a0d7643ac335dbcdc64b90467ba7d3a45c4f4 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 8 Oct 2020 15:10:15 +0300 Subject: feat: add dashed borders to ImageInput --- src/components/AttachLink/AttachLink.tsx | 2 +- src/containers/PollCreation/ImageInput.tsx | 46 +++++++++++++++++++++++------- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/components/AttachLink/AttachLink.tsx b/src/components/AttachLink/AttachLink.tsx index 742ba65..7c32635 100644 --- a/src/components/AttachLink/AttachLink.tsx +++ b/src/components/AttachLink/AttachLink.tsx @@ -21,7 +21,7 @@ const AttachLink: React.FC = ({ callback, children }) => { color="primary" startIcon={} > - Attach a link + Link ); diff --git a/src/containers/PollCreation/ImageInput.tsx b/src/containers/PollCreation/ImageInput.tsx index e807865..181294e 100644 --- a/src/containers/PollCreation/ImageInput.tsx +++ b/src/containers/PollCreation/ImageInput.tsx @@ -17,13 +17,33 @@ interface PropTypes { progress?: number; } -const useStyles = makeStyles({ +const useStyles = makeStyles(theme => ({ root: { + width: '50%', + display: 'flex' + }, + mediaRoot: { + display: 'flex' + }, + uploadRoot: { + flex: 1, + display: 'flex', + [theme.breakpoints.up('md')]: { + padding: theme.spacing(4) + }, + [theme.breakpoints.down('sm')]: { + padding: theme.spacing(8, 1) + } + }, + outline: { + padding: theme.spacing(2), + flex: 1, + border: '2px dashed gray', + borderRadius: theme.spacing(1), display: 'flex', justifyContent: 'center', flexDirection: 'column', - alignItems: 'center', - width: '50%' + alignItems: 'center' }, clearIcon: { opacity: '.5', @@ -48,7 +68,7 @@ const useStyles = makeStyles({ icon: { color: 'white' } -}); +})); const ImageInput: React.FC = ({ callback, progress }) => { @@ -69,15 +89,17 @@ const ImageInput: React.FC = ({ callback, progress }) => { }; const Upload = ( -
- - or - +
+
+ + or + +
); const Media = ( - +
{ @@ -91,7 +113,11 @@ const ImageInput: React.FC = ({ callback, progress }) => { ); - return url ? Media : Upload; + return ( +
+ {url ? Media : Upload} +
+ ); }; export default ImageInput; -- cgit v1.2.3