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.

Sean / Landing page for DP2P #1173

Merged
merged 34 commits into from Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
eea98f9
feat: [WIP]P2P landing page
Oct 30, 2020
5a1d6e0
fix: mobile responsiveness for P2P page
Nov 2, 2020
c57b44b
fix: navbar logo spacing for mobile
Nov 2, 2020
27516be
fix: background image positioning
Nov 2, 2020
7c137cc
fix: redirect links
Nov 2, 2020
b67b471
fix: reduced image file sizes
Nov 2, 2020
2313434
fix: reducing media queries
Nov 3, 2020
d77455f
Replaced mobile prop with show component
Nov 3, 2020
ff6ee81
fix: button wording
Nov 4, 2020
67f294f
fix: copyright svg color to white
Nov 4, 2020
8d6efb2
revert last commit
Nov 4, 2020
537a728
fix: white copyright svg
Nov 4, 2020
50123ba
fix: created v1 & v2 of DP2P page
Nov 5, 2020
5692305
fix: fixed console errors and paddings & margins
Nov 6, 2020
dbb15da
fix: button resizing
Nov 6, 2020
3dfccaa
fix: redirect links and adding new span link text component
Nov 6, 2020
413ef83
fix: blurry images and section margins
Nov 9, 2020
15e0ae1
fix: hero font sizes and margins
Nov 9, 2020
26576f9
fix: padding changes to reflect design
Nov 10, 2020
1010334
fix: issues regarding mobile paddings and margins
Nov 11, 2020
4f07896
fix: issues with mobile design not matching
Nov 11, 2020
c462b72
fix: added show component to handle mobile hero background
Nov 11, 2020
222ee64
fix: redirect notice prompt
Nov 12, 2020
dba97af
fix: mobile header center align
Nov 12, 2020
d2768b4
fix: redirecting before confirmation
Nov 13, 2020
3adbc50
fix: redirecting before confirmation for EU
Nov 13, 2020
169e648
fix: redirecting before confirmation for EU
Nov 13, 2020
0595db2
fix: redirecting before confirmation for EU
Nov 13, 2020
41b7d5d
fix: redirecting before confirmation for EU
Nov 13, 2020
3bf3738
fix: redirecting before confirmation for EU
Nov 13, 2020
fb9f120
fix: redirecting before confirmation for EU
Nov 13, 2020
42dde8e
revert back to 3adbc50
Nov 13, 2020
973534c
resolved conflicts and fixed svg usages
Nov 17, 2020
a36018c
replaced p2p_v1 prop to general nav_type prop
Nov 17, 2020
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
2 changes: 1 addition & 1 deletion src/common/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function debounce(func, wait, immediate) {
}
}

const trimSpaces = value => value.trim()
const trimSpaces = (value) => value.trim()

const deriv_app_url = 'https://app.deriv.com'
const deriv_bot_app_url = 'https://app.deriv.com/bot'
Expand Down
2 changes: 1 addition & 1 deletion src/components/elements/background-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const StyledBackground = styled(BackgroundImage)`
}
`

const Background = ({ children, data, style, dark, ...props }) => {
export const Background = ({ children, data, style, dark, ...props }) => {
return (
<StyledBackground
Tag="div"
Expand Down
2 changes: 1 addition & 1 deletion src/components/elements/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { StaticQuery, graphql } from 'gatsby'
import Img from 'gatsby-image'
import PropTypes from 'prop-types'

const ImageWrapper = styled.div`
export const ImageWrapper = styled.div`
& .gatsby-image-wrapper {
width: ${(props) => props.width};
height: ${(props) => props.height};
Expand Down
6 changes: 4 additions & 2 deletions src/components/elements/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import DotLoader from './dot-loader'
import Dropdown from './dropdown'
import Checkbox from './checkbox'
import Image from './image'
import QueryImage from './query-image'
import QueryImage, { ImageWrapper } from './query-image'
import { StyledLink } from './link'
import {
OffCanvasMenuWrapper as OffCanvasMenu,
Expand All @@ -16,7 +16,7 @@ import {
} from './off-canvas-menu'
import SideTab from './side-tab'
import Tabs from './default-tab'
import { Text, LinkText, LocalizedLinkText, Header, BaseElement } from './typography'
import { Text, LinkText, LocalizedLinkText, Header, BaseElement, SpanLinkText } from './typography'
import Timeline from './timeline'
import { Ul, Li } from './lists'
import { Carousel } from './carousel'
Expand All @@ -37,6 +37,7 @@ export {
Dropdown,
Checkbox,
Image,
ImageWrapper,
QueryImage,
StyledLink,
NavCard,
Expand All @@ -49,6 +50,7 @@ export {
LinkText,
LocalizedLinkText,
Header,
SpanLinkText,
Timeline,
Ul,
Li,
Expand Down
2 changes: 1 addition & 1 deletion src/components/elements/query-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import styled from 'styled-components'
import Img from 'gatsby-image'
import PropTypes from 'prop-types'

const ImageWrapper = styled.div`
export const ImageWrapper = styled.div`
width: ${(props) => (props.width ? props.width : '100%')};
height: ${(props) => props.height};

Expand Down
20 changes: 14 additions & 6 deletions src/components/elements/typography.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ import device from 'themes/device'

const createElement = React.createElement

export const BaseLink = css`
text-decoration: none;
cursor: pointer;

&:hover {
color: var(--color-red);
text-decoration: underline;
}
`

export const BaseElement = css`
text-align: ${(props) => props.align || 'left'};
padding: ${(props) => props.padding || ''};
Expand Down Expand Up @@ -46,13 +56,11 @@ export const Header = styled(({ as = 'h1', children, ...props }) =>
`

export const LinkText = styled(Text).attrs({ as: 'a' })`
text-decoration: none;
cursor: pointer;
${BaseLink}
`

&:hover {
color: var(--color-red);
text-decoration: underline;
}
export const SpanLinkText = styled(Text).attrs({ as: 'span' })`
${BaseLink}
`

export const LocalizedLinkText = styled((props) => <LocalizedLink {...props} />)`
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/copyright.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import React from 'react'
import { Box, Container } from 'components/containers'
import { Text } from 'components/elements'
import { localize } from 'components/localization'
import CopyrightIc from 'images/svg/copyright.svg'
import CopyrightIc from 'images/svg/copyright-white.svg'

const Copyright = () => {
return (
<Box bg="var(--color-black)">
<Container jc="flex-start" p="1.5rem 0" ai="center">
<img src={CopyrightIc} alt="copyright ic" width="1.6rem" />
<img src={CopyrightIc} alt="copyright ic" width="16px" />
<Text color="white" ml="0.4rem">
{localize('2020 Deriv | All rights reserved')}
</Text>
Expand Down
29 changes: 23 additions & 6 deletions src/components/layout/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Footer from './footer'
import Copyright from './copyright'
import { Nav, NavStatic, NavPartners, NavInterim } from './nav'
import { NavCareers } from './nav-careers'
import { NavP2P } from './nav-p2p'
import { LocationProvider } from './location-context'
import EURedirect, { useModal } from 'components/custom/_eu-redirect-modal.js'
import CookieBanner from 'components/custom/cookie-banner'
Expand All @@ -27,7 +28,15 @@ const has_dataLayer = isBrowser() && window.dataLayer
const TRACKING_STATUS_KEY = 'tracking_status'
const tracking_status_cookie = new CookieStorage(TRACKING_STATUS_KEY)

const Layout = ({ children, type, interim_type, padding_top, no_login_signup }) => {
const Layout = ({
children,
type,
interim_type,
padding_top,
no_login_signup,
no_live_chat,
nav_type,
}) => {
const { is_eu_country } = React.useContext(DerivStore)
const [has_mounted, setMounted] = React.useState(false)
const [show_cookie_banner, setShowCookieBanner] = React.useState(false)
Expand Down Expand Up @@ -88,6 +97,10 @@ const Layout = ({ children, type, interim_type, padding_top, no_login_signup })
Navigation = <NavCareers />
FooterNav = <Footer no_language={true} />
break
case 'p2p':
Navigation = <NavP2P nav_type={nav_type} />
FooterNav = <Copyright />
break
default:
Navigation = <Nav />
FooterNav = <Footer />
Expand All @@ -114,11 +127,13 @@ const Layout = ({ children, type, interim_type, padding_top, no_login_signup })
is_open={show_cookie_banner}
/>
)}
<LiveChat
LC_API={LC_API}
is_livechat_interactive={is_livechat_interactive}
setLiveChatInteractive={setLiveChatInteractive}
/>
{!no_live_chat && (
<LiveChat
LC_API={LC_API}
is_livechat_interactive={is_livechat_interactive}
setLiveChatInteractive={setLiveChatInteractive}
/>
)}
{FooterNav}
<EURedirect
toggle={toggleModal}
Expand All @@ -137,6 +152,8 @@ const Layout = ({ children, type, interim_type, padding_top, no_login_signup })
Layout.propTypes = {
children: PropTypes.node.isRequired,
interim_type: PropTypes.string,
nav_type: PropTypes.string,
no_live_chat: PropTypes.bool,
no_login_signup: PropTypes.bool,
padding_top: PropTypes.string,
type: PropTypes.string,
Expand Down
96 changes: 96 additions & 0 deletions src/components/layout/nav-p2p.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import React from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'
import { graphql, useStaticQuery } from 'gatsby'
import { StyledNav, NavWrapper, LogoLink, Wrapper, NavLeft } from './nav'
import { localize } from 'components/localization'
import { QueryImage } from 'components/elements'
import { Show } from 'components/containers'
import device from 'themes/device'
import LogoCombinedShape from 'images/svg/logo-combined-shape.svg'

const query = graphql`
query {
deriv: file(relativePath: { eq: "logo.png" }) {
...fadeIn
}
}
`

const StyledWrapper = styled(Wrapper)`
@media ${device.tabletL} {
justify-content: center;
}
`

const StyledLogoLink = styled(LogoLink)`
@media ${device.tabletS} {
& svg,
.gatsby-image-wrapper {
width: 100%;
}
}
`

const P2PNavLeft = styled(NavLeft)`
@media ${device.tabletL} {
display: flex;
width: 180px;
}
`

const Line = styled.div`
width: 1px;
height: 28px;
margin-right: 8px;
margin-left: 8px;
background-color: var(--color-white);

@media ${device.tabletL} {
height: 16px;
margin-left: 5px;
margin-right: 4px;
}
`

export const NavP2P = ({ nav_type }) => {
const data = useStaticQuery(query)

return (
<>
<NavWrapper>
<StyledNav>
<StyledWrapper>
<P2PNavLeft>
<StyledLogoLink
to={nav_type === 'p2p-v1' ? '/p2p/v1' : '/p2p/v2'}
aria-label={localize('Home')}
>
<QueryImage
data={data['deriv']}
alt={localize('Deriv')}
max_width="16.4rem"
width="100%"
height="auto"
/>
</StyledLogoLink>
<Line />
<Show.Desktop min_width="992">
<img src={LogoCombinedShape} alt="get trading" />
</Show.Desktop>
<Show.Mobile>
<img src={LogoCombinedShape} alt="get trading" width="71px" />
</Show.Mobile>
</P2PNavLeft>
</StyledWrapper>
</StyledNav>
</NavWrapper>
</>
)
}

NavP2P.propTypes = {
nav_type: PropTypes.string,
}

export default { NavP2P }
Binary file added src/images/common/p2p_banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/common/p2p_banner_mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/common/p2p_buy_sell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/common/p2p_hero_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/common/p2p_hero_img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/common/p2p_local_currency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/common/p2p_web_and_mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions src/images/svg/complete-order.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/images/svg/copyright-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 4 additions & 12 deletions src/images/svg/copyright.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/images/svg/p2p-desktop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/images/svg/p2p-mobile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/images/svg/right-ad.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading