Skip to content

Commit

Permalink
feat: s
Browse files Browse the repository at this point in the history
s
  • Loading branch information
Marcin Baraniecki committed Jun 6, 2022
1 parent 0438033 commit 69bb7bf
Show file tree
Hide file tree
Showing 32 changed files with 962 additions and 46 deletions.
6 changes: 3 additions & 3 deletions gatsby-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ const config: GatsbyConfig = {
chsb_yield_terms_and_conditions: require(`./prismic-types/chsb_yield_terms_and_conditions.json`),
app_tour: {},
premium_tour: {},
fees_values_minmax: {},
fees_exchange: {},
fees_values_minmax: require(`./prismic-types/fees_values_minmax.json`),
fees_exchange: require(`./prismic-types/fees_exchange.json`),
app_tour_stage: {},
premium_tour_stage: {},
daa_video: require(`./prismic-types/daa_video.json`),
yield_terms_and_conditions_1_5: {},
fees: {},
fees: require(`./prismic-types/fees.json`),
test_blog_post: require(`./prismic-types/test_blog_post.json`),
},
},
Expand Down
17 changes: 16 additions & 1 deletion gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ const getAnalysis = async (

export const onCreateWebpackConfig: GatsbyNode['onCreateWebpackConfig'] =
async ({ actions }) => {
const createPrismicDependentPageWithLangParam = (
pageName: string,
lang: Locale,
) =>
actions.createPage({
path: `/${pageName}/${lang}`,
component: path.resolve(`src/templates/${pageName}.tsx`),
context: {
lang,
},
});

const createNonPrismicDependentPageWithLangParam = (
pageName: string,
lang: Locale,
Expand Down Expand Up @@ -60,7 +72,7 @@ export const onCreateWebpackConfig: GatsbyNode['onCreateWebpackConfig'] =
});
});

// // Pages that DO NOT depend on the content from Prismic CMS. Will contain a "/:lang" param in the URL (eg. "/yield-learn-more/en-us").
// Pages that DO NOT depend on the content from Prismic CMS. Will contain a "/:lang" param in the URL (eg. "/yield-learn-more/en-us").
createNonPrismicDependentPageWithLangParam(`chsb-yield-learn-more`, lang);
createNonPrismicDependentPageWithLangParam(`yield-learn-more`, lang);
createNonPrismicDependentPageWithLangParam(`premium`, lang);
Expand All @@ -85,6 +97,9 @@ export const onCreateWebpackConfig: GatsbyNode['onCreateWebpackConfig'] =
lang,
);

// performs GraphQL queries to Prismic AND contains a lang param
createPrismicDependentPageWithLangParam(`fees`, lang);

allAssets
.filter(({ analysis }) => analysis === `full`)
.forEach(async ({ assetSymbol }) => {
Expand Down
18 changes: 18 additions & 0 deletions prismic-types/fees.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"Main": {
"fe_body": {
"type": "StructuredText",
"config": {
"multi": "paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,o-list-item",
"label": "fe_body"
}
},
"fe_footer": {
"type": "StructuredText",
"config": {
"multi": "paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,o-list-item",
"label": "fe_footer"
}
}
}
}
42 changes: 42 additions & 0 deletions prismic-types/fees_exchange.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"Main": {
"fees_exchange": {
"type": "Group",
"config": {
"fields": {
"currency_code": {
"type": "Text",
"config": {
"label": "currency_code"
}
},
"currency_name": {
"type": "Text",
"config": {
"label": "currency_name"
}
},
"standard": {
"type": "Number",
"config": {
"label": "standard"
}
},
"community_premium": {
"type": "Number",
"config": {
"label": "community_premium"
}
},
"genesis_premium": {
"type": "Number",
"config": {
"label": "genesis_premium"
}
}
},
"label": "fees_exchange"
}
}
}
}
68 changes: 68 additions & 0 deletions prismic-types/fees_values_minmax.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"Main": {
"fees_fiat": {
"type": "Group",
"config": {
"fields": {
"currency_code": {
"type": "Text",
"config": {
"label": "currency_code"
}
},
"currency_name": {
"type": "Text",
"config": {
"label": "currency_name"
}
},
"minimum": {
"type": "Number",
"config": {
"label": "minimum"
}
},
"maximum": {
"type": "Number",
"config": {
"label": "maximum"
}
}
},
"label": "fees_fiat"
}
},
"fees_crypto": {
"type": "Group",
"config": {
"fields": {
"currency_code": {
"type": "Text",
"config": {
"label": "currency_code"
}
},
"currency_name": {
"type": "Text",
"config": {
"label": "currency_name"
}
},
"minimum": {
"type": "Number",
"config": {
"label": "minimum"
}
},
"maximum": {
"type": "Number",
"config": {
"label": "maximum"
}
}
},
"label": "fees_crypto"
}
}
}
}
4 changes: 2 additions & 2 deletions src/components/RichBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
BlogPostBody,
isTextNode,
isImgNode,
} from '../types/graphql/prismic/BlogPostNode';
import { linkResolver } from '../utils/linkResolver';
} from '@/types/graphql/prismic/BlogPostNode';
import { linkResolver } from '@/utils/linkResolver';

const themes = {
light: {
Expand Down
6 changes: 3 additions & 3 deletions src/components/RoundedBack.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react';
import ChevronLeft from '../assets/fontIcons/ic_actions_chevron_left.svg';
import ChevronLeft from '@/assets/fontIcons/ic_actions_chevron_left.svg';
import styled from 'styled-components';
import { Theme, ThemeContext, themeContext } from '../context/themeContext';
import { ImportedSvg } from '../types/elements/ImportedSvg';
import { Theme, ThemeContext, themeContext } from '@/context/themeContext';
import { ImportedSvg } from '@/types/elements/ImportedSvg';

const themes = {
light: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Typo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import styled, { StyledComponent } from 'styled-components';
import { themeContext, ThemeContext, Theme } from '../context/themeContext';
import { themeContext, ThemeContext, Theme } from '@/context/themeContext';
import { Maybe } from 'true-myth';

interface Props {
Expand Down
32 changes: 32 additions & 0 deletions src/components/fees/FeesHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import Box from '@material-ui/core/Box';
import * as React from 'react';
import IcSmartEngine from '@/assets/fontIcons/ic-smart-engine.svg';
import { ImportedSvg } from '@/types/elements/ImportedSvg';
import Typo from '@/components/Typo';
import { FormattedMessage } from 'react-intl';

const FeesHeader: React.FC = () => {
const IcSmartEngineIcon = IcSmartEngine as ImportedSvg;
return (
<Box
display="flex"
flexDirection="column"
alignItems="center"
textAlign="center"
mb="30px"
mt="30px"
>
<IcSmartEngineIcon height="70px" width="70px" />
<Box mt="15px" mb="15px">
<Typo type="H3Bold">
<FormattedMessage id="fees.title" />
</Typo>
</Box>
<Typo type="H4">
<FormattedMessage id="fees.subtitle" />
</Typo>
</Box>
);
};

export default FeesHeader;
Loading

0 comments on commit 69bb7bf

Please sign in to comment.