Skip to content

Commit 4fe926e

Browse files
committed
move item preview to bottom of new item form
1 parent c45b6e3 commit 4fe926e

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

src/components/AddItemPage/NewItemForm.jsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ const Wrapper = styled.div`
2323
margin-top: 2%;
2424
align-items: center;
2525
justify-content: center;
26-
flex-direction: row;
27-
28-
@media (max-width: 1600px) {
29-
flex-direction: column;
30-
}
26+
flex-direction: column;
3127
`;
3228

3329
const RowWrapper = styled.div`
@@ -59,11 +55,7 @@ const ItemPreviewWrapper = styled.div`
5955
align-items: center;
6056
display: flex;
6157
flex-direction: column;
62-
width: 60%;
63-
64-
@media (max-width: 1600px) {
65-
width: 100%;
66-
}
58+
width: 100%;
6759
`;
6860

6961
const Input = styled.input`
@@ -628,7 +620,7 @@ const NewItemForm = (props) => {
628620
</FormWrapper>
629621

630622
<ItemPreviewWrapper>
631-
<ItemPreview item={newItem} editPage={true} />
623+
<ItemPreview item={newItem} />
632624
</ItemPreviewWrapper>
633625
</Wrapper>
634626
);

src/components/ItemPage/ItemPreview.jsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,10 @@ const Wrapper = styled.div`
3131
align-items: flex-start;
3232
margin-top: 50px;
3333
justify-content: flex-start;
34+
width: 100%;
3435
@media (max-width: 768px) {
3536
flex-direction: column;
3637
}
37-
38-
${({ editPage }) =>
39-
editPage &&
40-
`
41-
justify-content: space-around;
42-
`}
4338
`;
4439

4540
const PreviewWrapper = styled.div`
@@ -199,7 +194,7 @@ const CarouselImage = styled.img`
199194
height: auto;
200195
`;
201196

202-
const ItemPreview = ({ item, setItem, editPage }) => {
197+
const ItemPreview = ({ item, setItem }) => {
203198
const [isMobile, setIsMobile] = useState(window.innerWidth < 700);
204199
useWindowResize((event: React.SyntheticEvent) => {
205200
setIsMobile(window.innerWidth < 728);
@@ -319,7 +314,7 @@ const ItemPreview = ({ item, setItem, editPage }) => {
319314
};
320315

321316
return (
322-
<Wrapper editPage={editPage}>
317+
<Wrapper>
323318
<Helmet>
324319
<title>{item.name} - JAMBO</title>
325320
</Helmet>

0 commit comments

Comments
 (0)