Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit cfa33d1

Browse files
committed
fix image layout
1 parent ad8e563 commit cfa33d1

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

src/pages/trade-types/margin/_policies.js

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import styled from 'styled-components'
2+
import styled, { css } from 'styled-components'
33
import { graphql, useStaticQuery } from 'gatsby'
44
import { SmallContainer, Ul } from '../components/_style'
55
import { SectionContainer, Show } from 'components/containers'
@@ -19,30 +19,22 @@ query {
1919
}
2020
`
2121

22-
const ShowWrapper = styled.div`
23-
width:100%;
22+
const container_style = css`
23+
flex: 1;
24+
width: 100%;
2425
`
2526

26-
const ExampleImage = styled(QueryImage)`
27-
margin:${(props) => (props.center ? '0 auto' : 'unset')};
28-
width: 792px;
29-
height: 453px;
30-
31-
@media ${device.laptop}{
32-
width: 630px;
33-
height: 361px;
34-
}
35-
36-
@media ${device.tabletL}{
37-
width:328px;
38-
height:506px;
39-
}
27+
const Desktop = styled(Show.Desktop)`
28+
${container_style}
29+
`
4030

41-
@media ${device.mobileM}{
42-
width:289px;
43-
height:454px;
44-
}
31+
const Mobile = styled(Show.Mobile)`
32+
${container_style}
33+
`
34+
const ImageWrapper = styled.div`
35+
width: 100%;
4536
`
37+
4638
const StyledLinkButton = styled(LinkButton)`
4739
padding: 1.2rem 1.5rem;
4840
font-size: 14px;
@@ -167,14 +159,24 @@ const Policies = () => {
167159
"Your trade will automatically close at 8,100, which is the nearest applicable market price to your stop loss level.",
168160
)}
169161
</Text>
170-
<Show.Desktop>
171-
<ExampleImage data={data['example']} />
172-
</Show.Desktop>
173-
<ShowWrapper>
174-
<Show.Mobile width="100%">
175-
<ExampleImage data={data['example_mobile']} />
176-
</Show.Mobile>
177-
</ShowWrapper>
162+
163+
<Desktop max_width={'tabletS'}>
164+
<ImageWrapper>
165+
<QueryImage
166+
data={data['example']}
167+
alt="Trade types Stop/Loss"
168+
/>
169+
</ImageWrapper>
170+
</Desktop>
171+
172+
<Mobile min_width={'tabletS'}>
173+
<ImageWrapper>
174+
<QueryImage
175+
data={data['example_mobile']}
176+
alt="Trade types Stop/Loss"
177+
/>
178+
</ImageWrapper>
179+
</Mobile>
178180

179181
<Text size="var(--text-size-m)" weight="bold" mb="0.8rem" mt="2.4rem">
180182
{localize('Margin call')}

0 commit comments

Comments
 (0)