repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
edgggeTRON/cardano-explorer-app | source/features/blocks/config.ts | <filename>source/features/blocks/config.ts
export const BLOCK_BROWSE_PATH = '/browse-blocks';
export const BLOCKS_PER_PAGE_DEFAULT = 20;
export const BLOCKS_PER_PAGE_MAXIMUM = 50;
export const BLOCKS_PER_PAGE_MINIMUM = 5;
export const BLOCK_SEARCH_RESULT_PATH = '/block';
|
edgggeTRON/cardano-explorer-app | source/features/network-info/context.ts | <reponame>edgggeTRON/cardano-explorer-app
import React from 'react';
import { ensureContextExists } from '../../lib/react/hooks';
import { INetworkInfoFeature } from './index';
/**
* The React context that can be reused and configured with instances
* of the network info feature (also multiple times on one page)
*/... |
edgggeTRON/cardano-explorer-app | source/lib/graphql/GraphQLProvider.tsx | <gh_stars>10-100
import { GraphQLClient } from 'graphql-request';
import React from 'react';
import { ensureContextExists } from '../react/hooks';
import { graphqlClient } from './graphqlClient';
interface IProps {
children: React.ReactNode;
}
/**
* The React context that holds the GraphQLClient instance
*/
expor... |
edgggeTRON/cardano-explorer-app | source/widgets/decorators/ShowMoreButtonDecorator.tsx | import React from 'react';
import { LocalizedLink } from '../../features/navigation/ui/LocalizedLink';
import styles from './ShowMoreButtonDecorator.module.scss';
export interface IShowMoreButtonDecorator {
href: string;
label: string;
isHidden?: boolean;
children: React.ReactNode;
}
const ShowMoreButtonDecor... |
edgggeTRON/cardano-explorer-app | source/config/mobx.config.ts | <reponame>edgggeTRON/cardano-explorer-app<filename>source/config/mobx.config.ts
import { configure } from 'mobx';
configure({ enforceActions: 'observed' });
|
edgggeTRON/cardano-explorer-app | stories/error.stories.tsx | import { storiesOf } from '@storybook/react';
import React from 'react';
import { BrandType } from '../source/constants';
import styles from '../source/features/errors/ErrorPage.module.scss';
import Error from '../source/features/errors/PageNotFoundError';
import { Footer, Header, Layout } from '../source/widgets/layou... |
edgggeTRON/cardano-explorer-app | source/features/address/api/transformers.ts | <reponame>edgggeTRON/cardano-explorer-app<filename>source/features/address/api/transformers.ts<gh_stars>1-10
import { Currency } from 'cardano-js';
import { SearchForAddressQuery } from '../../../../generated/typings/graphql-schema';
import { IAddressSummary } from '../types';
export const addressDetailTransformer = (... |
edgggeTRON/cardano-explorer-app | source/features/stake-pools/components/StakePoolsSearch.tsx | <gh_stars>10-100
import { observer } from 'mobx-react-lite';
import { useI18nFeature } from '../../i18n/context';
import Search from '../../search/ui/Search';
import { IStakePoolsSearchProps } from '../types';
import styles from './StakePoolsSearch.module.scss';
const StakePoolsSearch = ({
onSearch,
onInputChange,... |
edgggeTRON/cardano-explorer-app | source/features/address/config.ts | <gh_stars>10-100
export const ADDRESS_SEARCH_RESULT_PATH = '/address';
|
edgggeTRON/cardano-explorer-app | source/features/network-info/api/index.ts | <gh_stars>10-100
import { GraphQLClient } from 'graphql-request';
import { GraphQLRequest } from '../../../lib/graphql/GraphQLRequest';
import {
CardanoDynamicQuery,
CardanoStaticQuery,
} from '../../../typings/graphql-schema';
import cardanoDynamic from './cardanoDynamic.graphql';
import cardanoStatic from './card... |
edgggeTRON/cardano-explorer-app | source/features/stake-pools/ui/pages/StakePoolsPage.tsx | import Head from 'next/head';
import React from 'react';
import NoSSR from 'react-no-ssr';
import { BrandType } from '../../../../constants';
import { StaticLayoutProps } from '../../../../lib/types';
import Container from '../../../../widgets/container/Container';
import { Footer, Header, Layout } from '../../../../wi... |
edgggeTRON/cardano-explorer-app | source/features/stake-pools/components/UnmoderatedDataConsented.tsx | <reponame>edgggeTRON/cardano-explorer-app<gh_stars>1-10
import { useI18nFeature } from '../../i18n/context';
import styles from './UnmoderatedDataConsented.module.scss';
export default () => {
const { translate } = useI18nFeature().store;
return (
<div className={styles.unmoderatedDataConsentedContainer}>
... |
edgggeTRON/cardano-explorer-app | source/features/epochs/specs/epochs.spec.ts | <reponame>edgggeTRON/cardano-explorer-app
import waitForExpect from 'wait-for-expect';
import { graphqlClient } from '../../../lib/graphql/graphqlClient';
import { BlocksActions } from '../../blocks';
import { BlocksApi } from '../../blocks/api';
import { BlocksStore } from '../../blocks/store';
import { NetworkInfoAct... |
edgggeTRON/cardano-explorer-app | source/lib/react/hooks.ts | <reponame>edgggeTRON/cardano-explorer-app<filename>source/lib/react/hooks.ts
import React, { useContext, useEffect, useLayoutEffect } from 'react';
import { environment } from '../../environment';
import { Store } from '../Store';
/**
* Manages the lifecycle of a feature based on its provider component.
*
* 1. Star... |
edgggeTRON/cardano-explorer-app | source/features/address/ui/pages/AddressPage.tsx | import Head from 'next/head';
import React from 'react';
import { StaticLayoutProps } from '../../../../lib/types';
import { ShrinkedHeaderLayout } from '../../../../widgets/layout/ShrinkedHeaderLayout';
import { useI18nFeature } from '../../../i18n/context';
import { i18nInitialProps } from '../../../i18n/utils';
impo... |
edgggeTRON/cardano-explorer-app | source/features/blocks/ui/BlockCreationRow.tsx | import { observer } from 'mobx-react-lite';
import React from 'react';
import styles from './BlockCreationRow.module.scss';
export interface IBlockCreationRowProps {
performance: number;
performancePercentage: number;
sharedRewards: number;
slotsElected: number;
slotsElectedPercentage: number;
stakePool: s... |
edgggeTRON/cardano-explorer-app | source/features/outdated-browser/OutdatedBrowserPage.tsx | <reponame>edgggeTRON/cardano-explorer-app
import Head from 'next/head';
import React from 'react';
import { StaticLayoutProps } from '../../lib/types';
import { Footer, Layout } from '../../widgets/layout';
import { useI18nFeature } from '../i18n/context';
import { i18nInitialProps } from '../i18n/utils';
import Outdat... |
edgggeTRON/cardano-explorer-app | source/features/epochs/config.ts | <filename>source/features/epochs/config.ts
export const EPOCH_SEARCH_RESULT_PATH = '/epoch';
export const EPOCH_BROWSE_PATH = '/browse-epochs';
export const EPOCH_BLOCKS_PER_PAGE = 10;
export const EPOCHS_PER_PAGE_DEFAULT = 10;
export const EPOCHS_PER_PAGE_MINIMUM = 5;
export const EPOCHS_PER_PAGE_MAXIMUM = 50;
|
edgggeTRON/cardano-explorer-app | source/features/stake-pools/components/StakePools.tsx | import { debounce } from 'lodash';
import React, { useEffect, useState } from 'react';
import DividerWithTitle from '../../../widgets/divider-with-title/DividerWithTitle';
import { useI18nFeature } from '../../i18n/context';
import { getFilteredStakePoolsList } from '../helpers';
import { IStakePoolProps, IStakePoolsPr... |
edgggeTRON/cardano-explorer-app | source/features/search/specs/searchForTransactionById.spec.ts | <gh_stars>10-100
import waitForExpect from 'wait-for-expect';
import { ISearchFeature } from '../index';
import { exampleTransactionData } from './helpers/exampleTransactionData';
import { setupSearchFeature } from './helpers/setup';
describe('Searching for a transaction', () => {
let search: ISearchFeature;
befor... |
edgggeTRON/cardano-explorer-app | source/features/search/ui/pages/NoSearchResultPage.tsx | <filename>source/features/search/ui/pages/NoSearchResultPage.tsx<gh_stars>10-100
import { observer } from 'mobx-react-lite';
import Head from 'next/head';
import React from 'react';
import { BrandType } from '../../../../constants';
import { StaticLayoutProps } from '../../../../lib/types';
import { Footer, Header, Lay... |
edgggeTRON/cardano-explorer-app | source/features/epochs/helpers.ts | import { EPOCH_SEARCH_RESULT_PATH } from './config';
export const getEpochRoute = (epoch: number) =>
`${EPOCH_SEARCH_RESULT_PATH}?number=${epoch}`;
|
edgggeTRON/cardano-explorer-app | source/features/network-info/ui/NetworkInfoFeatureProvider.tsx | <reponame>edgggeTRON/cardano-explorer-app
import React, { useState } from 'react';
import { useGraphQLClient } from '../../../lib/graphql/GraphQLProvider';
import { useFeature } from '../../../lib/react/hooks';
import { networkInfoContext } from '../context';
import { createNetworkInfoFeature, INetworkInfoFeature } fro... |
edgggeTRON/cardano-explorer-app | source/features/search/config.ts | export const NO_SEARCH_RESULTS_PATH = '/no-search-results';
|
edgggeTRON/cardano-explorer-app | source/features/search/specs/helpers/exampleEpochData.ts | <filename>source/features/search/specs/helpers/exampleEpochData.ts<gh_stars>10-100
export const exampleEpochData = {
blocks: [],
lastBlockTime: '2017-10-01T02:25:51',
number: 1,
output: '17282903106017760',
slots: [],
startedAt: '2017-09-28T21:45:51',
transactionsCount: '5344',
};
|
edgggeTRON/cardano-explorer-app | source/features/navigation/testing/NavigationRouterMock.ts | <filename>source/features/navigation/testing/NavigationRouterMock.ts
import * as querystring from 'querystring';
import { INavigationRouterDependency } from '../index';
/**
* Minimal navigation router mock that simulates the API
* of NextRouter for testing.
*/
export class NavigationRouterMock implements INavigatio... |
edgggeTRON/cardano-explorer-app | source/features/stake-pools/constants.ts | <gh_stars>10-100
export const UNMODERATED_WARNING_STORAGE_KEY: string = 'unmoderatedWarning';
export const UNMODERATED_WARNING_PERIOD: number = 24 * 3600000; // 24 hours | unit: miliseconds
export const SEARCH_FIELDS: string[] = ['ticker', 'name'];
|
edgggeTRON/cardano-explorer-app | stories/outdated-browser.stories.tsx | import { storiesOf } from '@storybook/react';
import React from 'react';
import styles from '../source/features/errors/ErrorPage.module.scss';
import OutdatedBrowser from '../source/features/outdated-browser/OutdatedBrowser';
import { Footer, Layout } from '../source/widgets/layout';
const ContainerBackground = require... |
edgggeTRON/cardano-explorer-app | source/features/transactions/ui/pages/TransactionPage.tsx | import Head from 'next/head';
import React from 'react';
import { StaticLayoutProps } from '../../../../lib/types';
import { ShrinkedHeaderLayout } from '../../../../widgets/layout/ShrinkedHeaderLayout';
import { useI18nFeature } from '../../../i18n/context';
import { i18nInitialProps } from '../../../i18n/utils';
impo... |
edgggeTRON/cardano-explorer-app | source/widgets/browsing/NavigationPagination.tsx | import { observer } from 'mobx-react-lite';
import React from 'react';
import { useNavigationFeature } from '../../features/navigation';
import Pagination from './Pagination';
export interface IPaginationProps {
currentPage: number;
itemsPerPage: number;
onChangePage?: (page: number) => void;
totalPages: numbe... |
edgggeTRON/cardano-explorer-app | source/features/transactions/components/TransactionList.tsx | import { observer } from 'mobx-react-lite';
import React from 'react';
import DividerWithTitle from '../../../widgets/divider-with-title/DividerWithTitle';
import LoadingSpinner from '../../../widgets/loading-spinner/LoadingSpinner';
import TransactionInfo, { ITransactionInfoProps } from './TransactionInfo';
import sty... |
edgggeTRON/cardano-explorer-app | source/features/epochs/store.ts | import isNumber from 'lodash/isNumber';
import { action, computed, observable, runInAction } from 'mobx';
import {
EpochOverviewFragment,
GetEpochsInRangeQuery,
} from '../../../generated/typings/graphql-schema';
import { ActionProps, createActionBindings } from '../../lib/ActionBinding';
import { GraphQLRequestVar... |
edgggeTRON/cardano-explorer-app | source/features/navigation/store.ts | import { isEmpty } from 'lodash';
import { action, observable } from 'mobx';
import { ParsedUrlQuery } from 'querystring';
import * as querystring from 'querystring';
import ReactGA from 'react-ga';
import URL from 'url';
import { environment } from '../../environment';
import { ActionProps, createActionBindings } from... |
edgggeTRON/cardano-explorer-app | source/features/search/ui/SearchFeatureProvider.tsx | import React, { useState } from 'react';
import { useGraphQLClient } from '../../../lib/graphql/GraphQLProvider';
import { useFeature } from '../../../lib/react/hooks';
import { useNavigationFeature } from '../../navigation';
import { useNetworkInfoFeature } from '../../network-info/context';
import { searchContext } f... |
edgggeTRON/cardano-explorer-app | source/widgets/loading-spinner/LoadingSpinner.tsx | <reponame>edgggeTRON/cardano-explorer-app
import classnames from 'classnames';
import React, { useRef } from 'react';
import styles from './LoadingSpinner.module.scss';
const SpinnerBig = require('../../public/assets/images/spinner-dark-big.inline.svg');
const SpinnerSmall = require('../../public/assets/images/spinner... |
edgggeTRON/cardano-explorer-app | source/features/search/ui/SearchBar.tsx | import { Address } from 'cardano-js';
import { AddressGroup } from 'cardano-js/dist/Address/AddressGroup';
import { ChainSettings } from 'cardano-js/dist/ChainSettings';
import cx from 'classnames';
import { useState } from 'react';
import React from 'react';
import {
BrandType,
CardanoEra,
CardanoNetwork,
Sear... |
edgggeTRON/cardano-explorer-app | source/widgets/table/TableBody.tsx | import { observer } from 'mobx-react-lite';
import React, { FC } from 'react';
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
import { IColumnDefinition } from './Table';
import styles from './TableBody.module.scss';
import TableBodyRow from './TableBodyRow';
export interface ITableBodyProps ... |
edgggeTRON/cardano-explorer-app | stories/support/PaddingDecorator.tsx | <gh_stars>10-100
import React from 'react';
import styles from './PaddingDecorator.scss';
interface IProps {
children: React.ReactNode;
}
export const PaddingDecorator = ({ children }: IProps) => (
<div className={styles.paddingContainer}>{children}</div>
);
|
edgggeTRON/cardano-explorer-app | source/features/stake-pools/hooks.ts | <reponame>edgggeTRON/cardano-explorer-app
import { useContext } from 'react';
import { stakePoolsContext } from './contexts';
export const useStakePools = () => {
const inbox = useContext(stakePoolsContext);
if (!inbox) {
throw new Error('You need to setup the inbox context before using it.');
}
return inb... |
edgggeTRON/cardano-explorer-app | stories/search.stories.tsx | import { storiesOf } from '@storybook/react';
import cx from 'classnames';
import { noop } from 'lodash';
import { useState } from 'react';
import React from 'react';
import { Button } from 'react-polymorph/lib/components/Button';
import { Input } from 'react-polymorph/lib/components/Input';
import { BrandType } from '... |
edgggeTRON/cardano-explorer-app | source/features/network-info/index.ts | import { GraphQLClient } from 'graphql-request';
import Action from '../../lib/Action';
import { NetworkInfoApi } from './api';
import { NetworkInfoStore } from './store';
/**
* Defines the actions that are supported by this feature
*/
export class NetworkInfoActions {
public fetchDynamic: Action<{}> = new Action(... |
edgggeTRON/cardano-explorer-app | source/features/transactions/components/TransactionsBrowser.tsx | import { observer } from 'mobx-react-lite';
import React, { useEffect } from 'react';
import { calculatePaging, ICalculatePagingOutputs } from '../../../lib/paging';
import Pagination from '../../../widgets/browsing/Pagination';
import LoadingSpinner from '../../../widgets/loading-spinner/LoadingSpinner';
import { useI... |
edgggeTRON/cardano-explorer-app | source/widgets/layout/ShrinkedHeaderLayout.tsx | <reponame>edgggeTRON/cardano-explorer-app
import React from 'react';
import { BrandType } from '../../constants';
import { Footer } from './Footer';
import { Header } from './Header';
import { Layout } from './Layout';
export const ShrinkedHeaderLayout = (props: { children: React.ReactNode }) => (
<Layout header={<H... |
edgggeTRON/cardano-explorer-app | source/features/transactions/helpers.ts | import { BLOCK_SEARCH_RESULT_PATH } from '../blocks/config';
import { EPOCH_SEARCH_RESULT_PATH } from '../epochs/config';
import { TRANSACTION_SEARCH_RESULT_PATH } from './config';
export const getTransactionRoute = (txId: string) =>
`${TRANSACTION_SEARCH_RESULT_PATH}?id=${txId}`;
export const getEpochRoute = (epoc... |
edgggeTRON/cardano-explorer-app | source/features/blocks/ui/BlocksFeatureProvider.tsx | import React, { useState } from 'react';
import { useGraphQLClient } from '../../../lib/graphql/GraphQLProvider';
import { useFeature } from '../../../lib/react/hooks';
import { useNetworkInfoFeature } from '../../network-info/context';
import { blocksContext } from '../context';
import { createBlocksFeature, IBlocksFe... |
edgggeTRON/cardano-explorer-app | source/pages/[locale]/index.tsx | import { LandingPage } from '../../features/landing-page/LandingPage';
export default LandingPage;
|
edgggeTRON/cardano-explorer-app | stories/support/fake-data-helpers.ts | import Chance from 'chance';
import { IBlockOverview } from '../../source/features/blocks/types';
const chance = new Chance();
export const generateFakeBlockOverview = (
overrides?: Partial<IBlockOverview>
): IBlockOverview => ({
createdAt: chance.date(),
createdBy: chance.string({ alpha: true, length: 7, casin... |
edgggeTRON/cardano-explorer-app | source/features/i18n/ui/I18nFeatureProvider.tsx | import React, { useState } from 'react';
import { useFeature } from '../../../lib/react/hooks';
import { i18nContext } from '../context';
import { createI18nFeature, I18nFeature } from '../index';
import { SupportedLocale } from '../types';
interface IProps {
locale: SupportedLocale;
children: React.ReactNode;
}
... |
edgggeTRON/cardano-explorer-app | source/features/blocks/index.ts | import { GraphQLClient } from 'graphql-request';
import Action from '../../lib/Action';
import { INetworkInfoFeature } from '../network-info';
import { BlocksApi } from './api';
import { BlocksStore } from './store';
/**
* Defines the actions that are supported by this feature
*/
export class BlocksActions {
publi... |
edgggeTRON/cardano-explorer-app | source/features/address/helpers.ts | import { ADDRESS_SEARCH_RESULT_PATH } from './config';
export const getAddressRoute = (address: string) =>
`${ADDRESS_SEARCH_RESULT_PATH}?address=${address}`;
|
edgggeTRON/cardano-explorer-app | source/features/navigation/index.ts | <reponame>edgggeTRON/cardano-explorer-app<filename>source/features/navigation/index.ts
import React, { useContext } from 'react';
import Action from '../../lib/Action';
import { debugActions } from '../../lib/logging';
import { ensureContextExists } from '../../lib/react/hooks';
import { I18nFeature } from '../i18n';
i... |
edgggeTRON/cardano-explorer-app | source/widgets/divider-with-title/DividerWithTitle.tsx | import React from 'react';
import styles from './DividerWithTitle.module.scss';
export interface IDividerWithTitleProps {
title: string;
}
const DividerWithTitle = (props: IDividerWithTitleProps) => (
<div className={styles.dividerContainer}>
<div className={styles.line} />
<span className={styles.title}>... |
edgggeTRON/cardano-explorer-app | source/pages/[locale]/block.tsx | import { BlockPage } from '../../features/blocks/ui/pages/BlockPage';
export default BlockPage;
|
edgggeTRON/cardano-explorer-app | source/lib/mobx/Reaction.ts | import { autorun } from 'mobx';
export default class Reaction {
private readonly reaction: () => void;
private isRunning: boolean = false;
private dispose: (() => void) | null = null;
constructor(reaction: () => void) {
this.reaction = reaction;
}
public start() {
if (!this.isRunning) {
t... |
edgggeTRON/cardano-explorer-app | source/features/stake-pools/helpers.ts | import { MouseEvent } from 'react';
import { SEARCH_FIELDS } from './constants';
import { IStakePoolProps, IStakePoolTooltipPositionProps } from './types';
const stakePoolsListSearch = (
stakePool: IStakePoolProps,
rawSearch: string
) => {
const search = rawSearch.replace(/[.*+?^${}()|[\]\\]/g, '\\$&').trim();
... |
edgggeTRON/cardano-explorer-app | source/features/search/specs/helpers/setup.ts | <filename>source/features/search/specs/helpers/setup.ts<gh_stars>10-100
import { graphqlClient } from '../../../../lib/graphql/graphqlClient';
import { createI18nFeature } from '../../../i18n';
import { SupportedLocale } from '../../../i18n/types';
import { NavigationActions } from '../../../navigation';
import { Navig... |
edgggeTRON/cardano-explorer-app | source/features/transactions/config.ts | export const TRANSACTION_SEARCH_RESULT_PATH = '/transaction';
|
edgggeTRON/cardano-explorer-app | source/lib/AbortablePromise.ts | export class AbortablePromise<TResult, TError> implements Promise<TResult> {
public static ABORT_ERROR = 'AbortError';
public readonly [Symbol.toStringTag]: string;
private isPending: boolean;
private isAborted: boolean;
private promise: Promise<TResult>;
private resolve: (result: TResult) => void;
priva... |
edgggeTRON/cardano-explorer-app | source/features/search/context.ts | import React from 'react';
import { ensureContextExists } from '../../lib/react/hooks';
import { ISearchFeature } from './index';
/**
* The React context that can be reused and configured with instances
* of the search feature (also multiple times on one page)
*/
export const searchContext = React.createContext<ISe... |
edgggeTRON/cardano-explorer-app | source/features/transactions/components/TransactionsFeatureProvider.tsx | import React, { useState } from 'react';
import { useGraphQLClient } from '../../../lib/graphql/GraphQLProvider';
import { useFeature } from '../../../lib/react/hooks';
import { transactionsContext } from '../context';
import { createTransactionsFeature, ITransactionsFeature } from '../index';
interface IProps {
chi... |
edgggeTRON/cardano-explorer-app | source/pages/[locale]/no-search-results.tsx | import NoSearchResultsPage from '../../features/search/ui/pages/NoSearchResultPage';
export default NoSearchResultsPage;
|
edgggeTRON/cardano-explorer-app | source/features/blocks/ui/BlockCreation.tsx | import { observer } from 'mobx-react-lite';
import DividerWithTitle from '../../../widgets/divider-with-title/DividerWithTitle';
import { useI18nFeature } from '../../i18n/context';
import styles from './BlockCreation.module.scss';
import BlockCreationRow, { IBlockCreationRowProps } from './BlockCreationRow';
export i... |
edgggeTRON/cardano-explorer-app | source/features/epochs/api/transformers.ts | <filename>source/features/epochs/api/transformers.ts
import { Currency } from 'cardano-js';
import { EpochOverviewFragment } from '../../../../generated/typings/graphql-schema';
import { NetworkInfoStore } from '../../network-info/store';
import { IEpochOverview } from '../types';
export const epochOverviewTransformer... |
edgggeTRON/cardano-explorer-app | source/pages/[locale]/outdated-browser.tsx | <gh_stars>10-100
import { OutdatedBrowserPage } from '../../features/outdated-browser/OutdatedBrowserPage';
export default OutdatedBrowserPage;
|
edgggeTRON/cardano-explorer-app | source/widgets/table/TableHead.tsx | import React, { FC } from 'react';
import { useI18nFeature } from '../../features/i18n/context';
import { IColumnDefinition } from './Table';
import styles from './TableHead.module.scss';
export interface ITableHeadProps {
columns: Array<IColumnDefinition>;
}
const TableHead: FC<ITableHeadProps> = ({ columns }) => ... |
edgggeTRON/cardano-explorer-app | source/features/search/specs/helpers/exampleBlockData.ts | export const exampleBlockData = {
epoch: 1,
id: '84e9de7924aba73f58b81e142f4bce7f1d00cf4630f94f631e6ca3594b2d1634',
merkelRootHash:
'0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8',
number: 31070,
previousBlock: {
id: '687bc1d9ff5b7c8167b25cca5659e80a40583512ba925271bf3005600eb0a0ec'... |
edgggeTRON/cardano-explorer-app | source/widgets/circular-progress/CircularProgress.tsx | import classnames from 'classnames';
import { observer } from 'mobx-react-lite';
import React from 'react';
import CircularProgressPin from '../../public/assets/images/epoch/epoch-filled.svg';
import styles from './CircularProgress.module.scss';
export enum CircularProgressSize {
SMALL = 'small',
BIG = 'big',
}
e... |
edgggeTRON/cardano-explorer-app | source/widgets/table/Table.tsx | import { observer } from 'mobx-react-lite';
import React, { FC } from 'react';
import DividerWithTitle from '../divider-with-title/DividerWithTitle';
import styles from './Table.module.scss';
import TableBody from './TableBody';
import TableHead from './TableHead';
export type Transform<D = any, T = any> = (d: D) => T... |
edgggeTRON/cardano-explorer-app | source/features/epochs/ui/EpochsFeatureProvider.tsx | <gh_stars>10-100
import React, { useState } from 'react';
import { useGraphQLClient } from '../../../lib/graphql/GraphQLProvider';
import { useFeature } from '../../../lib/react/hooks';
import { useBlocksFeature } from '../../blocks/context';
import { useNetworkInfoFeature } from '../../network-info/context';
import { ... |
edgggeTRON/cardano-explorer-app | source/features/outdated-browser/BrowserUpdate.tsx | <reponame>edgggeTRON/cardano-explorer-app
import { useLayoutEffect } from 'react';
import { useNavigationFeature } from '../navigation';
export const BrowserUpdate = () => {
const navigation = useNavigationFeature();
useLayoutEffect(() => {
const browserUpdate = require('browser-update/update.npm.js');
if ... |
edgggeTRON/cardano-explorer-app | source/pages/[locale]/browse-blocks.tsx | import { BrowseBlocksPage } from '../../features/blocks/ui/pages/BrowseBlocksPage';
export default BrowseBlocksPage;
|
edgggeTRON/cardano-explorer-app | source/widgets/layout/Footer.tsx | <reponame>edgggeTRON/cardano-explorer-app<filename>source/widgets/layout/Footer.tsx
import classnames from 'classnames';
import React from 'react';
import { useI18nFeature } from '../../features/i18n/context';
import styles from './Footer.module.scss';
const iohkLogo = require('../../public/assets/images/iohk-logo.png... |
edgggeTRON/cardano-explorer-app | source/features/transactions/index.ts | <reponame>edgggeTRON/cardano-explorer-app
import { GraphQLClient } from 'graphql-request';
import Action from '../../lib/Action';
import { TransactionsApi } from './api';
import { TransactionsStore } from './store';
/**
* Defines the actions that are supported by this feature
*/
export class TransactionsActions {
... |
edgggeTRON/cardano-explorer-app | source/features/blocks/context.ts | import React from 'react';
import { ensureContextExists } from '../../lib/react/hooks';
import { IBlocksFeature } from './index';
/**
* React context used for this feature
*/
export const blocksContext = React.createContext<IBlocksFeature | null>(null);
/**
* Custom react hook that is used in container components t... |
edgggeTRON/cardano-explorer-app | source/features/stake-pools/containers/StakePoolsContainer.tsx | <reponame>edgggeTRON/cardano-explorer-app<gh_stars>10-100
import React from 'react';
import { stakePoolsContext } from '../contexts';
import { stakePoolsContextDefault } from '../index';
import { StakePoolsComponentContainer } from './StakePoolsComponentContainer';
const StakePoolsContainer = () => (
<stakePoolsCon... |
edgggeTRON/cardano-explorer-app | source/styles/theme/PolymorphThemeProvider.tsx | import React from 'react';
import { ThemeProvider } from 'react-polymorph/lib/components/ThemeProvider';
import { Skins } from './skins';
import { reactPolymorphTheme } from './theme';
interface IProps {
children: React.ReactNode;
}
const PolymorphThemeProvider = ({ children }: IProps) => (
<ThemeProvider theme=... |
edgggeTRON/cardano-explorer-app | source/features/address/types.ts | export interface IAddressSummary {
address: string;
finalBalance: string;
transactionsCount: string;
}
|
edgggeTRON/cardano-explorer-app | source/features/stake-pools/contexts.ts | import React from 'react';
import { IStakePoolsContext } from './types';
export const stakePoolsContext = React.createContext<IStakePoolsContext | null>(
null
);
|
edgggeTRON/cardano-explorer-app | source/features/outdated-browser/OutdatedBrowser.tsx | <filename>source/features/outdated-browser/OutdatedBrowser.tsx
import React, { Component, useEffect } from 'react';
import { useI18nFeature } from '../i18n/context';
import styles from './OutdatedBrowser.module.scss';
const CardanoLogo = require('../../public/assets/images/header/cardano-logo.svg');
const ContainerBac... |
edgggeTRON/cardano-explorer-app | source/lib/mobx/react.ts | <filename>source/lib/mobx/react.ts
import { autorun } from 'mobx';
import { useAsObservableSource } from 'mobx-react-lite';
import * as React from 'react';
/**
* Sets up a react effect as an autorun (tracks mobx observables).
* Normal props can also be passed as second argument which are then turned
* into an obser... |
edgggeTRON/cardano-explorer-app | source/features/stake-pools/api.ts | import { GraphQLClient } from 'graphql-request';
// import {
// GetBlocksQuery,
// GetBlocksQueryVariables,
// } from '../../../generated/typings/graphql-schema';
// import { GraphQLRequest } from '../../utils/graphql/GraphQLRequest';
// import getBlocksQuery from './graphql/getBlocks.graphql';
export class Stake... |
edgggeTRON/cardano-explorer-app | source/features/transactions/api/index.ts | import { GraphQLClient } from 'graphql-request';
import {
GetAddressTransactionsQuery,
GetAddressTransactionsQueryVariables,
GetBlockTransactionsQuery,
GetBlockTransactionsQueryVariables,
} from '../../../../generated/typings/graphql-schema';
import { GraphQLRequest } from '../../../lib/graphql/GraphQLRequest';... |
edgggeTRON/cardano-explorer-app | source/widgets/language-switcher/LanguageSwitcher.tsx | import classnames from 'classnames';
import React, { useState } from 'react';
import { SupportedLocale } from '../../features/i18n/types';
import styles from './LanguageSwitcher.module.scss';
export interface ILocaleProps {
code: SupportedLocale;
title: string;
}
export interface ILanguageSwitcherParams {
curre... |
edgggeTRON/cardano-explorer-app | source/pages/_document.tsx | <gh_stars>10-100
import Document, { Head, Html, Main, NextScript } from 'next/document';
import React from 'react';
import { DEFAULT_LOCALE } from '../features/i18n';
import { cardanoExplorerTheme } from '../styles/theme/theme';
class CardanoExplorerDocument extends Document {
public render() {
const lang =
... |
edgggeTRON/cardano-explorer-app | source/styles/theme/skins.tsx | import { IDENTIFIERS } from 'react-polymorph/lib/components';
import { ButtonSkin } from 'react-polymorph/lib/skins/simple/ButtonSkin';
import { FormFieldSkin } from 'react-polymorph/lib/skins/simple/FormFieldSkin';
import { InputSkin } from 'react-polymorph/lib/skins/simple/InputSkin';
export const Skins = {
[IDENT... |
edgggeTRON/cardano-explorer-app | source/lib/Action.ts | <reponame>edgggeTRON/cardano-explorer-app
/**
* Listener type as Function that takes specific params <P>
*/
type Listener<P> = (params: P) => any;
/**
* Action class with typed params
*/
export default class Action<Params> {
public static resetAllActions() {
Action.actions.forEach((action) => action.removeAl... |
edgggeTRON/cardano-explorer-app | source/pages/[locale]/epoch.tsx | import { EpochPage } from '../../features/epochs/ui/pages/EpochPage';
export default EpochPage;
|
edgggeTRON/cardano-explorer-app | source/features/stake-pools/store.ts | import { action, computed, observable } from 'mobx';
import storage from 'store';
import { createActionBindings } from '../../lib/ActionBinding';
import { Store } from '../../lib/Store';
import { StakePoolsActions } from './actions';
import { StakePoolsApi } from './api';
import {
UNMODERATED_WARNING_PERIOD,
UNMODE... |
edgggeTRON/cardano-explorer-app | source/lib/enums.ts | export const EnumToArray = (e: any) => Object.keys(e).map((key) => e[key]);
|
edgggeTRON/cardano-explorer-app | source/features/epochs/ui/pages/EpochPage.tsx | <filename>source/features/epochs/ui/pages/EpochPage.tsx
import Head from 'next/head';
import React from 'react';
import { StaticLayoutProps } from '../../../../lib/types';
import { ShrinkedHeaderLayout } from '../../../../widgets/layout/ShrinkedHeaderLayout';
import { BlocksFeatureProvider } from '../../../blocks/ui/Bl... |
edgggeTRON/cardano-explorer-app | source/lib/colors.ts | <filename>source/lib/colors.ts<gh_stars>10-100
import chroma from 'chroma-js';
import { isNil } from 'lodash';
// Ranking 001: hsla(142, 76%, 45%, 1)
// Ranking 100: hsla(15, 97%, 58%, 1)
interface IRangeOptions {
colors?: Array<any>;
domain?: Array<number>;
darken?: number;
brighten?: number;
alpha?: numbe... |
edgggeTRON/cardano-explorer-app | source/features/blocks/specs/helpers/latestBlocksExample.ts | export const latestBlocksExample = [
{
createdAt: '2017-10-01T02:26:51',
createdBy: 'af2800c',
epoch: 1,
id: '84e9de7924aba73f58b81e142f4bce7f1d00cf4630f94f631e6ca3594b2d1634',
number: 31070,
output: 11189.647356,
size: 666,
slotNumber: 31086,
transactions: [],
},
{
created... |
edgggeTRON/cardano-explorer-app | source/features/i18n/utils.ts | <filename>source/features/i18n/utils.ts<gh_stars>10-100
import { NextPageContext } from 'next';
import { SUPPORTED_LOCALES } from './index';
interface IContext extends NextPageContext {
language: string;
}
export const i18nInitialProps = async (context: IContext) => {
return {
locale: context.query.locale,
... |
edgggeTRON/cardano-explorer-app | source/pages/[locale]/transaction.tsx | import { TransactionPage } from '../../features/transactions/ui/pages/TransactionPage';
export default TransactionPage;
|
edgggeTRON/cardano-explorer-app | source/features/epochs/ui/StakeDistribution.tsx | <reponame>edgggeTRON/cardano-explorer-app<filename>source/features/epochs/ui/StakeDistribution.tsx
import { observer } from 'mobx-react-lite';
import DividerWithTitle from '../../../widgets/divider-with-title/DividerWithTitle';
import { useI18nFeature } from '../../i18n/context';
import styles from './StakeDistribution... |
blackbird014/app | webapp/src/containers/PopOver/saga.tsx | <reponame>blackbird014/app
import { takeLatest, call, put } from 'redux-saga/effects';
import showNotification from '../../utils/notifications';
import { getErrorMessage, getNetworkType } from '../../utils/utility';
import {
backupLoadingStart,
backupWalletStart,
closeBackupWalletWarningModal,
closeEncryptWall... |
blackbird014/app | webapp/src/constants/rpcMethods.ts | <reponame>blackbird014/app<gh_stars>1-10
export const GET_BLOCKCHAIN_INFO = 'getblockchaininfo';
export const SEND_TO_ADDRESS = 'sendtoaddress';
export const SEND_MANY = 'sendmany';
export const VALIDATE_ADDRESS = 'validateaddress';
export const LIST_RECEIVED_BY_ADDRESS = 'listreceivedbyaddress';
export const GET_NEW_A... |
blackbird014/app | webapp/src/containers/SwapPage/components/SwapTab/index.tsx | import React, { useEffect } from 'react';
import { Row, Col, Button } from 'reactstrap';
import { MdCompareArrows } from 'react-icons/md';
import { I18n } from 'react-redux-i18n';
import SwapCard from '../../../../components/SwapCard';
import { fetchPoolsharesRequest } from '../../reducer';
import styles from './swapT... |
blackbird014/app | webapp/src/containers/LiquidityPage/components/RemoveLiquidity/index.tsx | <reponame>blackbird014/app<filename>webapp/src/containers/LiquidityPage/components/RemoveLiquidity/index.tsx
import React, { useEffect, useState } from 'react';
import { Helmet } from 'react-helmet';
import { MdArrowBack, MdCheckCircle, MdErrorOutline } from 'react-icons/md';
import { I18n } from 'react-redux-i18n';
im... |
blackbird014/app | webapp/src/containers/WalletPage/components/Tokens/AddToken/index.tsx | // Not in use component. Don't delete it for future purposes
import React, { useState, useEffect } from 'react';
import { NavLink as RRNavLink } from 'react-router-dom';
import { I18n } from 'react-redux-i18n';
import { connect } from 'react-redux';
import { Helmet } from 'react-helmet';
import { MdSearch, MdArrowBack... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.