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.

yashim+khalid+nuri/feat: new homepage #2265

Merged
merged 196 commits into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
196 commits
Select commit Hold shift + click to select a range
2a30806
chore: cleanup old unused components
yashim-deriv Nov 23, 2021
08fa59a
fix: updated current components
yashim-deriv Nov 23, 2021
2f3acae
fix: current component design
yashim-deriv Nov 23, 2021
311464b
cleanup
yashim-deriv Nov 24, 2021
288c3ce
chore: cleanup and add images
yashim-deriv Nov 25, 2021
a74ac35
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
yashim-deriv Nov 26, 2021
9259a84
feat: update codebase to typescript. added slideshow
yashim-deriv Nov 26, 2021
4a27a95
fix: image cycling
yashimwong Nov 28, 2021
c225850
refactor: made certain component generic
yashim-deriv Nov 29, 2021
c3c1d41
feat: initial commit markets fold
yashim-deriv Nov 30, 2021
949192e
feat: updated markets fold design
yashim-deriv Nov 30, 2021
1f043e7
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
yashim-deriv Dec 1, 2021
6a55727
refactor: navbar performance optimization
yashim-deriv Dec 1, 2021
386b7d4
added trade type section
njazuli-deriv Dec 1, 2021
7073c8b
change the opacity for learn more btn- trade type
njazuli-deriv Dec 1, 2021
63bade5
working on markets section
njazuli-deriv Dec 1, 2021
2b52475
fixed styling for market and trade type section
njazuli-deriv Dec 3, 2021
56e6c65
fix: types
yashim-deriv Dec 3, 2021
7725d1e
fix: seo
yashimwong Dec 4, 2021
acbc338
fix: SEO + types
yashim-deriv Dec 6, 2021
9258c97
fix: SEO
yashim-deriv Dec 6, 2021
a52c168
fix: seo
yashim-deriv Dec 6, 2021
3644ec4
fix: SEO
yashim-deriv Dec 6, 2021
a12dc5c
fix: further SEO fixes
yashim-deriv Dec 6, 2021
9f99205
refactor market section
njazuli-deriv Dec 7, 2021
8774364
Merge branch 'new_homepage' of github.com:yashim-deriv/deriv-com into…
njazuli-deriv Dec 7, 2021
3a91f77
refactor hero banner section
njazuli-deriv Dec 7, 2021
7efa4de
fix: trade types link text
yashim-deriv Dec 7, 2021
1ab2aa6
added trimSnaps
njazuli-deriv Dec 7, 2021
113bf07
rstyling refactor for testimonial section
njazuli-deriv Dec 9, 2021
d063f51
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
yashim-deriv Dec 10, 2021
8d1f1f0
refactor: performance improvements
yashim-deriv Dec 10, 2021
f659c2b
fix: remove debounce
yashim-deriv Dec 10, 2021
50e0db1
fix: add eager loading to images on top fold
yashim-deriv Dec 10, 2021
869aa92
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
yashim-deriv Dec 14, 2021
a9a36b7
added platform section (#1)
khalid-deriv Dec 14, 2021
9b38adc
fix: ammended code review
yashim-deriv Dec 15, 2021
60baefb
ammended code review comments
yashim-deriv Dec 15, 2021
1acbff6
fix: suggestions from code review
yashim-deriv Dec 15, 2021
886251b
kinda responsive carousel with broken desktop image size
khalid-deriv Dec 15, 2021
a99b61c
fix responsiveness issues
khalid-deriv Dec 16, 2021
4b8612b
Merge branch 'master' into new_homepage
khalid-deriv Dec 16, 2021
c8f85b9
Merge pull request #2 from khalid-deriv/platform-carousels
khalid-deriv Dec 16, 2021
f211f7b
mobile carousel and more responsiveness fixes
khalid-deriv Dec 16, 2021
0cfcd66
more fixes
khalid-deriv Dec 17, 2021
d83af80
Merge pull request #3 from khalid-deriv/platform-carousels
khalid-deriv Dec 17, 2021
92209ad
carousel css type
khalid-deriv Dec 17, 2021
cdfcc22
css till death do us part
khalid-deriv Dec 21, 2021
8c808a8
unhealthy css perfectionism
khalid-deriv Dec 21, 2021
a032336
screw rem, using px instead
khalid-deriv Dec 21, 2021
4d59105
Merge pull request #4 from khalid-deriv/platform-carousels
khalid-deriv Dec 21, 2021
63b91a4
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
yashim-deriv Dec 21, 2021
357fa08
fix: add suggestions from code review
yashim-deriv Dec 21, 2021
03d877e
review fixes
khalid-deriv Dec 21, 2021
ef6cde4
Merge pull request #5 from khalid-deriv/platform-carousels
khalid-deriv Dec 21, 2021
e8eb2c8
refactor: code reviews
yashim-deriv Dec 22, 2021
3ca530a
unset for the win
khalid-deriv Dec 22, 2021
7772cfb
Merge pull request #6 from khalid-deriv/platform-carousels
khalid-deriv Dec 22, 2021
2f1cd32
chore: compress images
yashim-deriv Dec 22, 2021
5b1e8d3
fix: transparent nav
yashim-deriv Dec 22, 2021
ac461ba
fix the testimonial icon and the transition for trade type section
njazuli-deriv Dec 22, 2021
af47f2c
Merge branch 'new_homepage' of github.com:yashim-deriv/deriv-com into…
yashim-deriv Dec 22, 2021
d4d7904
fix: hero text
yashim-deriv Dec 23, 2021
bf87cdd
fix: learn more link
yashim-deriv Dec 23, 2021
0793d3a
fix: number of trade types
yashim-deriv Dec 23, 2021
676d3c0
fix: copyright footer
yashim-deriv Dec 23, 2021
41ba701
fix: platform ordering
yashim-deriv Dec 23, 2021
8be4296
fix: let gatsby generate breakpoints automatically
yashim-deriv Dec 24, 2021
4eb859e
feat: add delay before starting animation
yashim-deriv Dec 24, 2021
0d90fb2
fix: add lazy load
yashim-deriv Dec 24, 2021
41745fd
fixed order
khalid-deriv Dec 24, 2021
405aab2
platfomrs alignment
khalid-deriv Dec 24, 2021
d60693b
fixed download link and footer alignment, fixed urls
khalid-deriv Dec 24, 2021
786e5a6
Merge pull request #7 from khalid-deriv/platform-carousels
khalid-deriv Dec 24, 2021
9d83a0c
lazyload and apk link removal
khalid-deriv Dec 24, 2021
a5a9683
Merge pull request #8 from khalid-deriv/platform-carousels
khalid-deriv Dec 24, 2021
b264085
Merge branch 'master' into new_homepage
khalid-deriv Dec 27, 2021
7bcb425
deriv and x need space apart
khalid-deriv Dec 28, 2021
388e75d
fix: learn more spacing
yashim-deriv Dec 29, 2021
e48df5c
fix: download link ordering
yashim-deriv Dec 29, 2021
5a66132
fix: height
yashim-deriv Dec 29, 2021
b292099
deriv mt5
khalid-deriv Dec 29, 2021
e314be0
Merge pull request #9 from khalid-deriv/platform-carousels
khalid-deriv Dec 29, 2021
3b26c52
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
yashim-deriv Dec 29, 2021
625ca5d
fix: improve slideshow rendering
yashim-deriv Dec 29, 2021
d5aaab7
fix: optimise for mobile
yashim-deriv Dec 29, 2021
0faf8e0
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
yashim-deriv Dec 29, 2021
c582de7
fix: reverted mobile optimisation
yashim-deriv Dec 29, 2021
45e9705
fix: image height
yashim-deriv Dec 29, 2021
465e4ef
fix: platforms height
yashim-deriv Dec 29, 2021
43f3789
fix: add placeholder
yashim-deriv Dec 29, 2021
4ed16da
improve scores
yashim-deriv Dec 29, 2021
09d1239
fix: LCP for slideshow
yashimwong Dec 30, 2021
e6bdff2
fix: add preconnect + breakpoints
yashimwong Dec 30, 2021
085ea86
fix: refactor + optimisations
yashim-deriv Dec 31, 2021
b088ed8
fix: optimise slideshow loading
yashim-deriv Dec 31, 2021
f6c6a35
fix: nav transition bg
yashim-deriv Dec 31, 2021
36f027e
fix: optimisation + delay first slide change for LCP
yashim-deriv Dec 31, 2021
c31e0f4
fix: lazy loaded trade types
yashim-deriv Dec 31, 2021
677af69
fix: image
yashim-deriv Dec 31, 2021
0bdf490
fix: height
yashim-deriv Dec 31, 2021
828aa3d
fix: timeout
yashim-deriv Dec 31, 2021
78eb421
fix: image max width
yashim-deriv Dec 31, 2021
d7076e2
fix: breakpoints declaration
yashim-deriv Dec 31, 2021
a24071a
fix: image size
yashim-deriv Dec 31, 2021
d0b71eb
fix: add eager loading
yashimwong Dec 31, 2021
8dc9744
feat: add link to markets
yashim-deriv Jan 3, 2022
d4cfcb0
fix: update bot url
yashim-deriv Jan 3, 2022
7a64af1
fix: description height
yashim-deriv Jan 3, 2022
b02f39a
fix: LCP by removing fadein during eager loading
yashim-deriv Jan 5, 2022
60a54cb
fix: cut-off image for safari browser
yashim-deriv Jan 5, 2022
c92a4c2
fix: dot
yashim-deriv Jan 5, 2022
105e905
fix: based on new design
yashim-deriv Jan 5, 2022
a1c0d32
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
yashim-deriv Jan 6, 2022
ae53e20
fix: platform height, image
yashim-deriv Jan 6, 2022
a04f042
fix: QA fixes
yashim-deriv Jan 6, 2022
ca5237b
fix: performance issues
yashim-deriv Jan 6, 2022
816ac2b
fix: images
yashim-deriv Jan 6, 2022
461408f
fix flickering text issue
khalid-deriv Jan 6, 2022
37122bf
Merge pull request #10 from khalid-deriv/platform-carousels
khalid-deriv Jan 6, 2022
776f7b3
fix: binary bot image
yashim-deriv Jan 7, 2022
89f683a
fix: external arrow on our own platform
yashim-deriv Jan 7, 2022
bec24a6
fix: smarttrader link
yashim-deriv Jan 7, 2022
de8d8cb
minor refactor
yashim-deriv Jan 9, 2022
714b6ce
fix: copy changes
yashim-deriv Jan 10, 2022
72760cc
fix: loading
yashim-deriv Jan 10, 2022
5aa4eae
fix: text
yashim-deriv Jan 10, 2022
396a4f5
fix: images and text
yashim-deriv Jan 10, 2022
a0707da
fix: text and add autoplay
yashim-deriv Jan 10, 2022
089ed1c
fix: text
yashim-deriv Jan 10, 2022
ba58d68
fix: QA issues
yashim-deriv Jan 10, 2022
938bfac
fix: transition
yashim-deriv Jan 10, 2022
e0b76cf
changes on slide show and trade types animation
njazuli-deriv Jan 10, 2022
d118954
refactor: cleanup and smoothen animation
yashimwong Jan 10, 2022
eefa9da
localization and rsponsiveness
khalid-deriv Jan 11, 2022
8d1f126
Merge pull request #11 from khalid-deriv/platform-carousels
khalid-deriv Jan 11, 2022
b1942a5
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
yashim-deriv Jan 12, 2022
9b5420d
send help
yashim-deriv Jan 12, 2022
bb200b4
refactor: convert to typescript because i need to set good example
yashimwong Jan 12, 2022
5f28916
refactor: typescript
yashim-deriv Jan 13, 2022
73983b5
fix: default value warnings
yashim-deriv Jan 13, 2022
ee110df
refactor: typescript
yashim-deriv Jan 13, 2022
b0ca783
feat: add new platforms
yashim-deriv Jan 13, 2022
8d3c835
changed image to 2x and changed text for Deriv X platform
njazuli-deriv Jan 14, 2022
e2d2c6b
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
yashim-deriv Jan 14, 2022
806e665
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
yashim-deriv Jan 14, 2022
4d85234
fix: everything
yashimwong Jan 16, 2022
c36e48c
redeploy
yashimwong Jan 16, 2022
92e474c
fix: behaviour scroll
yashimwong Jan 16, 2022
9fd8b2f
minor fixes
yashimwong Jan 16, 2022
55ab050
fix: bugs
yashimwong Jan 16, 2022
0b653b6
Merge branch 'master' of github.com:binary-com/deriv-com into new_hom…
yashimwong Jan 17, 2022
9085a70
fix pre egg
yashimwong Jan 17, 2022
15c1189
fixed out platform wheel carousel
njazuli-deriv Jan 17, 2022
9ac09b7
fixed the opacity issue for trade type items
njazuli-deriv Jan 17, 2022
05cdd4e
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
yashim-deriv Jan 19, 2022
69b090c
fixed market carousel
njazuli-deriv Jan 20, 2022
d65029c
fixed gap on market carousel for mobile
njazuli-deriv Jan 20, 2022
ed409f6
fixed nav conflict
njazuli-deriv Jan 20, 2022
74dbc12
revert nav conflict
njazuli-deriv Jan 20, 2022
5ec9d0f
fixed carousel issue
njazuli-deriv Jan 20, 2022
db908f8
set align for market carousel
njazuli-deriv Jan 20, 2022
0675c06
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
yashim-deriv Jan 20, 2022
6bb322c
fix: file names
yashim-deriv Jan 20, 2022
142ae70
fix: broken learn more button
seanho96 Jan 20, 2022
bc5a687
fix: spacing
yashim-deriv Jan 20, 2022
267d9e4
Merge branch 'new_homepage' of github.com:yashim-deriv/deriv-com into…
seanho96 Jan 20, 2022
422617e
style: center link for mobile
seanho96 Jan 21, 2022
b1a240a
fix: code smells
seanho96 Jan 21, 2022
fa6aec7
chore: add type definition
seanho96 Jan 21, 2022
26ed7ca
fix: spacing to descr
yashim-deriv Jan 21, 2022
fefd157
fix: remove trade type padding
yashimwong Jan 21, 2022
ce39168
Merge branch 'master' of github.com:binary-com/deriv-com into new_hom…
yashimwong Jan 21, 2022
e29021e
fix: make carousel smooth
yashimwong Jan 23, 2022
15324eb
fix: unused imports
yashim-deriv Jan 24, 2022
88d4d9d
fix: spacing and add no slide to carousel
yashim-deriv Jan 24, 2022
6d1ef68
fix: wtf
yashim-deriv Jan 24, 2022
e5b1cc9
Redeploy
yashim-deriv Jan 24, 2022
85595be
fix: navigation_css
yashim-deriv Jan 24, 2022
37fcc3d
fix: spacing
yashim-deriv Jan 24, 2022
1a81020
fix: mobile links
yashim-deriv Jan 24, 2022
0d9e2bc
Redeploy
yashim-deriv Jan 24, 2022
55b47fc
fixed the onclick markeet items in mobile
njazuli-deriv Jan 24, 2022
c6bd7e4
fix: platform carousel
yashim-deriv Jan 24, 2022
3637728
fix: spacing
yashim-deriv Jan 24, 2022
e4718ac
fix: minor fixes
yashimwong Jan 24, 2022
21b1d90
fix: id increment
yashim-deriv Jan 25, 2022
c314ec2
revert: script loading changes
yashim-deriv Jan 25, 2022
dfa0044
fix: code smell
seanho96 Jan 25, 2022
4b29429
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
yashim-deriv Jan 26, 2022
93ef095
fix: QA reported bugs
yashim-deriv Jan 26, 2022
3836cf7
fix: code smells
yashim-deriv Jan 26, 2022
d139519
fix: order
yashim-deriv Jan 26, 2022
229917d
fix: hero image sizing
yashim-deriv Jan 26, 2022
b7f0f97
fix: carousel spacing
yashim-deriv Jan 26, 2022
1da82a2
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
yashim-deriv Jan 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ module.exports = {
options: {
failOnError: true,
base64Width: 20,
forceBase64Format: 'webp',
stripMetadata: true,
defaultQuality: 50,
},
Expand Down
22 changes: 22 additions & 0 deletions src/components/containers/wrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import styled from 'styled-components'
import device from 'themes/device'

type WrapperProps = {
media?: string
}

export const DesktopWrapper = styled.div<WrapperProps>`
display: block;

@media ${(props) => props.media || device.tabletL} {
display: none;
}
`

export const MobileWrapper = styled.div<WrapperProps>`
display: none;

@media ${(props) => props.media || device.tabletL} {
display: block;
}
`
9 changes: 4 additions & 5 deletions src/components/custom/_signup-public.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ const StyledSectionContainer = styled(Box).attrs({ as: 'section' })`
background-color: var(--color-white);

@media ${device.tabletL} {
padding: 41px 0 40px;
padding: 0 0 40px;
}
`
const Wrapper = styled.div`
border-radius: 8px;
background-image: linear-gradient(73deg, #ff6444, #ff444f);
background: linear-gradient(241.92deg, #d74b56 12.96%, #d1632f 86.33%);
background-repeat: round;
position: relative;
display: flex;
Expand Down Expand Up @@ -374,7 +374,7 @@ const SignupPublic = ({
background="white"
tabletBackground="green-1"
inputColor="grey-5"
inputBackground="grey-8"
inputBackground="white"
labelFocusColor="grey-7"
labelColor="black-3"
labelSize="16px"
Expand All @@ -387,7 +387,6 @@ const SignupPublic = ({
autoFocus={autofocus}
autoComplete="off"
required
border="unset"
height="40px"
focusBorder="var(--color-grey-7)"
/>
Expand All @@ -412,7 +411,7 @@ const SignupPublic = ({
handleChangeCheckbox={handleChange}
/>
<SocialWrapper jc="unset" ai="center">
<SignInText>{localize('Or sign in with')}</SignInText>
<SignInText>{localize('Or sign up with')}</SignInText>
<SocialButton
onClick={handleSocialSignup}
provider="google"
Expand Down
12 changes: 5 additions & 7 deletions src/components/custom/other-platforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,9 @@ export const DMT5Card = ({ is_selected, is_ppc_redirect, word_break_cover }) =>
<Card
cover_background="var(--color-green)"
cover_content={localize('Discover DMT5 now')}
title={localize('DMT5')}
title={localize('Deriv MT5')}
Icon={() => <StyledDmt5 src={DMT5} alt="" width="72" height="72" />}
content={[
localize('Trade on Deriv MT5 (DMT5), the all-in-one FX and CFD trading platform.'),
]}
content={[localize('Trade on Deriv MT5, the all-in-one CFD trading platform.')]}
is_inline_icon
min_height="12.4rem"
is_selected={is_selected}
Expand Down Expand Up @@ -314,12 +312,12 @@ export const NavPlatform = ({ onClick, is_ppc, is_ppc_redirect }) => {
<Flex direction="column" wrap="wrap" jc="flex-start">
<StyledText>{localize('Trading platforms')}</StyledText>
<NavCard
aria_label="DMT5"
aria_label="Deriv MT5"
icon={() => <img src={DMT5} alt="" width="32" height="32" />}
content={
<Localize translate_text="Trade on Deriv MT5 (DMT5), the all-in-one FX and CFD trading platform." />
<Localize translate_text="Trade on Deriv MT5, the all-in-one CFD trading platform." />
}
title={<Localize translate_text="DMT5" />}
title={<Localize translate_text="Deriv MT5" />}
onClick={onClick}
to={is_ppc_redirect ? '/landing/dmt5/' : '/dmt5/'}
/>
Expand Down
20 changes: 18 additions & 2 deletions src/components/elements/background-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,26 @@ const StyledBackground = styled(BackgroundImage)`
}
`

export const Background = ({ children, data, fluid, style, dark, ...props }) => {
export const Background = ({
children,
dark,
data,
fluid,
is_unstyled = false,
style,
...props
}) => {
const image = getImage(data)
const bgImage = convertToBgImage(image)

if (is_unstyled) {
return (
<BackgroundImage Tag="div" {...bgImage} {...props}>
{children}
</BackgroundImage>
)
}

return (
<StyledBackground Tag="div" style={style} dark={dark} fluid={fluid} {...bgImage} {...props}>
{children}
Expand All @@ -31,7 +47,7 @@ Background.propTypes = {
dark: PropTypes.string,
data: PropTypes.object,
fluid: PropTypes.array,
img_name: PropTypes.string,
is_unstyled: PropTypes.bool,
style: PropTypes.object,
}
export default Background
4 changes: 2 additions & 2 deletions src/components/elements/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ const FlexHover = styled(Flex)`
const SvgWrapper = styled.div`
& > svg,
img {
width: 33px;
height: 33px;
width: 32px;
height: 32px;
margin-right: 1.6rem;

@media ${device.mobileL} {
Expand Down
20 changes: 16 additions & 4 deletions src/components/elements/carousel/carousel-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ export const EmblaSlideInner = styled.div`
padding-left: 0;
margin: 0 auto;
height: 100%;
${(props) => {
if (props.width)
return css`
width: ${props.width};
`
}}
`

export const StyledButtonWrapper = styled.div`
Expand Down Expand Up @@ -121,10 +127,16 @@ export const StyledChevron = styled(Chevron)`
`

export const NavigationContainer = styled(Flex)`
position: relative;
width: 100%;
height: ${(props) => props.height ?? '8px'};
bottom: ${(props) => props.bottom_offset ?? '40px'};
${({ navigation_css, bottom_offset }) => {
if (navigation_css) return navigation_css
else
return css`
position: relative;
width: 100%;
height: 8px;
bottom: ${bottom_offset ?? '40px'};
`
}}
`

export const StyledDot = styled.div`
Expand Down
38 changes: 30 additions & 8 deletions src/components/elements/carousel/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,21 @@ export const NextButton = ({ color, enabled, is_reviews, onClick, style }) => (
NextButton.propTypes = PrevButton.propTypes

export const Carousel = ({
autoplay_delay,
autoplay_interval,
chevron_style,
children,
container_style,
embla_style,
has_autoplay,
navigation_style,
options,
slide_style,
slide_inner_width,
vertical_container,
view_port,
last_slide_no_spacing = false,
navigation_css,
}) => {
const [emblaRef, embla] = useEmblaCarousel(options)
const [prevBtnEnabled, setPrevBtnEnabled] = useState(false)
Expand All @@ -95,7 +100,7 @@ export const Carousel = ({
}
}, [embla])

const { play, stop } = useRecursiveTimeout(autoplay, autoplay_interval)
const { play, stop } = useRecursiveTimeout(autoplay, autoplay_interval, autoplay_delay)

const scrollPrev = useCallback(() => {
if (!embla) return
Expand Down Expand Up @@ -143,14 +148,22 @@ export const Carousel = ({

return (
<div style={container_style}>
<Embla>
<Embla style={embla_style}>
<ViewPort style={view_port} ref={emblaRef}>
<EmblaContainer style={vertical_container ? vertical_container : null}>
{children.map((child, idx) => (
<div key={idx} style={slide_style}>
<EmblaSlideInner>{child}</EmblaSlideInner>
</div>
))}
{children.map((child, idx) => {
const new_style =
last_slide_no_spacing && idx === children.length - 1
? { ...slide_style, marginRight: 0, paddingRight: 0 }
: slide_style
return (
<div key={idx} style={new_style}>
<EmblaSlideInner width={slide_inner_width}>
{child}
</EmblaSlideInner>
</div>
)
})}
</EmblaContainer>
</ViewPort>
{chevron_color && is_arrow && (
Expand All @@ -172,7 +185,11 @@ export const Carousel = ({
/>
)}
{nav_color && (
<NavigationContainer bottom_offset={bottom_offset} height={height}>
<NavigationContainer
navigation_css={navigation_css}
bottom_offset={bottom_offset}
height={height}
>
{/* We need the `child` below as an argument for embla-carousel to
correctly render the navigation buttons */}
{children.map((child, idx) => (
Expand All @@ -191,13 +208,18 @@ export const Carousel = ({
}

Carousel.propTypes = {
autoplay_delay: PropTypes.number,
autoplay_interval: PropTypes.number,
chevron_style: PropTypes.object,
children: PropTypes.array,
container_style: PropTypes.object,
embla_style: PropTypes.object,
has_autoplay: PropTypes.bool,
last_slide_no_spacing: PropTypes.bool,
navigation_css: PropTypes.array,
navigation_style: PropTypes.object,
options: PropTypes.object,
slide_inner_width: PropTypes.string,
slide_style: PropTypes.object,
vertical_container: PropTypes.object,
view_port: PropTypes.object,
Expand Down
6 changes: 3 additions & 3 deletions src/components/elements/off-canvas-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ export const OffCanvasMenuWrapper = (props) => {
aria_label="DMT5"
icon={() => <img src={DMT5} alt="" width="32" height="32" />}
content={
<Localize translate_text="Trade on Deriv MT5 (DMT5), the all-in-one FX and CFD trading platform." />
<Localize translate_text="Trade on Deriv MT5, the all-in-one CFD trading platform." />
}
title={<Localize translate_text="DMT5" />}
title={<Localize translate_text="Deriv MT5" />}
onClick={handleArrowClick}
to={props.is_ppc_redirect ? '/landing/dmt5/' : '/dmt5/'}
/>
Expand All @@ -212,7 +212,7 @@ export const OffCanvasMenuWrapper = (props) => {
aria_label="Derivx"
icon={() => <img src={DerivX} alt="" width="32" height="32" />}
content={
<Localize translate_text="Trade FX and CFDs on a customisable, easy-to-use trading platform." />
<Localize translate_text="Trade CFDs on a customisable, easy-to-use trading platform." />
}
title={<Localize translate_text="Deriv X" />}
onClick={handleArrowClick}
Expand Down
28 changes: 21 additions & 7 deletions src/components/elements/query-image.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
import React from 'react'
import React, { MouseEventHandler, ReactElement } from 'react'
import styled, { css } from 'styled-components'
import { GatsbyImage, getImage } from 'gatsby-plugin-image'
import type { ImageDataLike } from 'gatsby-plugin-image'

type QueryImageProps = {
alt: string
export type QueryImageProps = {
alt: ReactElement | string
className?: string
data: ImageDataLike
height?: string
width?: string
loading?: 'eager' | 'lazy'
disable_transition?: boolean
onMouseOver?: MouseEventHandler<HTMLDivElement>
onMouseOut?: MouseEventHandler<HTMLDivElement>
onClick?: MouseEventHandler<HTMLDivElement>
}

export type ImageWrapperProps = {
width: string
height: string
className?: string
loading: 'eager' | 'lazy'
disable_transition: boolean
}

export const ImageWrapper = styled.div<ImageWrapperProps>`
Expand All @@ -25,8 +30,8 @@ export const ImageWrapper = styled.div<ImageWrapperProps>`
height: ${(props) => props.height};
}
.gatsby-image-wrapper [data-main-image] {
${(props) => {
if (props.loading === 'eager') {
${({ loading, disable_transition }) => {
if (disable_transition && loading === 'eager') {
return css`
transition: none;
opacity: 1;
Expand All @@ -40,16 +45,25 @@ const QueryImage = ({
alt,
className,
data,
disable_transition = false,
height,
loading = 'lazy',
onClick,
width,
...props
}: QueryImageProps) => {
const image = getImage(data)
if (data) {
return (
<ImageWrapper loading={loading} width={width} height={height} className={className}>
<GatsbyImage image={image} alt={alt} loading={loading} {...props} />
<ImageWrapper
loading={loading}
width={width}
height={height}
className={className}
disable_transition={disable_transition}
onClick={onClick}
>
<GatsbyImage image={image} alt={alt as string} loading={loading} {...props} />
</ImageWrapper>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/elements/typography.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const BaseElement = css`
`

//////////////////////////////////////////////////////////////////////////////
/////////////////// TEXT IS DEPRICATED. PLEASE USE HEADER. ///////////////////
/////////////////// TEXT IS DEPRECATED. PLEASE USE HEADER. ///////////////////
//////////////////////////////////////////////////////////////////////////////
export const Text = styled.p`
${BaseElement}
Expand All @@ -84,7 +84,7 @@ export const Text = styled.p`
${responsiveStyles}
`
//////////////////////////////////////////////////////////////////////////////
/////////////////// TEXT IS DEPRICATED. PLEASE USE HEADER. ///////////////////
/////////////////// TEXT IS DEPRECATED. PLEASE USE HEADER. ///////////////////
//////////////////////////////////////////////////////////////////////////////

export const Header = styled(({ as = 'h1', children, ...props }) =>
Expand Down
7 changes: 1 addition & 6 deletions src/components/graphql/image-fragments.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ export const fadeIn = graphql`
export const homePageHeroFadeIn = graphql`
fragment homePageHeroFadeIn on File {
childImageSharp {
gatsbyImageData(
formats: [AUTO, WEBP]
layout: CONSTRAINED
breakpoints: [360, 992]
placeholder: DOMINANT_COLOR
)
gatsbyImageData(formats: [AUTO, AVIF, WEBP], layout: CONSTRAINED, placeholder: NONE)
}
}
`
Loading