Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit 6293c8c

Browse files
authored
Merge pull request #4 from NikitK-deriv/homepage
Homepage - Sinbad
2 parents 979bb71 + 255b46c commit 6293c8c

31 files changed

+1404
-264
lines changed

gatsby-config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ require('dotenv').config({
55
const site_url = 'https://sinbad.dev'
66

77
module.exports = {
8+
pathPrefix: '/sinbad',
89
flags: {
910
FAST_DEV: true,
1011
},
@@ -28,7 +29,7 @@ module.exports = {
2829
resolve: 'gatsby-source-filesystem',
2930
options: {
3031
name: 'images',
31-
path: `${__dirname}/src/images/common`,
32+
path: `${__dirname}/src/images`,
3233
},
3334
},
3435
'gatsby-transformer-sharp',

package-lock.json

+283-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
"react-ticker": "^1.3.1",
4545
"use-query-params": "^1.2.3",
4646
"web-push-notifications": "^3.24.0",
47-
"webpack": "^5.65.0"
47+
"webpack": "^5.65.0",
48+
"webpack-cli": "^4.9.2"
4849
},
4950
"devDependencies": {
5051
"@commitlint/cli": "^16.2.1",

src/common/components/containers/box.ts

-68
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
import styled from 'styled-components'
2-
import CssGrid from '../../../containers/css-grid'
3-
import Flex from '../../../containers/flex'
2+
import Flex from 'common/components/containers/flex'
43
import device from 'themes/device'
54

65
export const DefaultFooter = styled.footer`
76
background-color: #22365e;
87
color: white;
98
width: 100%;
10-
margin: 0 auto;
11-
margin-bottom: ${(props) => props.is_eu_country && '7.3rem'};
12-
padding-bottom: 1.6rem;
139
1410
@media ${device.mobileL} {
1511
padding-bottom: 6rem;
@@ -19,31 +15,12 @@ export const DefaultFooter = styled.footer`
1915
}
2016
}
2117
`
22-
export const FooterGrid = styled(CssGrid)`
23-
width: 100%;
24-
grid-template-columns: 2fr;
25-
grid-template-areas:
26-
'links links'
27-
'disclaimer disclaimer'
28-
'copyright social'
29-
'copyright pages';
30-
31-
@media ${device.tabletL} {
32-
grid-template-columns: 1fr;
33-
grid-template-areas:
34-
'links'
35-
'social'
36-
'disclaimer'
37-
'pages'
38-
'copyright';
39-
}
40-
`
4118

4219
export const SocialWrapper = styled.div`
43-
grid-area: links;
20+
align-items: center;
21+
height: 175px;
4422
background: #22365e;
4523
color: white;
46-
margin: 1.6rem 0;
4724
display: flex;
4825
justify-content: space-between;
4926
@@ -65,13 +42,17 @@ export const SocialWrapper = styled.div`
6542
`
6643

6744
export const DisclaimerWrapper = styled.div`
68-
grid-area: disclaimer;
45+
height: 100px;
6946
background: #22365e;
7047
color: white;
48+
border-top: 1px solid gray;
49+
display: flex;
7150
`
7251

7352
export const PagesWrapper = styled(Flex)`
74-
grid-area: pages;
7553
align-items: center;
7654
color: white;
55+
display: flex;
56+
justify-content: space-between;
57+
width: 1000px;
7758
`

src/common/components/containers/container.ts

-41
This file was deleted.

src/common/components/containers/css-grid.ts

-72
This file was deleted.

src/common/components/containers/flex.ts

+56-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,69 @@
11
import styled, { css } from 'styled-components'
2-
import Box, { generateResponsiveStyles } from './box'
3-
import device from 'themes/device'
2+
import device, { size } from 'themes/device'
43

5-
export const flexStyles = ({ jc, ai, fw, fd }) => css`
4+
type FlexBoxProps = {
5+
width?: string
6+
height?: string
7+
min_height?: string
8+
max_width?: string
9+
position?: string
10+
background?: string
11+
wrap?: string
12+
jc?: string
13+
fw?: string
14+
bg?: string
15+
fd?: string
16+
ai?: string
17+
direction?: string
18+
tablet_direction?: string
19+
tablet_ai?: string
20+
tablet_jc?: string
21+
tablet_fw?: string
22+
}
23+
24+
const flexStyles = ({ jc, ai, fw, fd }) => css`
625
justify-content: ${jc};
726
align-items: ${ai};
827
flex-wrap: ${fw};
928
flex-direction: ${fd};
1029
`
1130

31+
const mediaqueries = Object.keys(size)
32+
.sort(function (a, b) {
33+
return size[b] - size[a]
34+
})
35+
.reduce((accumulator, label) => {
36+
accumulator[label] = (...args) => css`
37+
@media (max-width: ${size[label]}px) {
38+
${css(...args)};
39+
}
40+
`
41+
return accumulator
42+
}, {})
43+
44+
const generateResponsiveStyles = (stylesGenerator) => (props) => {
45+
return Object.keys(mediaqueries).reduce((rules, mq) => {
46+
if (!props[mq]) return rules
47+
const styles = mediaqueries[mq]`
48+
${stylesGenerator(props[mq])}
49+
`
50+
return [...rules, styles]
51+
}, [])
52+
}
53+
1254
const responsiveStyles = generateResponsiveStyles(flexStyles)
1355

14-
const Flex = styled(Box)`
56+
export const Box = styled.div<FlexBoxProps>`
57+
width: ${(props) => (props.width ? props.width : '')};
58+
height: ${(props) => (props.height ? props.height : '')};
59+
min-height: ${(props) => (props.min_height ? props.min_height : '')};
60+
max-width: ${(props) => (props.max_width ? props.max_width : '')};
61+
position: ${(props) => (props.position ? props.position : '')};
62+
background: ${(props) => (props.background || props.bg ? props.background || props.bg : '')};
63+
${responsiveStyles}
64+
`
65+
66+
const Flex = styled(Box)<FlexBoxProps>`
1567
display: flex;
1668
width: ${(props) => (props.width ? props.width : '100%')};
1769
height: ${(props) => (props.height ? props.height : '100%')};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import Flex, { Box } from './flex'
2+
import { ContactUsButton, Header, Text, ImageContainer } from './main'
3+
4+
export { Flex, Box, ContactUsButton, Header, Text, ImageContainer }

0 commit comments

Comments
 (0)