Skip to content

Commit 72b4360

Browse files
mjk90terrylks
authored andcommitted
Fixed Drag & Drop code viewer responsive issue. Header now adjusts to smaller screen size. (#29)
1 parent 63b01ef commit 72b4360

1 file changed

Lines changed: 27 additions & 5 deletions

File tree

src/components/DragDropCodeViewer/DragDropCodeViewer.jsx

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,30 @@ const DivFlexStyled = styled.div`
4545
button{
4646
margin-top: -7px;
4747
}
48+
> :nth-child(1) {
49+
flex: 0.05 0 0;
50+
}
51+
> :nth-child(2) {
52+
flex: 0.7 0 0;
53+
margin-top: 2px;
54+
}
55+
> :nth-child(3) {
56+
flex: 0.2 0 0;
57+
max-width: 156px;
58+
}
59+
@media screen and (max-width: 1240px) {
60+
> :nth-child(1) {
61+
flex: 0.075 0 0;
62+
}
63+
> :nth-child(2) {
64+
flex: 0.625 0 0;
65+
}
66+
}
67+
@media screen and (max-width: 1200px) {
68+
> :nth-child(2) {
69+
margin-top: -7px;
70+
}
71+
}
4872
`
4973
const DragDropSVGStyled = styled(DragDropSVG)`
5074
width: 20px;
@@ -123,18 +147,16 @@ class DragDropCodeViewer extends Component {
123147
{
124148
this.state.value && this.state.value !== ""
125149
? <DivFlexStyled>
126-
<div className="text-center">
127-
<DragDropSVGStyled />&nbsp;&nbsp;
128-
<label>Drag & Drop files here or click browse to choose a file.</label>
129-
</div>
150+
<DragDropSVGStyled />
151+
<label>Drag &amp; Drop files here or click browse to choose a file.</label>
130152
<ButtonPrimary onClick={(e) => e.preventDefault()} >BROWSE</ButtonPrimary>
131153
</DivFlexStyled>
132154
: <div>
133155
<ImageDiv className="text-center">
134156
<DragDropSVG />
135157
</ImageDiv>
136158
<br />
137-
<p id="ddLabel" className="lead text-center">Drag & Drop files here or<br/> click browse to choose a file.</p>
159+
<p id="ddLabel" className="lead text-center">Drag &amp; Drop files here or<br/> click browse to choose a file.</p>
138160
<br />
139161
<p className="lead text-center browseButton">
140162
<ButtonPrimary onClick={(e) => e.preventDefault()} >BROWSE</ButtonPrimary>

0 commit comments

Comments
 (0)