Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Adding stake pool api integration with graphql #333

Draft
wants to merge 32 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a443d1f
Adding stake pool api integration with graphql
DeeJayElly Jul 28, 2020
e499843
Merge branch 'develop' into chore/stake-pool-components-with-graphql
DeeJayElly Jul 29, 2020
6fd6216
Adding stake pool api integration with graphql
DeeJayElly Jul 29, 2020
c48f27d
Merge branch 'develop' into chore/stake-pool-components-with-graphql
DominikGuzei Sep 3, 2020
dbaf02c
issue-333 Fix stake pools graphQL query
DominikGuzei Sep 3, 2020
a06e1e2
issue-333 Fix graphql dev endpoint
DominikGuzei Sep 3, 2020
14d1b12
issue-333 Prepare stake pools page to match design
DominikGuzei Sep 3, 2020
3fe90ff
issue-333 Refactor stake pools feature to new pattern
DominikGuzei Sep 4, 2020
f3f98f5
issue-333 minor css class fix
DominikGuzei Sep 4, 2020
128b486
issue-333 WIP wire up the stake pools query
DominikGuzei Sep 4, 2020
9327846
issue-333 Fix header navigation hover state
DominikGuzei Sep 7, 2020
01981e1
issue-333 Use stake pool dummy data again
DominikGuzei Sep 7, 2020
89afedd
issue-333 simplify reactive unmoderated data warning
DominikGuzei Sep 7, 2020
f0aaa94
issue-333 wire-up current epoch data for statistics
DominikGuzei Sep 7, 2020
2f06b86
Merge branch 'develop' into chore/stake-pool-components-with-graphql
DominikGuzei Sep 21, 2020
b993379
Adding stake pool api integration with graphql
DeeJayElly Jul 28, 2020
3e9c8c4
Adding stake pool api integration with graphql
DeeJayElly Jul 29, 2020
767982f
issue-333 Fix stake pools graphQL query
DominikGuzei Sep 3, 2020
2b37cb4
issue-333 Fix graphql dev endpoint
DominikGuzei Sep 3, 2020
bff4606
issue-333 Prepare stake pools page to match design
DominikGuzei Sep 3, 2020
a73686e
issue-333 Refactor stake pools feature to new pattern
DominikGuzei Sep 4, 2020
35ae382
issue-333 minor css class fix
DominikGuzei Sep 4, 2020
8164e74
issue-333 WIP wire up the stake pools query
DominikGuzei Sep 4, 2020
e72cc18
issue-333 Fix header navigation hover state
DominikGuzei Sep 7, 2020
0c7d34b
issue-333 Use stake pool dummy data again
DominikGuzei Sep 7, 2020
7163f50
issue-333 simplify reactive unmoderated data warning
DominikGuzei Sep 7, 2020
797d8a4
issue-333 wire-up current epoch data for statistics
DominikGuzei Sep 7, 2020
0d346c5
Merge branch 'chore/stake-pool-components-with-graphql' of github.com…
DominikGuzei Sep 21, 2020
8dcb19b
issue-333 wire-up stake pools api
DominikGuzei Sep 21, 2020
e32d9af
Merge branch 'develop' into chore/stake-pool-components-with-graphql
DeeJayElly Sep 25, 2020
df977d6
issue-333 hide stake pool stats the api cant provide
DominikGuzei Sep 25, 2020
dd7f0cb
Merge branch 'chore/stake-pool-components-with-graphql' of github.com…
DominikGuzei Sep 25, 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 .graphqlconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "Cardano GraphQL Schema",
"schemaPath": "./schema.graphql"
"schemaPath": "./node_modules/@cardano-graphql/client-ts/api/schema.graphql"
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"prettier:format": "yarn prettier --write --loglevel warn",
"prettier:fix-staged": "pretty-quick --staged",
"storybook": "start-storybook -s ./source/public -p 6006",
"storybook:build": "build-storybook -o build/storybook"
"storybook:build": "build-storybook -o build/storybook",
"next": "next dev source -p 4000"
},
"homepage": "https://github.com/input-output-hk/cardano-explorer-app",
"husky": {
Expand Down
6 changes: 3 additions & 3 deletions source/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export const environment = {
GRAPHQL: {
HTTP_URL: `${process.env.GRAPHQL_API_PROTOCOL || 'https'}://${
process.env.GRAPHQL_API_HOST ||
'cardano-graphql-mainnet.daedalus-operations.com'
`explorer.cardano-${process.env.CARDANO_NETWORK || 'mainnet'}.iohk.io`
}:${process.env.GRAPHQL_API_PORT || '443'}/${
process.env.GRAPHQL_API_PATH || ''
process.env.GRAPHQL_API_PATH || 'graphql'
}`,
},
NETWORK:
Expand All @@ -24,7 +24,7 @@ export const environment = {
IS_SERVER: !isNavigatorDefined,
PACKAGE: {
HOMEPAGE: process.env.PACKAGE_HOMEPAGE,
VERSION: process.env.PACKAGE_VERSION
VERSION: process.env.PACKAGE_VERSION,
},
POLLING_INTERVAL: Number(process.env.POLLING_INTERVAL) || 10000,
};
Expand Down
4 changes: 2 additions & 2 deletions source/features/epochs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ export const createEpochsFeature = (
api: epochsApi,
store: epochsStore,
start() {
epochsStore.start();
return epochsStore.start();
},
stop() {
epochsStore.stop();
return epochsStore.stop();
},
};
};
24 changes: 24 additions & 0 deletions source/features/epochs/ui/EpochProgress.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.progressTextContent {
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
}

.progressTextLabel {
color: var(--info-text-color);
font-family: ProximaNova, sans-serif;
font-size: 10px;
font-weight: 300;
letter-spacing: 0.5px;
line-height: 1.4;
margin-bottom: 5px;
}

.progressTextValue {
color: var(--solid-text-color);
font-family: ProximaNova, sans-serif;
font-size: 46px;
font-weight: 300;
letter-spacing: 2.3px;
}
57 changes: 3 additions & 54 deletions source/features/epochs/ui/EpochSummary.module.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../../styles/mixins/info-panel';

.epochSummaryContainer {
margin: 0 auto;
max-width: 872px;
Expand All @@ -11,60 +13,7 @@
align-items: center;
display: flex;

.progressTextContent {
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;

.progressTextLabel {
color: var(--info-text-color);
font-family: ProximaNova, sans-serif;
font-size: 10px;
font-weight: 300;
letter-spacing: 0.5px;
line-height: 1.4;
margin-bottom: 5px;
}

.progressTextValue {
color: var(--solid-text-color);
font-family: ProximaNova, sans-serif;
font-size: 46px;
font-weight: 300;
letter-spacing: 2.3px;
}
}

.infoPanel {
color: var(--info-text-color);
margin-left: 60px;

.infoRow {
align-items: center;
display: flex;
font-size: 12px;
letter-spacing: 0.6px;
line-height: 1.33;
margin-bottom: 10px;

.infoLabel {
font-family: ProximaNova, sans-serif;
font-weight: 600;
width: 130px;
}

.infoValue {
font-family: ProximaNova, sans-serif;
font-weight: 300;
}
}

@media (max-width: 768px) {
margin-left: 0;
padding-top: 40px;
}
}
@include info-panel($label-width: 130px);

@media (max-width: 768px) {
flex-direction: column;
Expand Down
19 changes: 5 additions & 14 deletions source/features/epochs/ui/EpochSummary.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import { observer } from 'mobx-react-lite';
import CircularProgress, {
CircularProgressSize,
} from '../../../widgets/circular-progress/CircularProgress';
import React from 'react';
import DividerWithTitle from '../../../widgets/divider-with-title/DividerWithTitle';
import { useI18nFeature } from '../../i18n/context';
import { IEpochOverview } from '../types';
import styles from './EpochSummary.module.scss';
import { EpochSummaryProgress } from './EpochSummaryProgress';

dayjs.extend(utc);

Expand All @@ -24,18 +23,10 @@ const EpochSummary = ({ title, epoch }: IEpochSummaryProps) => {
<DividerWithTitle title={title} />
</div>
<div className={styles.content}>
<CircularProgress
<EpochSummaryProgress
epochNumber={epoch.number}
percentage={epoch.percentage}
size={CircularProgressSize.BIG}
showText
text={
<div className={styles.progressTextContent}>
<div className={styles.progressTextLabel}>
{translate('epochSummary.epoch')}
</div>
<div className={styles.progressTextValue}>{epoch.number}</div>
</div>
}
title={translate('epochSummary.epoch')}
/>
<div className={styles.infoPanel}>
<div className={styles.infoRow}>
Expand Down
25 changes: 25 additions & 0 deletions source/features/epochs/ui/EpochSummaryProgress.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import CircularProgress, {
CircularProgressSize,
} from '../../../widgets/circular-progress/CircularProgress';
import styles from './EpochProgress.module.scss';

export interface IEpochProgressProps {
epochNumber: number;
percentage: number;
title: string;
}

export const EpochSummaryProgress = (props: IEpochProgressProps) => (
<CircularProgress
percentage={props.percentage}
size={CircularProgressSize.BIG}
showText
text={
<div className={styles.progressTextContent}>
<div className={styles.progressTextLabel}>{props.title}</div>
<div className={styles.progressTextValue}>{props.epochNumber}</div>
</div>
}
/>
);
73 changes: 0 additions & 73 deletions source/features/landing-page/LandingPage.module.scss
Original file line number Diff line number Diff line change
@@ -1,48 +1,3 @@
.headerBgContainer {
display: flex;
justify-content: center;
left: 0;
position: absolute;
top: 0;
width: 100%;

.headerBg {
display: flex;
flex-direction: column;
align-items: center;
position: relative;
img {
height: 415px;
margin-top: -25px;
margin-left: 11px;
}
}
}

.sideBgContainer {
position: absolute;
bottom: 0;
height: 100%;
width: 100%;
display: flex;
z-index: -1;
}

.sideBackgroundImageContainer {
align-items: flex-end;
bottom: 0;
display: flex;
position: absolute;
right: 0;

.sideBackgroundImage {
height: auto;
object-fit: contain;
opacity: 0.3;
width: 596.5px;
}
}

.epochList {
margin-top: 71px;
margin-bottom: 21px;
Expand All @@ -60,31 +15,3 @@
margin-bottom: 83px;
}
}

.footer {
padding: 0 0 92px;
}

.mainNetHeaderImage,
.testNetHeaderImage {
left: 0;
margin-left: auto;
margin-right: auto;
position: absolute;
right: 0;
top: -113px;
width: 1100px;

@media (max-width: 1000px) {
width: 100%;
}

@media (max-width: 768px) {
display: none;
}
}

.testNetHeaderImage {
top: -173px !important;
width: 620px !important;
}
26 changes: 2 additions & 24 deletions source/features/landing-page/LandingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import Head from 'next/head';
import React from 'react';
import { BrandType, CardanoNetwork } from '../../constants';
import { environment } from '../../environment';
import { StaticLayoutProps } from '../../lib/types';
import SideBackgroundImage from '../../public/assets/images/main-side-background.svg';
import { Footer, Header, Layout } from '../../widgets/layout';
import { EnlargedHeaderLayout } from '../../widgets/layout/EnlargedHeaderLayout';
import { BlocksFeatureProvider } from '../blocks/ui/BlocksFeatureProvider';
import { LatestBlocks } from '../blocks/ui/LatestBlocks';
import { EpochsFeatureProvider } from '../epochs/ui/EpochsFeatureProvider';
import { LatestEpochs } from '../epochs/ui/LatestEpochs';
import { useI18nFeature } from '../i18n/context';
import { i18nInitialProps } from '../i18n/utils';
import { SearchBar } from '../search/ui/SearchBar';
const mainNetHeaderImage = require('../../public/assets/images/header/mainnet.png');
const testNetHeaderImage = require('../../public/assets/images/header/testnet.png');
import styles from './LandingPage.module.scss';

export const LandingPage = () => (
Expand All @@ -36,23 +30,7 @@ const StaticLayout = (props: StaticLayoutProps) => {
<Head>
<title>{translate('index.pageTitle')}</title>
</Head>
{environment.CARDANO.NETWORK === CardanoNetwork.MAINNET && (
<img src={mainNetHeaderImage} className={styles.mainNetHeaderImage} />
)}
{environment.CARDANO.NETWORK === CardanoNetwork.TESTNET && (
<img src={testNetHeaderImage} className={styles.testNetHeaderImage} />
)}
<Layout>
<Header brandType={BrandType.ENLARGED} />
<SearchBar brandType={BrandType.ENLARGED} />
{props.children}
<Footer rootClassname={styles.footer} />
</Layout>
<div className={styles.sideBgContainer}>
<div className={styles.sideBackgroundImageContainer}>
<SideBackgroundImage className={styles.sideBackgroundImage} />
</div>
</div>
<EnlargedHeaderLayout>{props.children}</EnlargedHeaderLayout>
</>
);
};
Expand Down
19 changes: 12 additions & 7 deletions source/features/navigation/ui/LocalizedLink.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { omit } from 'lodash';
import Link, { LinkProps } from 'next/link';
import React from 'react';
import { useI18nFeature } from '../../i18n/context';
Expand All @@ -6,16 +7,20 @@ import styles from './LocalizedLink.module.scss';
export const LocalizedLink = (
props: LinkProps & {
children: React.ReactNode;
className?: string;
}
) => {
const i18n = useI18nFeature();
const linkProps = omit(props, ['class', 'className']);
return (
<Link
{...props}
href={`/[locale]${props.href}`}
as={`/${i18n.store.locale}${props.href}`}
>
<a className={styles.link}>{props.children}</a>
</Link>
<span className={props.className}>
<Link
{...linkProps}
href={`/[locale]${props.href}`}
as={`/${i18n.store.locale}${props.href}`}
>
<a className={styles.link}>{props.children}</a>
</Link>
</span>
);
};
5 changes: 0 additions & 5 deletions source/features/stake-pools/actions.ts

This file was deleted.

21 changes: 0 additions & 21 deletions source/features/stake-pools/api.ts

This file was deleted.

Loading