repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
nnluukhtn/luxurify | web/src/global/services/api/types.ts | import { AxiosRequestConfig, Method } from 'axios';
export interface APIParams {
method: Method;
route: string;
headers?: any;
data?: any;
}
interface ApiError {
message: string;
messages: string[];
}
export interface ApiResponse {
header: any;
success: boolean;
request: AxiosRequestConfig;
respo... |
nnluukhtn/luxurify | web/src/app/pages/Admin/Brands/slice/selectors.ts | <gh_stars>0
import { createSelector } from '@reduxjs/toolkit';
import { initialState } from '.';
import { RootState } from 'types';
const selectBrandsState = (state: RootState) => {
return state.adminBrands || initialState;
};
export const makeSelectBrandsById = createSelector(
selectBrandsState,
state => state... |
nnluukhtn/luxurify | web/src/app/pages/RegisterBrand/slice/saga.ts | <reponame>nnluukhtn/luxurify
import { RegisterBrandResponse, WSBrandResponse } from './types';
// import { take, call, put, select, takeLatest } from 'redux-saga/effects';
import { all, call, put, takeLatest, takeLeading } from 'redux-saga/effects';
import callApi from 'global/services/api';
import {
fetchWSBrands,
... |
nnluukhtn/luxurify | web/src/app/actions.ts | <reponame>nnluukhtn/luxurify
import { ApiResponse } from 'global/services/api/types';
import { action } from 'typesafe-actions';
import ActionTypes from './actionTypes';
export const signOut = (
isAdmin?: boolean,
callback?: (response: ApiResponse) => void,
) => action(ActionTypes.SIGN_OUT, { isAdmin, callback });... |
nnluukhtn/luxurify | web/src/app/pages/Watches/WatchDetail/adapter.ts | <reponame>nnluukhtn/luxurify<gh_stars>0
import { WatchDetailData } from './slice/types';
export const detailAdapter = (data: WatchDetailData) => data;
|
nnluukhtn/luxurify | web/src/app/pages/RegisterBrand/components/RegisterBrandForms.tsx | import InputForm from 'app/common/components/InputForm';
import {
FormContainer,
Header,
Spacer,
StyledButton,
SubHeader,
} from 'app/common/styles';
import { useFormik } from 'formik';
import React, { useEffect } from 'react';
import styled from 'styled-components';
import {
BrandPayload,
RegisterBrandPa... |
nnluukhtn/luxurify | web/src/app/pages/Admin/Brands/index.tsx | import { Button, Divider, List } from 'antd';
import Modal from 'antd/lib/modal/Modal';
import Colors from 'app/common/Colors';
import { PageContainer } from 'app/common/components';
import { Container, Header, Spacer } from 'app/common/styles';
import { ApiResponse } from 'global/services/api/types';
import React, { u... |
nnluukhtn/luxurify | mobile/frontend/App.tsx | <filename>mobile/frontend/App.tsx
import Web3 from "web3";
import React from "react";
import { Asset } from "expo-asset";
import { RecoilRoot } from "recoil";
import AppLoading from "expo-app-loading";
import { StatusBar } from "expo-status-bar";
import { OpenSeaPort, Network } from "opensea-js";
import {
Provider as... |
nnluukhtn/luxurify | web/src/app/saga.ts | import { resetSession } from './../utils/SessionActions/SessionActions';
import { ApiResponse } from './../global/services/api/types';
import { all, put, takeLeading } from 'redux-saga/effects';
import ActionTypes from './actionTypes';
import * as actions from './actions';
import callApi from 'global/services/api';
fu... |
nnluukhtn/luxurify | web/src/app/pages/SignUp/saga.ts | <filename>web/src/app/pages/SignUp/saga.ts
import { createUserAdapter } from './adapters';
import * as actions from './actions';
import ActionTypes from './actionTypes';
import { CreateUserResponse } from './types';
import callApi from 'global/services/api';
import { all, put, takeLatest } from 'redux-saga/effects';
im... |
nnluukhtn/luxurify | mobile/frontend/constants/index.ts | <filename>mobile/frontend/constants/index.ts<gh_stars>0
export { default as defaultHeader } from './defaultHeader'; |
nnluukhtn/luxurify | web/src/app/pages/Watches/WatchDetail/components/CreateSellOrder/index.tsx | <filename>web/src/app/pages/Watches/WatchDetail/components/CreateSellOrder/index.tsx
import Modal from 'antd/lib/modal/Modal';
import { Spacer, StyledButton } from 'app/common/styles';
import React, { useContext, useEffect, useState } from 'react';
import { seaportContext } from 'contexts/SeaportContext';
import { Open... |
nnluukhtn/luxurify | web/src/app/pages/Watches/WatchDetail/components/Transfer/index.tsx | import Modal from 'antd/lib/modal/Modal';
import { Spacer, 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... |
nnluukhtn/luxurify | web/src/app/common/components/NavigationBar/components/SignInOutButton.tsx | <filename>web/src/app/common/components/NavigationBar/components/SignInOutButton.tsx
import { UserOutlined } from '@ant-design/icons';
import { Button } from 'antd';
import { signOut } from 'app/actions';
import { ApiResponse } from 'global/services/api/types';
import React from 'react';
import { useDispatch } from 're... |
nnluukhtn/luxurify | web/src/app/pages/Admin/SignIn/index.tsx | import Colors from 'app/common/Colors';
import { PageContainer } from 'app/common/components';
import { BackgroundContainer } from 'app/common/styles';
import SignInForm from 'app/pages/SignIn/components/SignInForm';
import * as React from 'react';
import { Helmet } from 'react-helmet-async';
import { useLocation } fro... |
nnluukhtn/luxurify | mobile/frontend/atoms/contract/index.ts | export { initializeContract, useContract } from "./utils";
export { contractState } from "./atoms";
|
nnluukhtn/luxurify | mobile/frontend/features/Inventory/Grid/index.tsx | import React, { useContext, useEffect, useState } from "react";
import { ActivityIndicator } from "react-native";
import styled from "styled-components/native";
import { FlatGrid } from "react-native-super-grid";
import { useNavigation, useRoute } from "@react-navigation/native";
import { useWalletConnect } from "@wall... |
nnluukhtn/luxurify | mobile/frontend/types/Watch.ts | <filename>mobile/frontend/types/Watch.ts
interface Watch {
name: string;
token: string;
randomId: string;
referenceNumber: string;
priceType: number;
priceUnit: number;
priceFixed: string;
}
export default Watch;
|
nnluukhtn/luxurify | mobile/frontend/features/Inventory/Detail/index.tsx | <gh_stars>0
import React, { useContext, useEffect, useState } from "react";
import { useNavigation, useRoute } from "@react-navigation/native";
import { MaterialCommunityIcons, FontAwesome } from "@expo/vector-icons";
import QRCode from "react-native-qrcode-svg";
import { Modal } from "react-native-paper";
import { Act... |
nnluukhtn/luxurify | mobile/frontend/types/index.ts | export { default as Watch } from "./Watch";
export { default as WatchMeta } from "./WatchMeta";
export { default as ExternalQRPayload } from "./ExternalQRPayload";
export { default as WatchData } from './WatchData'; |
nnluukhtn/luxurify | web/src/app/pages/RegisterBrand/slice/types.ts | <gh_stars>0
import { ApiResponse } from 'global/services/api/types';
/* --- STATE --- */
export interface RegisterBrandState {
readonly brands?: WSBrand[];
readonly isLoading: boolean;
}
export interface RegisterBrandResponse extends ApiResponse {
response: {
id: number;
company_name: string;
};
}
ex... |
nnluukhtn/luxurify | contracts/scripts/set_token_uri.ts | <gh_stars>0
// 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 sco... |
nnluukhtn/luxurify | web/src/utils/hooks/RouterHook/navigation.ts | <reponame>nnluukhtn/luxurify
import { useDispatch } from 'react-redux';
import { useCallback } from 'react';
import { push } from 'connected-react-router';
const useNavigation = () => {
const dispatch = useDispatch();
const navigationPush = useCallback(
(route: string, state: any) => dispatch(push(route, state... |
nnluukhtn/luxurify | web/src/app/common/components/AttachmentUpload/types.ts | <reponame>nnluukhtn/luxurify<gh_stars>0
import { RcFile } from 'antd/lib/upload/interface';
import { ApiResponse } from 'global/services/api/types';
export interface PresignedUrlResponse extends ApiResponse {
id: string;
upload_url: string;
}
export type Status =
| 'not_started'
| 'in_progress'
| 'success'
... |
nnluukhtn/luxurify | web/src/app/common/components/ErrorContainer/index.tsx | import Colors from 'app/common/Colors';
import styled from 'styled-components';
const ErrorContainer = styled.div`
font-size: 0.85em;
color: ${Colors.R400_RED};
line-height: 1;
margin-top: 2px;
`;
export default ErrorContainer;
|
nnluukhtn/luxurify | mobile/frontend/types/WatchMeta.ts | <filename>mobile/frontend/types/WatchMeta.ts
export interface WatchMeta {
name: string;
description: string;
image: string;
reference_number: string;
model: string;
power_reserve: string;
case_diameter: string;
water_resistance_atm: number;
movement_name: string;
bracelet_color_name: string;
dial_... |
nnluukhtn/luxurify | contracts/scripts/request_client_contract_data.ts | <reponame>nnluukhtn/luxurify
// 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 ... |
nnluukhtn/luxurify | web/src/app/pages/RegisterBrand/saga.ts | import { RegisterBrandResponse } from './types';
// import { take, call, put, select, takeLatest } from 'redux-saga/effects';
import { takeLatest } from 'redux-saga/effects';
import * as actions from './actions';
import ActionTypes from './actionTypes';
import callApi from 'global/services/api';
function* callRegister... |
nnluukhtn/luxurify | mobile/frontend/features/Inventory/Detail/utils.ts | import { Contract } from "web3-eth-contract";
import { WatchData } from "../../../types";
import { getOrders, getWatch, getWatchMeta } from "../Grid/utils";
import { OpenSeaPort } from "opensea-js";
interface GetComposedDataProps {
token: string;
contract: Contract;
seaport: OpenSeaPort;
toCheckAccount: string... |
nnluukhtn/luxurify | mobile/frontend/ConnectorContext.ts | import React from "react";
import Web3 from "web3";
const initialValue: Web3 | null = null;
export const ConnectorContext = React.createContext(initialValue);
|
nnluukhtn/luxurify | web/src/app/pages/SignUp/actions.ts | import { action } from 'typesafe-actions';
import ActionTypes from './actionTypes';
import { UserPayload, CreateUserResponse } from './types';
export const createUserAccount = (
userPayload: UserPayload,
onSuccess: (resonse: CreateUserResponse) => void,
onFailed: (msg?: string[]) => void,
) =>
action(ActionTyp... |
nnluukhtn/luxurify | web/src/app/pages/Watches/WatchDetail/slice/types.ts | <filename>web/src/app/pages/Watches/WatchDetail/slice/types.ts
/* --- STATE --- */
export interface WatchDetailState {}
export interface Attribute {
trait_type: string;
value: string;
}
export interface WatchDetailData {
name: string;
description: string;
image: string;
attributes: Attribute[];
}
|
nnluukhtn/luxurify | web/src/app/common/components/OrderList/index.tsx | <reponame>nnluukhtn/luxurify<gh_stars>0
import useSWR from 'swr';
import styled from 'styled-components';
import { OrderSide } from 'opensea-js/lib/types';
import { Web3Provider } from '@ethersproject/providers';
import { useWeb3React } from '@web3-react/core';
import { Card, Col, Row, Skeleton } from 'antd';
import { ... |
nnluukhtn/luxurify | web/src/app/pages/RegisterWatch/components/ProgressModal.tsx | <reponame>nnluukhtn/luxurify
import { Progress, Typography } from 'antd';
import Modal from 'antd/lib/modal/Modal';
import React from 'react';
import { PropagateLoader } from 'react-spinners';
const overide = `
display: block;
`;
interface Props {
actionName: JSX.Element | string | null;
percent: number;
load... |
nnluukhtn/luxurify | web/src/app/common/components/index.ts | export { default as Wallet } from './Wallet';
export { default as PageHeader } from './PageHeader';
export { default as PageContainer } from './PageContainer';
|
nnluukhtn/luxurify | web/src/utils/SessionActions/SessionSelector.ts | import { createSelector } from 'reselect';
import { initialState } from './SessionReducer';
const selectSession = state => {
return state.session || initialState;
};
export const selectIsAuthenticated = createSelector(
selectSession,
substate => substate.isAuthenticated,
);
export const selectUser = createSele... |
nnluukhtn/luxurify | web/src/app/pages/RegisterBrand/index.tsx | <gh_stars>0
import * as React from 'react';
import { Helmet } from 'react-helmet-async';
import RegisterBrandForms from './components/RegisterBrandForms';
import { PageContainer } from 'app/common/components';
import { BackgroundContainer } from 'app/common/styles';
import Colors from 'app/common/Colors';
export funct... |
nnluukhtn/luxurify | web/src/styles/global-styles.ts | <gh_stars>0
import { createGlobalStyle } from 'styled-components';
export const GlobalStyle = createGlobalStyle`
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=Raleway:ital,wght@0,100;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;... |
nnluukhtn/luxurify | web/src/types/RootState.ts | import { History } from 'history';
import { SessionState } from './../utils/SessionActions/types.d';
import { RegisterBrandState } from 'app/pages/RegisterBrand/slice/types';
import { RouterState } from 'connected-react-router';
import { AdminBrandsState } from 'app/pages/Admin/Brands/slice/types';
import { AdminState ... |
nnluukhtn/luxurify | web/src/app/pages/RegisterBrand/slice/index.ts | <filename>web/src/app/pages/RegisterBrand/slice/index.ts<gh_stars>0
import { createSlice } from 'utils/@reduxjs/toolkit';
import { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';
import { registerBrandSaga } from './saga';
import { RegisterBrandState } from './types';
export const initialState: Registe... |
nnluukhtn/luxurify | web/src/app/pages/Admin/SignIn/adapters.ts | import { SignInPayload } from 'app/pages/SignIn/types';
import { AdminSignInParams } from './types';
export const adminSignInAdapter = (
userPayload: SignInPayload,
): AdminSignInParams => {
return {
admin: {
email: userPayload.email,
password: <PASSWORD>,
},
};
};
|
nnluukhtn/luxurify | web/src/utils/SessionActions/types.d.ts | <reponame>nnluukhtn/luxurify
import { ActionType } from 'typesafe-actions';
import * as actions from './SessionActions';
export interface SessionState {
readonly isChecked: boolean;
readonly isAuthenticated: boolean;
readonly user?: User;
}
// User is the user object that is maintained throughout the app
export... |
nnluukhtn/luxurify | web/src/contexts/SeaportContext.ts | <reponame>nnluukhtn/luxurify
import { OpenSeaPort } from 'opensea-js';
import React from 'react';
const initialValue: OpenSeaPort | null = null;
export const seaportContext = React.createContext<OpenSeaPort | null>(
initialValue,
);
|
nnluukhtn/luxurify | web/src/app/common/assets/index.ts | import Logo from './logo.png';
import WatchVector from './watch_vector.jpeg';
import Background from './bg1.png';
export { Logo, WatchVector, Background };
|
nnluukhtn/luxurify | mobile/frontend/features/Camera/index.tsx | import React from "react";
import { createStackNavigator } from "@react-navigation/stack";
// Screens
import Scanner from "./Scanner";
const Stack = createStackNavigator();
const Camera = () => {
// Main return
return (
<Stack.Navigator>
<Stack.Screen
name="Camera.Scanner"
component={Sca... |
nnluukhtn/luxurify | web/src/app/common/components/Actions/index.tsx | <filename>web/src/app/common/components/Actions/index.tsx
import { Web3Provider } from '@ethersproject/providers';
import { useWeb3React } from '@web3-react/core';
import { Button, Row, Typography } from 'antd';
import { Spacer } from 'app/common/styles';
import { Contract } from 'ethers';
import React, { useState } fr... |
nnluukhtn/luxurify | web/src/app/common/components/AttachmentUpload/styles.ts | <gh_stars>0
import { Upload, Row as AntRow } from 'antd';
import Colors from 'app/common/Colors';
import styled from 'styled-components';
import { Status } from './types';
const Styled = {
Container: styled.div`
display: flex;
flex-direction: column;
flex: 1;
word-break: keep-all;
`,
StyledUpload... |
nnluukhtn/luxurify | web/src/app/pages/RegisterWatch/index.tsx | /**
*
* RegisterWatch
*
*/
import { Web3Provider } from '@ethersproject/providers';
import { useWeb3React } from '@web3-react/core';
import { PageContainer } from 'app/common/components';
import { TOKENS_BY_NETWORK } from 'app/common/components/TokenBalance/constants';
import { BackgroundContainer } from 'app/commo... |
nnluukhtn/luxurify | web/src/utils/fetcher.tsx | import { Web3Provider } from '@ethersproject/providers';
import { Contract } from 'ethers';
import { isAddress } from 'ethers/lib/utils';
// const fetcher = (library: Web3Provider | undefined) => (...args) => {
// const [method, ...params] = args;
// console.log(method, params);
// return library?.[method](...pa... |
nnluukhtn/luxurify | web/src/global/services/api/axios.ts | import _ from 'lodash';
import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
import Cookies from 'js-cookie';
import { APIParams } from './types';
import { defaultHeaders } from './constants';
import { errorResponseAdapter, responseAdapter } from './adapters';
// import refreshToken from './ref... |
nnluukhtn/luxurify | web/src/app/pages/Admin/SignIn/types.ts | import { SignInPayload } from 'app/pages/SignIn/types';
export interface AdminSignInParams {
admin: SignInPayload;
}
|
nnluukhtn/luxurify | mobile/frontend/features/Inventory/Grid/utils.ts | <reponame>nnluukhtn/luxurify<filename>mobile/frontend/features/Inventory/Grid/utils.ts
import _ from "lodash";
import web3 from "web3";
import axios from "axios";
import { OpenSeaPort } from "opensea-js";
import { Contract } from "web3-eth-contract";
import { Watch, WatchMeta } from "../../../types";
import WatchData f... |
nnluukhtn/luxurify | web/src/app/pages/SignIn/index.tsx | import { PageContainer } from 'app/common/components';
import { BackgroundContainer } from 'app/common/styles';
import * as React from 'react';
import { Helmet } from 'react-helmet-async';
import { useLocation } from 'react-router-dom';
import { useInjectSaga } from 'utils/redux-injectors';
import { signIn } from './ac... |
nnluukhtn/luxurify | web/src/app/common/components/NavigationBar/index.tsx | <reponame>nnluukhtn/luxurify<filename>web/src/app/common/components/NavigationBar/index.tsx
import { Button, PageHeader, PageHeaderProps } from 'antd';
import { Logo } from 'app/common/assets';
import React from 'react';
import { useSelector } from 'react-redux';
import { useHistory } from 'react-router-dom';
import st... |
nnluukhtn/luxurify | contracts/scripts/fund_client_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/types/index.ts | import { Store } from '@reduxjs/toolkit';
import { Reducer } from 'react';
import { SagaIterator } from 'redux-saga';
import { RootState } from './RootState';
export type { RootState };
export interface InjectedStore extends Store {
injectedReducers: any;
injectedSagas: any;
runSaga(saga: () => SagaIterator<any... |
nnluukhtn/luxurify | web/src/app/pages/Admin/types.ts | import { AdminBrandsState } from './Brands/slice/types';
export interface AdminState {
readonly brand?: AdminBrandsState;
}
|
nnluukhtn/luxurify | web/src/app/pages/SignUp/adapters.ts | import { UserParams, UserPayload } from './types';
export const createUserAdapter = (userPayload: UserPayload): UserParams => {
return {
user: {
email: userPayload.email,
password: <PASSWORD>,
password_confirmation: user<PASSWORD>_<PASSWORD>,
},
};
};
|
nnluukhtn/luxurify | web/src/utils/hooks/DebounceHooks/index.ts | <reponame>nnluukhtn/luxurify
export { default as useValueDebounce } from './useValueDebounce';
export { default as useFnDebounce } from './useFnDebounce';
|
nnluukhtn/luxurify | web/src/app/pages/RegisterBrand/types.ts | <reponame>nnluukhtn/luxurify
import { ApiResponse } from 'global/services/api/types';
/* --- STATE --- */
export interface RegisterBrandState {}
export interface RegisterBrandResponse extends ApiResponse {
response: {
id: number;
company_name: string;
};
}
export type FileType = any;
export interface Bra... |
nnluukhtn/luxurify | web/src/utils/SessionActions/SessionReducer.ts | import { SessionState, SessionAction } from './types';
import ActionTypes from './actionTypes';
export const initialState: SessionState = {
isAuthenticated: false,
isChecked: false,
user: undefined,
};
export default function sessionReducer(
state: SessionState = initialState,
action: SessionAction,
): Sess... |
nnluukhtn/luxurify | web/src/app/common/components/PageHeader/index.tsx | <filename>web/src/app/common/components/PageHeader/index.tsx<gh_stars>0
import Colors from 'app/common/Colors';
import React from 'react';
import styled from 'styled-components';
const Container = styled.div`
border-bottom: 1px solid ${Colors.N100_GREY};
display: flex;
justify-content: center;
min-height: 64px... |
nnluukhtn/luxurify | web/src/app/pages/RegisterWatch/adapter.ts | import {
RegisterWatchParams,
RegisterWatchPayload,
WSWatch,
WSWatchRemote,
} from './slice/types';
export const registerWatchAdapter = (
watchParams: RegisterWatchParams,
): RegisterWatchPayload => ({
watch: {
reference_number: watchParams.referenceNumber,
model: watchParams.model,
power_reser... |
nnluukhtn/luxurify | web/src/global/services/api/refresh.ts | <filename>web/src/global/services/api/refresh.ts
import axios from 'axios';
import Cookies from 'js-cookie';
import { DOMAIN } from './axios';
let refreshTokenPromise: Promise<any> | null = null;
export const getRefreshTokenPromise = () => refreshTokenPromise;
const refreshToken = () => {
// Check if refresh_token... |
nnluukhtn/luxurify | web/src/app/common/components/InputPassword/index.tsx | import React from 'react';
import { Input } from 'antd';
import { PasswordProps } from 'antd/es/input';
import Colors from 'app/common/Colors';
import styled from 'styled-components';
import ErrorContainer from '../ErrorContainer';
interface ComponentProps {
noBorder?: boolean;
hasBorderRadius?: boolean;
contain... |
nnluukhtn/luxurify | web/src/app/pages/RegisterBrand/actions.ts | <reponame>nnluukhtn/luxurify
import { action } from 'typesafe-actions';
import ActionTypes from './actionTypes';
import { registerBrandAdapter } from './adapter';
import { BrandPayload, RegisterBrandResponse } from './types';
export const registerBrand = (
brandPayload: BrandPayload,
callback?: (response: Register... |
nnluukhtn/luxurify | web/src/app/pages/Watches/WatchDetail/components/WatchQR/index.tsx | <reponame>nnluukhtn/luxurify
import React from 'react';
import ReactToPrint from 'react-to-print';
import QRCodePrint from './QRCodePrint';
import { PrinterOutlined, QrcodeOutlined } from '@ant-design/icons';
import QRCode from 'qrcode.react';
import { Collapse } from 'antd';
import styled from 'styled-components';
imp... |
nnluukhtn/luxurify | web/src/utils/hooks/DebounceHooks/useValueDebounce.tsx | <gh_stars>0
import { useEffect, useState } from 'react';
const useValueDebounce = <T extends any>(value: T, delay?: number) => {
const [debouncedValue, setValue] = useState<T | null>(null);
useEffect(() => {
const handler = setTimeout(() => setValue(value), delay || 1000);
return () => {
clearTimeou... |
nnluukhtn/luxurify | web/src/utils/hooks/DebounceHooks/useFnDebounce.tsx | import { useRef, useEffect } from 'react';
const useFnDebounce = () => {
const debouncer = useRef<ReturnType<typeof setTimeout> | undefined>(
undefined,
);
const debounceFn = (
fn: (...args: any) => any,
delay?: number,
...args: any
) => {
if (debouncer.current !== undefined) clearTimeout(... |
nnluukhtn/luxurify | mobile/frontend/atoms/contract/atoms.ts | <reponame>nnluukhtn/luxurify<filename>mobile/frontend/atoms/contract/atoms.ts
import { Contract } from "web3-eth-contract";
import { atom } from "recoil";
const initialValue: Contract | null = null;
export const contractState = atom({
key: "contract", // unique ID (with respect to other atoms/selectors)
default: ... |
nnluukhtn/luxurify | web/src/app/pages/SignIn/saga.ts | <filename>web/src/app/pages/SignIn/saga.ts<gh_stars>0
import { signInAdapter } from './adapters';
import * as actions from './actions';
import ActionTypes from './actionTypes';
import { SignInResponse } from './types';
import callApi from 'global/services/api';
import { all, put, takeLatest } from 'redux-saga/effects';... |
nnluukhtn/luxurify | mobile/frontend/SeaportContext.ts | <reponame>nnluukhtn/luxurify
import React from "react";
import { OpenSeaPort } from "opensea-js";
const initialValue: OpenSeaPort | null = null;
export const SeaportContext = React.createContext(initialValue);
|
nnluukhtn/luxurify | web/src/app/common/components/TokenBalance/index.tsx | <reponame>nnluukhtn/luxurify<filename>web/src/app/common/components/TokenBalance/index.tsx
import { Web3Provider } from '@ethersproject/providers';
import { useWeb3React } from '@web3-react/core';
import { BigNumber, Contract } from 'ethers';
import React, { useEffect } from 'react';
import useSWR from 'swr';
import ER... |
nnluukhtn/luxurify | web/src/utils/SessionActions/SessionActions.ts | <reponame>nnluukhtn/luxurify<filename>web/src/utils/SessionActions/SessionActions.ts<gh_stars>0
import { action } from 'typesafe-actions';
import Cookies from 'js-cookie';
import ActionTypes from './actionTypes';
export const updateSession = (payload: any) =>
action(ActionTypes.UPDATE_SESSION, payload);
export cons... |
nnluukhtn/luxurify | web/src/utils/SessionActions/index.ts | <reponame>nnluukhtn/luxurify
import * as SessionActions from './SessionActions';
import * as SessionSelectors from './SessionSelector';
export { SessionActions };
export { default as SessionReducer } from './SessionReducer';
export { SessionSelectors };
export { default as ActionTypes } from './actionTypes';
|
nnluukhtn/luxurify | web/src/app/common/components/AttachmentUpload/NormalItem.tsx | <gh_stars>0
import { Tooltip } from 'antd';
import React from 'react';
import humanFileSize from 'utils/human-file-size';
import Styled from './styles';
import { Attachment, AttachmentFile, Status } from './types';
import { FilePdfOutlined, DeleteOutlined } from '@ant-design/icons';
export const getFileIcon = (fileTyp... |
nnluukhtn/luxurify | web/src/app/common/components/AttachmentUpload/VideoItem.tsx | import { RcFile } from 'antd/lib/upload';
import axios from 'axios';
import api from 'global/services/api';
import React, { useEffect, useState } from 'react';
import NormalItem from './NormalItem';
import Styled from './styles';
import { AttachmentFile, Status } from './types';
interface Props {
inputFile: Attachme... |
nnluukhtn/luxurify | web/src/utils/checkNumber.ts | <reponame>nnluukhtn/luxurify
export const isInterger = (Number.isInteger =
Number.isInteger ||
function (value) {
return (
typeof value === 'number' &&
isFinite(value) &&
Math.floor(value) === value
);
});
export const isSafeInt = (Number.isSafeInteger =
Number.isSafeInteger ||
func... |
nnluukhtn/luxurify | web/src/app/index.tsx | <reponame>nnluukhtn/luxurify<gh_stars>0
/**
*
* App
*
* This component is the skeleton around the actual pages, and should only
* contain code that should be seen on all pages. (e.g. navigation bar)
*/
import * as React from 'react';
import { Helmet } from 'react-helmet-async';
import { Switch, Route, BrowserRou... |
nnluukhtn/luxurify | web/src/utils/hooks/NotificationHook/useNotification.ts | import { ApiResponse } from 'global/services/api/types';
import notification, { NotificationType } from 'global/services/notification';
const useNotification = (): [
(msg: string) => void,
(msg: string | ApiResponse) => void,
] => {
const errors = (msg: string | ApiResponse) => {
if (typeof msg === 'string')... |
nnluukhtn/luxurify | web/src/app/pages/RegisterWatch/slice/saga.ts | import { FetchWSWatchDataResponse, RegisterWatchResponse } from './types';
import { all, call, put, takeLatest, takeLeading } from 'redux-saga/effects';
import callApi from 'global/services/api';
import {
fetchWSWatchData,
fetchWSWatchDataFailed,
fetchWSWatchDataSuccess,
registerWatch,
} from '.';
import { wsWa... |
nnluukhtn/luxurify | web/src/app/common/components/TokenBalance/constants.ts | import { Networks } from '../../../../constants';
import { IERC20 } from './types';
export const LUXURIFY_CLIENT_CONTRACT =
'0x6712deef8d85f9b856dbd914f61c92ea3a13bcd6';
export const TOKENS_BY_NETWORK: {
[key: number]: IERC20[];
} = {
[Networks.Rinkeby]: [
{
address: '0x374A0d8F2828674463456477dF78831... |
nnluukhtn/luxurify | web/src/app/pages/Admin/SignIn/saga.ts | import { adminSignInAdapter } from './adapters';
import * as actions from './actions';
import ActionTypes from './actionTypes';
import callApi from 'global/services/api';
import { all, put, takeLatest } from 'redux-saga/effects';
import { updateSession } from 'utils/SessionActions/SessionActions';
import { saveSessionA... |
nnluukhtn/luxurify | mobile/frontend/atoms/contract/utils.ts | <gh_stars>0
import { useContext, useEffect } from "react";
import { useRecoilState } from "recoil";
import { contractState } from "./atoms";
import { Contract } from "web3-eth-contract";
import Luxurify from "../../../contracts/Luxurify.json";
import { ConnectorContext } from "../../ConnectorContext";
import Web3 from ... |
nnluukhtn/luxurify | web/src/app/pages/RegisterBrand/slice/selectors.ts | <gh_stars>0
import { createSelector } from '@reduxjs/toolkit';
import { RootState } from 'types';
import { initialState } from '.';
const selectSlice = (state: RootState) => state.registerBrand || initialState;
export const makeSelectWSBrands = createSelector(
[selectSlice],
state => state.brands,
);
export con... |
nnluukhtn/luxurify | web/src/app/pages/RegisterWatch/slice/selectors.ts | <reponame>nnluukhtn/luxurify
import { createSelector } from '@reduxjs/toolkit';
import { RootState } from 'types';
import { initialState } from '.';
const selectSlice = (state: RootState) => state.registerWatch || initialState;
export const makeSelectWSWatchById = createSelector(
[selectSlice],
subState => subSt... |
nnluukhtn/luxurify | web/src/app/pages/Admin/SignIn/actions.ts | import { SignInPayload, SignInResponse } from 'app/pages/SignIn/types';
import { action } from 'typesafe-actions';
import ActionTypes from './actionTypes';
export const adminSignIn = (
userPayload: SignInPayload,
onSuccess: (resonse: SignInResponse) => void,
onFailed: (msg?: string[]) => void,
) => action(Action... |
nnluukhtn/luxurify | mobile/frontend/features/Inventory/Grid/components/Item.tsx | <reponame>nnluukhtn/luxurify
import React from "react";
import { Ionicons, Feather } from "@expo/vector-icons";
import styled from "styled-components/native";
import { Watch, WatchMeta } from "../../../../types";
import { OrderResponse } from "../utils";
interface Props {
data: Watch & Partial<WatchMeta> & OrderResp... |
nnluukhtn/luxurify | web/src/utils/hooks/RouterHook/index.ts | export { default as useParams } from './useParams';
export { default as useNavigation } from './navigation';
|
nnluukhtn/luxurify | web/src/app/pages/RegisterWatch/slice/index.ts | <reponame>nnluukhtn/luxurify
import { PayloadAction } from '@reduxjs/toolkit';
import { createSlice } from 'utils/@reduxjs/toolkit';
import { useInjectReducer, useInjectSaga } from 'utils/redux-injectors';
import { registerWatchSaga } from './saga';
import { FetchWSBrandsPayload, RegisterWatchState } from './types';
e... |
nnluukhtn/luxurify | web/src/app/pages/SignIn/adapters.ts | import { SignInParams, SignInPayload } from './types';
export const signInAdapter = (userPayload: SignInPayload): SignInParams => {
return {
user: {
email: userPayload.email,
password: userPayload.password,
},
};
};
|
nnluukhtn/luxurify | web/src/app/pages/Admin/index.tsx | import { NotFoundPage } from 'app/common/components/NotFoundPage/Loadable';
import React from 'react';
import { useSelector } from 'react-redux';
import { Switch, Route, Redirect } from 'react-router-dom';
import { selectIsAuthenticated } from 'utils/SessionActions/SessionSelector';
import { Brands } from './Brands';
i... |
nnluukhtn/luxurify | mobile/frontend/features/Inventory/index.tsx | <reponame>nnluukhtn/luxurify<filename>mobile/frontend/features/Inventory/index.tsx
import React from "react";
import { createStackNavigator } from "@react-navigation/stack";
// Screens
import Grid from "./Grid";
import Detail from "./Detail";
interface Props {}
const Inventory: React.FC<Props> = ({}) => {
const Sta... |
nnluukhtn/luxurify | web/src/app/pages/SignIn/types.ts | <gh_stars>0
import { ApiResponse } from 'global/services/api/types';
export interface SignInPayload {
email: string;
password: string;
}
export interface SignInParams {
user: SignInPayload;
}
export interface SignInResponse extends ApiResponse {
response: {
created_at: string;
email: string;
id: ... |
nnluukhtn/luxurify | web/src/utils/SessionActions/actionTypes.ts | enum ActionTypes {
UPDATE_CHECK = 'session/UPDATE_CHECK',
UPDATE_SESSION = 'session/UPDATE_SESSION',
RESET_SESSION = 'session/RESET_SESSION',
RESET_APP = 'session/RESET_APP',
}
export default ActionTypes;
|
nnluukhtn/luxurify | mobile/frontend/types/ExternalQRPayload.ts | interface ExternalQRPayload {
owner_account: string;
token: string;
}
export default ExternalQRPayload;
|
nnluukhtn/luxurify | web/src/global/services/notification/index.tsx | <reponame>nnluukhtn/luxurify<gh_stars>0
import React from 'react';
import { notification } from 'antd';
import { NotificationType } from './constants';
import Colors from 'app/common/Colors';
import styled from 'styled-components';
const Icon = styled.span`
font-size: 22px;
`;
// To get the styles working, we have ... |
nnluukhtn/luxurify | mobile/frontend/features/Logout/index.tsx | import { useWalletConnect } from "@walletconnect/react-native-dapp";
import React, { useContext } from "react";
import { View } from "react-native";
import { ConnectorContext } from "../../ConnectorContext";
interface Props {}
const Logout: React.FC<Props> = ({}) => {
const connector = useWalletConnect();
React.... |
nnluukhtn/luxurify | web/src/app/common/components/TokenList/index.tsx | import React from 'react';
import TokenBalance from '../TokenBalance';
import { TOKENS_BY_NETWORK } from '../TokenBalance/constants';
interface Props {
chainId: number;
}
const TokenList = ({ chainId }: Props) => {
return (
<>
{TOKENS_BY_NETWORK[chainId]?.map(token => (
<TokenBalance key={token.... |
nnluukhtn/luxurify | web/src/app/actionTypes.ts | <reponame>nnluukhtn/luxurify<filename>web/src/app/actionTypes.ts<gh_stars>0
enum ActionTypes {
SIGN_OUT = 'sign-out/SIGN_OUT',
}
export default ActionTypes;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.