repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
nnluukhtn/luxurify
web/src/app/common/components/AttachmentUpload/index.tsx
import React from 'react'; import { Button } from 'antd'; import { RcFile } from 'antd/lib/upload'; import Styled from './styles'; import NormalItem from './NormalItem'; import ImageItem from './ImageItem'; import VideoItem from './VideoItem'; import { Attachment, AttachmentFile } from './types'; import useNotification...
nnluukhtn/luxurify
web/src/app/pages/SignIn/components/SignInForm.tsx
import { Col, Row } from 'antd'; import Colors from 'app/common/Colors'; import InputForm from 'app/common/components/InputForm'; import { Spacer, StyledButton } from 'app/common/styles'; import { makeSelectLocation } from 'app/selectors'; import { useFormik } from 'formik'; import { ApiResponse } from 'global/services...
nnluukhtn/luxurify
web/src/app/pages/Admin/SignIn/actionTypes.ts
enum ActionTypes { ADMIN_SIGN_IN = 'sign_in/ADMIN_SIGN_IN', } export default ActionTypes;
nnluukhtn/luxurify
web/src/app/pages/RegisterWatch/components/RegisterWatchForms.tsx
<reponame>nnluukhtn/luxurify<filename>web/src/app/pages/RegisterWatch/components/RegisterWatchForms.tsx import React, { useCallback, useEffect, useMemo, useState } from 'react'; import InputForm from 'app/common/components/InputForm'; import { FormContainer, Header, Spacer, StyledButton, SubHeader, } from 'ap...
nnluukhtn/luxurify
mobile/frontend/constants/defaultHeader.ts
const defaultHeader = { "X-API-KEY": <KEY>", "Content-Type": "application/json", }; export default defaultHeader;
nnluukhtn/luxurify
web/src/app/common/components/AttachmentUpload/ImageItem.tsx
<reponame>nnluukhtn/luxurify import { Tooltip } from 'antd'; import Styled from './styles'; import React from 'react'; import { RcFile } from 'antd/lib/upload'; interface Props { file: RcFile; onRemove: (file: RcFile) => void; } const ImageItem = ({ file, onRemove, ...props }: Props) => { const handleOnRemove = ...
nnluukhtn/luxurify
web/src/app/common/components/Balance/index.tsx
import React from 'react'; import styled from 'styled-components'; interface Props { children: React.ReactNode; } const Balance = ({ children }: Props) => { return ( <BalanceContainer> <BalanceLabel>Balance: </BalanceLabel> <BalanceNumber>{children}</BalanceNumber> </BalanceContainer> ); }; ...
nnluukhtn/luxurify
web/src/app/pages/Admin/Brands/slice/types.ts
import { ApiResponse } from '../../../../../global/services/api/types'; export interface AdminBrandsState { readonly byId?: BrandByIds; readonly allIds?: number[]; readonly isLoading: boolean; } export interface BrandByIds { [id: number]: BrandInfo; } export interface BrandInfo { id: number; brand: Brand...
nnluukhtn/luxurify
mobile/frontend/features/Camera/Scanner/index.tsx
<reponame>nnluukhtn/luxurify import { StyleSheet } from "react-native"; import styled from "styled-components/native"; import { Ionicons } from "@expo/vector-icons"; import React, { useState, useEffect } from "react"; import { useNavigation, useRoute } from "@react-navigation/native"; import { BarCodeScannedCallback, B...
nnluukhtn/luxurify
web/src/app/pages/Watches/WatchDetail/index.tsx
<reponame>nnluukhtn/luxurify /** * * WatchDetail * */ import { Col, Image, Row, Skeleton } from 'antd'; import Colors from 'app/common/Colors'; import { PageContainer } from 'app/common/components'; import { BackgroundContainer, Header, Spacer } from 'app/common/styles'; import * as React from 'react'; import { use...
nnluukhtn/luxurify
mobile/scripts/postinstall.ts
<gh_stars>0 import 'dotenv/config'; import * as child_process from 'child_process'; child_process.execSync('npx pod-install', { stdio: 'inherit' });
nnluukhtn/luxurify
web/src/index.tsx
<gh_stars>0 /** * index.tsx * * This is the entry file for the application, only setup and boilerplate * code. */ import 'react-app-polyfill/ie11'; import 'react-app-polyfill/stable'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import history fro...
nnluukhtn/luxurify
contracts/scripts/fund_luxurify_contract.ts
// We require the Hardhat Runtime Environment explicitly here. This is optional // but useful for running the script in a standalone fashion through `node <script>`. // // When running the script with `hardhat run <script>` you'll find the Hardhat // Runtime Environment's members available in the global scope. import {...
nnluukhtn/luxurify
web/src/app/common/components/NavigationBar/components/Subtitle.tsx
<gh_stars>0 import React from 'react'; import { User } from 'utils/SessionActions/types'; interface ComponentProps { user?: User; isAuthenticated?: boolean; } const Subtitle = ({ user, isAuthenticated }: ComponentProps) => { return !!user && isAuthenticated ? ( <> {user.isAdmin ? 'Admin: ' : 'welcome'...
nnluukhtn/luxurify
web/src/app/pages/SignUp/types.ts
import { ApiResponse } from 'global/services/api/types'; export interface UserPayload { email: string; password: string; password_confirmation: string; } export interface UserParams { user: UserPayload; } export interface CreateUserResponse extends ApiResponse { response: { created_at: string; emai...
nnluukhtn/luxurify
web/src/app/common/styles.ts
import { Input as AntInput, Button as AntBtn, Checkbox as AntCheckbox, } from 'antd'; import styled from 'styled-components'; import { Background } from './assets'; import Colors from './Colors'; export const Container = styled.div` height: 100vh; width: 100vw; padding-bottom: 5rem; `; export const Backgr...
nnluukhtn/luxurify
web/src/app/common/components/EthBalance/index.tsx
<filename>web/src/app/common/components/EthBalance/index.tsx<gh_stars>0 import { Web3Provider } from '@ethersproject/providers'; import { formatEther } from '@ethersproject/units'; import { useWeb3React } from '@web3-react/core'; import React, { useEffect } from 'react'; import useSWR from 'swr'; import fetcher from 'u...
nnluukhtn/luxurify
mobile/frontend/features/Main/index.tsx
import React from "react"; import { createMaterialBottomTabNavigator } from "@react-navigation/material-bottom-tabs"; import { SimpleLineIcons, AntDesign, Feather } from "@expo/vector-icons"; // Import Internal import Logout from "../Logout"; import HomeScreen from "../HomeScreen"; import Inventory from "../Inventory"...
nnluukhtn/luxurify
web/src/app/pages/Watches/WatchDetail/components/WatchQR/QRCodePrint.tsx
<reponame>nnluukhtn/luxurify<filename>web/src/app/pages/Watches/WatchDetail/components/WatchQR/QRCodePrint.tsx import React from 'react'; import QRCode from 'qrcode.react'; import styled, { createGlobalStyle } from 'styled-components'; import Colors from 'app/common/Colors'; import { Spacer } from 'app/common/styles'; ...
nnluukhtn/luxurify
web/src/app/pages/RegisterBrand/adapter.ts
<filename>web/src/app/pages/RegisterBrand/adapter.ts import { BrandPayload, RegisterBrandParams, WSBrand, WSBrandResponse, } from './slice/types'; export const registerBrandAdapter = ( brandPayload: BrandPayload, ): RegisterBrandParams => { return { brand: { name: brandPayload.name, categor...
nnluukhtn/luxurify
web/src/app/pages/SignIn/actionTypes.ts
enum ActionTypes { SIGN_IN = 'sign_in/SIGN_IN', } export default ActionTypes;
nnluukhtn/luxurify
web/src/app/pages/HomePage/index.tsx
<reponame>nnluukhtn/luxurify import * as React from 'react'; import Wallet from 'app/common/components/Wallet'; import { Helmet } from 'react-helmet-async'; import { BackgroundContainer, Header, StyledButton } from 'app/common/styles'; import { useHistory } from 'react-router-dom'; import { selectUser } from 'utils/Ses...
nnluukhtn/luxurify
web/src/utils/saveSessionAsCookies.ts
import Cookies from 'js-cookie'; export const saveSessionAsCookies = ( userId: string, accessToken: string, email?: string, ) => { Cookies.set('id', userId); Cookies.set('email', email || ''); Cookies.set('accessToken', accessToken); Cookies.set('refreshToken', accessToken); };
nnluukhtn/luxurify
web/src/app/common/components/InputForm/AutoComplete.tsx
<reponame>nnluukhtn/luxurify import { AutoComplete } from 'antd'; import React, { useState } from 'react'; import styled from 'styled-components'; export interface Option { label: string | React.ReactNode; value: string; } export type Options = Option[]; interface Props { options: Options; placeholder: strin...
nnluukhtn/luxurify
web/src/app/common/components/Wallet/index.tsx
import React, { useEffect } from 'react'; import { Web3Provider } from '@ethersproject/providers'; import { useWeb3React } from '@web3-react/core'; import { injectedConnector } from 'index'; import EthBalance from '../EthBalance'; import TokenList from '../TokenList'; import { SWRConfig } from 'swr'; import fetcher fro...
nnluukhtn/luxurify
web/src/global/services/api/adapters.ts
<reponame>nnluukhtn/luxurify import { AxiosResponse } from 'axios'; import { ApiResponse } from './types'; export const responseAdapter = (response: AxiosResponse): ApiResponse => ({ success: response.status >= 200 && response.status <= 302, response: response.data, request: response.config, header: response.h...
nnluukhtn/luxurify
mobile/frontend/features/Inventory/Detail/constants.ts
export enum InventoryModal { NONE = "NONE", QR_SCAN = "QR_SCAN", }
nnluukhtn/luxurify
web/src/global/services/api/constants.ts
<gh_stars>0 export const defaultHeaders = { 'Content-Type': 'application/json' };
nnluukhtn/luxurify
web/src/app/pages/SignIn/actions.ts
import { action } from 'typesafe-actions'; import ActionTypes from './actionTypes'; import { SignInPayload, SignInResponse } from './types'; export const signIn = ( userPayload: SignInPayload, onSuccess: (resonse: SignInResponse) => void, onFailed: (msg?: string[]) => void, ) => action(ActionTypes.SIGN_IN, { use...
nnluukhtn/luxurify
web/src/app/pages/RegisterWatch/slice/types.ts
<gh_stars>0 import { RcFile } from 'antd/lib/upload'; import { ApiResponse } from 'global/services/api/types'; /* --- STATE --- */ export interface RegisterWatchState { readonly wsWatchData?: WSWatchData; readonly isLoading: boolean; } export interface WSWatchData { byId: { [id: string]: WSWatch; }; } ex...
nnluukhtn/luxurify
web/src/app/common/components/PageContainer/index.tsx
import React from 'react'; import { Scrollbars } from 'react-custom-scrollbars'; import styled from 'styled-components'; const Container = styled.div` flex: 1; height: 100%; width: 100%; `; const InnerContainer = styled.div` ${(props: Props) => props.fluid ? ` flex: 1; padding: 0 40px; m...
nnluukhtn/luxurify
contracts/hardhat.config.ts
<reponame>nnluukhtn/luxurify import { HardhatUserConfig } from "hardhat/types"; import "@nomiclabs/hardhat-waffle"; import "@nomiclabs/hardhat-etherscan"; import "hardhat-typechain"; import "hardhat-deploy"; import { config as dotEnvConfig } from "dotenv"; dotEnvConfig(); // You need to export an object to set up you...
nnluukhtn/luxurify
mobile/frontend/features/Login/index.tsx
<filename>mobile/frontend/features/Login/index.tsx import React from "react"; import styled from "styled-components/native"; /// interface Props { onPress: () => Promise<any>; } const Login: React.FC<Props> = ({ onPress }) => { // Main return return ( <Container> <Group> <Header>LUXURIFY</Head...
nnluukhtn/luxurify
web/src/app/common/components/EtherView/index.tsx
import React from 'react'; import useSWR from 'swr'; import { useWeb3React } from '@web3-react/core'; import { Web3Provider } from '@ethersproject/providers'; import { formatEther } from '@ethersproject/units'; import { BigNumber } from '@ethersproject/bignumber'; export const EtherView = () => { const { account, li...
nnluukhtn/luxurify
web/src/constants.ts
<reponame>nnluukhtn/luxurify export const Networks = { MainNet: 1, Rinkeby: 4, Ropsten: 3, Kovan: 42, Goerli: 5, Localhost: 1337, };
nnluukhtn/luxurify
mobile/frontend/features/Inventory/Grid/atoms.ts
import { atom } from "recoil"; import { Watch, WatchMeta } from "../../../types"; import { OrderResponse } from "./utils"; const initialValue: Array<Watch & OrderResponse & Partial<WatchMeta>> = []; export const watchListState = atom({ key: "watchList", // unique ID (with respect to other atoms/selectors) defaul...
nnluukhtn/luxurify
web/src/app/common/Colors.ts
<filename>web/src/app/common/Colors.ts const Colors = { N900_BLACK: '#292D37', N800_BLACK: '#343A47', N700_BLACK: '#474D5B', N600_BLACK: '#585C67', N500_GREY: '#7B7F8A', N400_GREY: '#9297A3', N300_GREY: '#C1C3C9', N200_GREY: '#D8DAE0', N100_GREY: '#E1E3EA', N90_GREY: '#F1F3F9', N80_GREY: '#F8F9FC'...
nnluukhtn/luxurify
web/src/global/services/api/index.ts
<reponame>nnluukhtn/luxurify /* tslint:disable:no-export-default */ import { call } from 'redux-saga/effects'; import { APIParams, ApiResponse } from './types'; import axios from './axios'; function* callApi(apiParams: APIParams) { try { const response: ApiResponse = yield call(axios, apiParams); return resp...
nnluukhtn/luxurify
web/src/app/pages/Admin/Brands/slice/index.ts
import { useInjectReducer, useInjectSaga } from 'utils/redux-injectors'; import { createSlice } from '@reduxjs/toolkit'; import { AdminBrandsState } from './types'; import saga from './saga'; import _ from 'lodash'; export const initialState: AdminBrandsState = { isLoading: false }; const brandSlice = createSlice({ ...
nnluukhtn/luxurify
mobile/frontend/types/WatchData.ts
<filename>mobile/frontend/types/WatchData.ts import Watch from "./Watch"; import WatchMeta from "./WatchMeta"; import OrderResponse from "./OrderResponse"; type WatchData = Watch & Partial<WatchMeta> & OrderResponse & { isOwner: boolean; }; export default WatchData;
nnluukhtn/luxurify
web/src/app/pages/RegisterBrand/actionTypes.ts
<gh_stars>0 enum ActionTypes { REGISTER_BRAND = 'register-brand', } export default ActionTypes;
nnluukhtn/luxurify
web/src/app/pages/SignUp/index.tsx
import Colors from 'app/common/Colors'; import { PageContainer } from 'app/common/components'; import { BackgroundContainer } from 'app/common/styles'; import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import RegistrationForm from './components/RegistrationForm'; export function SignUp() { ...
nnluukhtn/luxurify
web/src/app/pages/RegisterWatch/Loadable.ts
<reponame>nnluukhtn/luxurify /** * * Asynchronously loads the component for RegisterWatch * */ import { lazyLoad } from 'utils/loadable'; export const RegisterWatch = lazyLoad( () => import('./index'), module => module.RegisterWatch, );
nnluukhtn/luxurify
web/src/utils/hooks/RouterHook/useParams.ts
<filename>web/src/utils/hooks/RouterHook/useParams.ts import { useState, useMemo } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { getSearch, push } from 'connected-react-router'; import queryString from 'query-string'; import _ from 'lodash'; function useParams(keepBoolean?: boolean, in...
nnluukhtn/luxurify
contracts/scripts/generate_watches.ts
// We require the Hardhat Runtime Environment explicitly here. This is optional // but useful for running the script in a standalone fashion through `node <script>`. // // When running the script with `hardhat run <script>` you'll find the Hardhat // Runtime Environment's members available in the global scope. import {...
nnluukhtn/luxurify
web/src/app/selectors.ts
import { createSelector } from 'reselect'; import { RootState } from 'types'; const selectRoute = (state: RootState) => state.router; const makeSelectLocation = () => createSelector(selectRoute, routeState => routeState.location); export { makeSelectLocation };
nnluukhtn/luxurify
web/src/app/common/components/InputForm/index.tsx
import { InputProps, Select, SelectProps } from 'antd'; import { FormContainer, FormLabel, Spacer, StyledInput, } from 'app/common/styles'; import React from 'react'; import styled from 'styled-components'; import ErrorContainer from '../ErrorContainer'; import InputPassword from '../InputPassword'; import Auto...
nnluukhtn/luxurify
web/src/app/pages/Watches/WatchDetail/components/Buy/index.tsx
import Modal from 'antd/lib/modal/Modal'; import { StyledButton } from 'app/common/styles'; import React, { useContext, useEffect, useState } from 'react'; import { seaportContext } from 'contexts/SeaportContext'; import { OpenSeaAsset } from 'opensea-js/lib/types'; import { TOKENS_BY_NETWORK } from 'app/common/compone...
nnluukhtn/luxurify
web/src/app/pages/Admin/Brands/slice/saga.ts
<filename>web/src/app/pages/Admin/Brands/slice/saga.ts import callApi from 'global/services/api'; import { ApiResponse } from 'global/services/api/types'; import { all, put, takeLatest } from 'redux-saga/effects'; import { approveBrand, rejectBrand, fetchPendingBrands, fetchPendingBrandsFailed, fetchPendingBr...
nnluukhtn/luxurify
web/src/store/reducers.ts
<reponame>nnluukhtn/luxurify<filename>web/src/store/reducers.ts /** * Combine all reducers in this file and export the combined reducers. */ import { combineReducers } from '@reduxjs/toolkit'; import { connectRouter } from 'connected-react-router'; import sessionReducer from 'utils/SessionActions/SessionReducer'; im...
edgggeTRON/cardano-explorer-app
source/features/epochs/ui/EpochsBrowser.tsx
import { debounce } from 'lodash'; import { observer } from 'mobx-react-lite'; import React, { useEffect, useState } from 'react'; import { useObservableEffect } from '../../../lib/mobx/react'; import { calculatePaging, ICalculatePagingOutputs } from '../../../lib/paging'; import NavigationPagination from '../../../wid...
edgggeTRON/cardano-explorer-app
source/features/blocks/ui/pages/BrowseBlocksPage.tsx
<filename>source/features/blocks/ui/pages/BrowseBlocksPage.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...
edgggeTRON/cardano-explorer-app
stories/stake-pools.stories.tsx
import { action } from '@storybook/addon-actions'; import { storiesOf } from '@storybook/react'; import React, { Children, cloneElement, Fragment, useState } from 'react'; import StakePoolsList from '../source/features/stake-pools/components/StakePoolsList'; import StakePoolThumbnail from '../source/features/stake-pool...
edgggeTRON/cardano-explorer-app
source/lib/paging.spec.ts
import { calculatePaging } from './paging'; describe('Paging calculation', () => { it('per page defaults to 5 items', () => { const result = calculatePaging({ totalItems: 10, }); expect(result.currentPage).toEqual(2); }); it('per page minimum is 1 item by default', () => { const result = c...
edgggeTRON/cardano-explorer-app
source/features/transactions/api/transformers.ts
import { Currency } from 'cardano-js'; import { TransactionDetailsFragment } from '../../../../generated/typings/graphql-schema'; import { ITransactionDetails } from '../types'; export const transactionDetailsTransformer = ( tx: TransactionDetailsFragment ): ITransactionDetails => ({ block: { epoch: tx.block?....
edgggeTRON/cardano-explorer-app
source/features/stake-pools/actions.ts
import Action from '../../lib/Action'; export class StakePoolsActions { public handleAcceptUnmoderatedData: Action<any> = new Action(); }
edgggeTRON/cardano-explorer-app
source/pages/[locale]/address.tsx
import { AddressPage } from '../../features/address/ui/pages/AddressPage'; export default AddressPage;
edgggeTRON/cardano-explorer-app
source/features/address/ui/AddressSummary.tsx
import { observer } from 'mobx-react-lite'; import QRCode from 'qrcode.react'; import DividerWithTitle from '../../../widgets/divider-with-title/DividerWithTitle'; import { useI18nFeature } from '../../i18n/context'; import styles from './AddressSummary.module.scss'; export interface IAddressSummaryProps { address: ...
edgggeTRON/cardano-explorer-app
source/features/i18n/types.ts
export enum SupportedLocale { EN = 'en', DE = 'de', JA = 'ja', }
edgggeTRON/cardano-explorer-app
source/helpers.ts
import { SCREEN_BREAKPOINTS } from './constants'; export const isMobileScreen = () => screen.width < SCREEN_BREAKPOINTS.XS;
edgggeTRON/cardano-explorer-app
source/widgets/layout/Header.tsx
import cx from 'classnames'; import { observer } from 'mobx-react-lite'; import React from 'react'; import { BrandType, CardanoEra, CardanoNetwork } from '../../constants'; import { environment } from '../../environment'; import { useI18nFeature } from '../../features/i18n/context'; import { useNavigationFeatureOptiona...
edgggeTRON/cardano-explorer-app
source/features/epochs/ui/LatestEpochs.tsx
import { Observer } from 'mobx-react-lite'; import React, { useEffect } from 'react'; import ShowMoreButtonDecorator from '../../../widgets/decorators/ShowMoreButtonDecorator'; import LoadingSpinner from '../../../widgets/loading-spinner/LoadingSpinner'; import { useI18nFeature } from '../../i18n/context'; import { use...
edgggeTRON/cardano-explorer-app
source/features/blocks/helpers.ts
<reponame>edgggeTRON/cardano-explorer-app import { BLOCK_SEARCH_RESULT_PATH } from './config'; export const getBlockRoute = (blockId: string) => `${BLOCK_SEARCH_RESULT_PATH}?id=${blockId}`;
edgggeTRON/cardano-explorer-app
source/features/i18n/context.ts
import React from 'react'; import { ensureContextExists } from '../../lib/react/hooks'; import { I18nFeature } from './index'; /** * React context used for this feature */ export const i18nContext = React.createContext<I18nFeature | null>(null); /** * Custom react hook that is used in container components to * acc...
edgggeTRON/cardano-explorer-app
source/lib/paging.ts
interface ICalculatePagingInputs { currentPage?: number | string; // user input perPage?: number | string; // user input perPageDefault?: number; perPageMaximum?: number; perPageMinimum?: number; totalItems: number; } export interface ICalculatePagingOutputs { currentPage: number; itemsPerPage: number;...
edgggeTRON/cardano-explorer-app
source/features/errors/ErrorPage.tsx
import Head from 'next/head'; import React from 'react'; import { BrandType } from '../../constants'; import { PageComponentWithStaticLayout } from '../../lib/types'; import { Footer, Header, Layout } from '../../widgets/layout'; import { useI18nFeature } from '../i18n/context'; import styles from './ErrorPage.module.s...
edgggeTRON/cardano-explorer-app
source/widgets/layout/Layout.tsx
import { without } from 'lodash'; import React from 'react'; import { SUPPORTED_LOCALES } from '../../features/i18n'; import { useI18nFeature } from '../../features/i18n/context'; import Container from '../container/Container'; import LanguageSwitcher from '../language-switcher/LanguageSwitcher'; import styles from './...
edgggeTRON/cardano-explorer-app
source/pages/index.tsx
import Head from 'next/head'; import { useRouter } from 'next/router'; import React from 'react'; import { useI18nFeature } from '../features/i18n/context'; /** * The index page is the only correct route that does not have * the requested locale embedded in the URL. That's why we redirect * either to the default lo...
edgggeTRON/cardano-explorer-app
stories/language-switcher.stories.tsx
<filename>stories/language-switcher.stories.tsx import { storiesOf } from '@storybook/react'; import React from 'react'; import { SupportedLocale } from '../source/features/i18n/types'; import LanguageSwitcher from '../source/widgets/language-switcher/LanguageSwitcher'; const currentLanguage = { code: SupportedLocal...
edgggeTRON/cardano-explorer-app
source/features/epochs/ui/pages/BrowseEpochsPage.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/BlocksFeatureProvider'; import { useI18nFeature } from '.....
edgggeTRON/cardano-explorer-app
source/pages/[locale]/browse-epochs.tsx
import { BrowseEpochsPage } from '../../features/epochs/ui/pages/BrowseEpochsPage'; export default BrowseEpochsPage;
edgggeTRON/cardano-explorer-app
stories/support/I18nDecorator.tsx
import React from 'react'; import { SupportedLocale } from '../../source/features/i18n/types'; import { I18nFeatureProvider } from '../../source/features/i18n/ui/I18nFeatureProvider'; interface IProps { children: React.ReactNode; } export const I18nDecorator = ({ children }: IProps) => ( <I18nFeatureProvider loca...
edgggeTRON/cardano-explorer-app
source/features/transactions/context.ts
<reponame>edgggeTRON/cardano-explorer-app import React from 'react'; import { ensureContextExists } from '../../lib/react/hooks'; import { ITransactionsFeature } from './index'; /** * React context used for this feature */ export const transactionsContext = React.createContext<ITransactionsFeature | null>( null );...
edgggeTRON/cardano-explorer-app
source/features/blocks/api/index.ts
import { GraphQLClient } from 'graphql-request'; import { GetBlocksInEpochQuery, GetBlocksInEpochQueryVariables, GetBlocksInRangeQuery, GetBlocksInRangeQueryVariables, } from '../../../../generated/typings/graphql-schema'; import { GraphQLRequest } from '../../../lib/graphql/GraphQLRequest'; import getBlocksInE...
edgggeTRON/cardano-explorer-app
source/features/blocks/ui/BlocksBrowser.tsx
<filename>source/features/blocks/ui/BlocksBrowser.tsx import { debounce } from 'lodash'; import { observer } from 'mobx-react-lite'; import React, { useEffect, useState } from 'react'; import { useObservableEffect } from '../../../lib/mobx/react'; import { calculatePaging, ICalculatePagingOutputs } from '../../../lib/p...
edgggeTRON/cardano-explorer-app
source/lib/types.ts
import { NextComponentType, NextPageContext, } from 'next/dist/next-server/lib/utils'; import React from 'react'; export function isDefined<T>(b: T | null | undefined): b is T { return b != null; } export type PageComponentWithStaticLayout = NextComponentType< NextPageContext, any > & { getStaticLayout: (...
edgggeTRON/cardano-explorer-app
source/features/stake-pools/index.ts
import { StakePoolsActions } from './actions'; import { StakePoolsApi } from './api'; import { StakePoolsStore } from './store'; export const stakePoolsActions = new StakePoolsActions(); export const stakePoolsApi = new StakePoolsApi(); export const stakePoolsStore = new StakePoolsStore( stakePoolsActions, stakePo...
edgggeTRON/cardano-explorer-app
source/features/search/ui/Search.tsx
<gh_stars>1-10 import cx from 'classnames'; import { observer } from 'mobx-react-lite'; import React, { useState } from 'react'; import { Button } from 'react-polymorph/lib/components/Button'; import { Input } from 'react-polymorph/lib/components/Input'; import { BrandType, SearchType } from '../../../constants'; const...
edgggeTRON/cardano-explorer-app
source/lib/graphql/graphqlClient.ts
import { GraphQLClient } from 'graphql-request'; import { environment } from '../../environment'; export const graphqlClient = new GraphQLClient( environment.CARDANO.GRAPHQL.HTTP_URL );
edgggeTRON/cardano-explorer-app
source/styles/theme/CssVariablesProvider.tsx
<filename>source/styles/theme/CssVariablesProvider.tsx import React, { ReactNode, useEffect } from 'react'; interface ICssVariablesManagerProps { variables: { [key: string]: string; }; children: ReactNode; } export const CssVariablesProvider = ({ children, variables, }: ICssVariablesManagerProps) => { ...
edgggeTRON/cardano-explorer-app
source/lib/logging.ts
import createDebugger from 'debug'; import { environment } from '../environment'; import Action from './Action'; /** * Typescript class decorator that can be used to automatically * debug any action defined in a feature when the DEBUG flag is set. * * @param {string} namespace The debug namespace used for the acti...
edgggeTRON/cardano-explorer-app
source/pages/[locale]/stake-pools.tsx
import { StakePoolsPage } from '../../features/stake-pools/ui/pages/StakePoolsPage'; export default StakePoolsPage;
edgggeTRON/cardano-explorer-app
source/features/stake-pools/components/StakePoolTooltip.tsx
<filename>source/features/stake-pools/components/StakePoolTooltip.tsx import classnames from 'classnames'; import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; import utc from 'dayjs/plugin/utc' import React, { FC, useCallback, useEffect, useRef } from 'react'; import { getColorFromRange } f...
edgggeTRON/cardano-explorer-app
source/features/search/ui/EpochsSearchResult.tsx
import { isNumber } from 'lodash'; import { observer } from 'mobx-react-lite'; import React, { useEffect, useState } from 'react'; import { CardanoEra } from '../../../constants'; import { environment } from '../../../environment'; import { useObservableEffect } from '../../../lib/mobx/react'; import LoadingSpinner fro...
edgggeTRON/cardano-explorer-app
source/features/navigation/ui/LocalizedLink.tsx
import Link, { LinkProps } from 'next/link'; import React from 'react'; import { useI18nFeature } from '../../i18n/context'; import styles from './LocalizedLink.module.scss'; export const LocalizedLink = ( props: LinkProps & { children: React.ReactNode; } ) => { const i18n = useI18nFeature(); return ( ...
edgggeTRON/cardano-explorer-app
source/features/i18n/index.ts
<reponame>edgggeTRON/cardano-explorer-app import Action from '../../lib/Action'; import { EnumToArray } from '../../lib/enums'; import { debugActions } from '../../lib/logging'; import { I18nStore } from './store'; import { SupportedLocale } from './types'; export const SUPPORTED_LOCALES = EnumToArray(SupportedLocale)...
edgggeTRON/cardano-explorer-app
source/features/search/ui/TransactionSearchResult.tsx
import { isString } from 'lodash'; import { Observer } from 'mobx-react-lite'; import React from 'react'; import { useObservableEffect } from '../../../lib/mobx/react'; import LoadingSpinner from '../../../widgets/loading-spinner/LoadingSpinner'; import { useI18nFeature } from '../../i18n/context'; import { useNavigati...
edgggeTRON/cardano-explorer-app
source/lib/arrays.ts
export function compareProp<Item, Prop>(pickFrom: (i: Item) => Prop) { return (a: Item, b: Item) => { const valA = pickFrom(a); const valB = pickFrom(b); return valA === valB ? 0 : valA < valB ? 1 : -1; }; }
edgggeTRON/cardano-explorer-app
source/pages/_app.tsx
<filename>source/pages/_app.tsx if (process.env.NODE_ENV === 'development') { // Must use require here as import statements are only allowed // to exist at the top of a file. require('preact/debug'); } import { AppProps } from 'next/app'; import React from 'react'; import NoSSR from 'react-no-ssr'; import '../con...
edgggeTRON/cardano-explorer-app
source/features/navigation/ui/NavigationFeatureProvider.tsx
<filename>source/features/navigation/ui/NavigationFeatureProvider.tsx import { useRouter } from 'next/router'; import React, { useState } from 'react'; import { useFeature } from '../../../lib/react/hooks'; import { useI18nFeature } from '../../i18n/context'; import { createNavigationFeature, INavigationFeature, ...
edgggeTRON/cardano-explorer-app
source/widgets/table/TableBodyRow.tsx
<reponame>edgggeTRON/cardano-explorer-app import { observer } from 'mobx-react-lite'; import React, { FC } from 'react'; import { IColumnDefinition } from './Table'; import styles from './TableBodyRow.module.scss'; export interface ITableBodyRowProps { columns: Array<IColumnDefinition>; row: any; } const TableBod...
edgggeTRON/cardano-explorer-app
source/features/i18n/store.ts
import dayjs from 'dayjs'; import 'dayjs/locale/de'; import 'dayjs/locale/en'; import 'dayjs/locale/ja'; import i18next, { TFunctionKeys } from 'i18next'; import { action, observable } from 'mobx'; import { initReactI18next } from 'react-i18next'; import { environment } from '../../environment'; import { ActionProps, c...
edgggeTRON/cardano-explorer-app
source/typings/react-polymorph.d.ts
<filename>source/typings/react-polymorph.d.ts declare module 'react-polymorph/lib/components' { export const IDENTIFIERS: { AUTOCOMPLETE: string; BUBBLE: string; BUTTON: string; CHECKBOX: string; FLEX: string; FORM_FIELD: string; GRID: string; GUTTER: string; HEADER: string; IN...
edgggeTRON/cardano-explorer-app
source/lib/graphql/GraphQLRequest.ts
import { DocumentNode } from 'graphql'; import { GraphQLClient } from 'graphql-request'; import { print } from 'graphql/language/printer'; import { action, computed, observable, runInAction } from 'mobx'; import { AbortablePromise } from '../AbortablePromise'; export class GraphQLRequest<TResult, TVariables> { @obse...
edgggeTRON/cardano-explorer-app
source/widgets/browsing/Pagination.tsx
import classnames from 'classnames'; import React, { useState } from 'react'; import { Button } from 'react-polymorph/lib/components/Button'; import { useI18nFeature } from '../../features/i18n/context'; import styles from './Pagination.module.scss'; const FirstPageArrow = require('../../public/assets/images/arrow-beg...
edgggeTRON/cardano-explorer-app
stories/address.stories.tsx
<reponame>edgggeTRON/cardano-explorer-app import { storiesOf } from '@storybook/react'; import React from 'react'; import AddressSummary from '../source/features/address/ui/AddressSummary'; const addressSummary = { address: '<KEY>', finalBalance: '89727', title: 'Address', transactionsCount: '2', }; stori...
edgggeTRON/cardano-explorer-app
source/features/epochs/api/index.ts
import { GraphQLClient } from 'graphql-request'; import { GetEpochsInRangeQuery, GetEpochsInRangeQueryVariables, } from '../../../../generated/typings/graphql-schema'; import { GraphQLRequest } from '../../../lib/graphql/GraphQLRequest'; import getEpochsInRangeQuery from './getEpochsInRange.graphql'; export class ...
edgggeTRON/cardano-explorer-app
cypress/integration/latest-epochs-on-homepage.ts
describe('Homepage data feeds', () => { it('load with headline and spinner', () => { cy.visit('http://localhost:4000/en'); cy.get('.LandingPage_epochList__2KM8z .DividerWithTitle_title__3SVyG').should('have.text', 'Latest Epochs'); cy.get('.LandingPage_epochList__2KM8z .LoadingSpinner_small__1szrc').shoul...
edgggeTRON/cardano-explorer-app
source/lib/unit-converters.ts
export function lovelacesToAda(lovelaces: number) { return lovelaces / 1000000; } export const lovelacesStringToAdaNumber = (lovelaces: string) => lovelacesToAda(parseInt(lovelaces, 10));
edgggeTRON/cardano-explorer-app
source/features/epochs/index.ts
<reponame>edgggeTRON/cardano-explorer-app import { GraphQLClient } from 'graphql-request'; import Action from '../../lib/Action'; import { IBlocksFeature } from '../blocks'; import { INetworkInfoFeature } from '../network-info'; import { EpochsApi } from './api'; import { EpochsStore } from './store'; /** * Defines t...