repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
luxor37/cookbook-vercel
src/pages/index.tsx
<filename>src/pages/index.tsx import RecipeList from "@/components/modules/reicpe-list"; import LinkButton from "@/components/shared/link-button"; import Page from "@/components/shared/page"; import RecipeCard from "@/components/shared/recipe-card"; import Row from "@/components/shared/row"; import TextInput from "@/co...
luxor37/cookbook-vercel
src/pages/others/index.tsx
<reponame>luxor37/cookbook-vercel import Page from "@/components/shared/page"; import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; import React from "react"; import { getCardByCategory } from 'lib/api' import RecipeList from "@/components/modules/reicpe-list"; export default function Others(...
luxor37/cookbook-vercel
src/@components/modules/preparation/index.tsx
<reponame>luxor37/cookbook-vercel<gh_stars>0 import client from "lib/sanity"; import { useTranslation } from "next-i18next"; import { translate } from "../../shared/lang"; import Nullable from "../../shared/undefinable" import BlockContent from '@sanity/block-content-to-react' export default function Preparation({ ins...
luxor37/cookbook-vercel
src/@components/shared/sanityImage/index.tsx
import imageUrlBuilder from '@sanity/image-url' import client from 'lib/sanity' export default function SanityImage({ picture, className="" }) { function urlFor(source) { return imageUrlBuilder(client).image(source) } return ( <> <img className={className} src={urlFor(pictu...
luxor37/cookbook-vercel
src/@components/shared/row/index.tsx
<reponame>luxor37/cookbook-vercel export default function Row({ noDefaultMargins = false, children, className = "" }) { var margins = noDefaultMargins ? `` : `my-2`; return ( <div className={`flex flex-row flex-wrap w-full ${margins} ${className}`}> {children} </div> ) }
luxor37/cookbook-vercel
src/@components/shared/nav/index.tsx
import NavButton from "./nav-button"; import NavButtonMobile from "./nav-button-mobile"; import NavButtonLang from "./nav-button-lang"; import { useTranslation } from 'next-i18next'; export const Navbar = () => { const { t } = useTranslation('common'); return ( <nav className='md:text-center md:flex-co...
luxor37/cookbook-vercel
src/@components/shared/page/index.tsx
<gh_stars>0 import Head from "next/head"; import { Navbar } from '@/components/shared/nav' export default function Page({ children, className = "" }) { return ( <div className={` ${className}`}> <Head> <title>MyCookbook</title> <meta name="viewport" content="init...
luxor37/cookbook-vercel
src/@components/modules/ingredients/index.tsx
<filename>src/@components/modules/ingredients/index.tsx import { useTranslation } from "next-i18next"; import Lang from "../../shared/lang"; export default function Ingredients({ ingredients }) { const { t } = useTranslation('common'); if (!ingredients) { return <></> } else { return (...
luxor37/cookbook-vercel
src/pages/_app.tsx
<filename>src/pages/_app.tsx<gh_stars>0 import type { AppProps } from 'next/app' import 'tailwindcss/tailwind.css' import '@/styles/tailwind.css'; import '@/styles/main.scss'; import "@fortawesome/fontawesome-svg-core/styles.css"; import { config } from "@fortawesome/fontawesome-svg-core"; config.autoAddCss = false; im...
luxor37/cookbook-vercel
src/@components/shared/link-button/index.tsx
<filename>src/@components/shared/link-button/index.tsx<gh_stars>0 import Link from 'next/link'; export default function LinkButton({ className="", href, text }) { return ( <Link href={href}> <a className={`${className} opacity-75 font-extrabold uppercase hover:opacity-100 focus:opacity-100`}> ...
luxor37/cookbook-vercel
src/@components/modules/reicpe-list/index.tsx
import RecipeCard from "@/components/shared/recipe-card"; import Row from "@/components/shared/row"; import { useTranslation } from "next-i18next"; export default function RecipeList({ recipes }) { if (!recipes || recipes.length == 0) { const { t } = useTranslation('common'); return <h1 className="...
luxor37/cookbook-vercel
src/@components/shared/lang/index.tsx
import { useTranslation } from 'react-i18next' export default function Lang({ children }) { const { i18n } = useTranslation('common'); var text = i18n.language == 'en' ? 'Translation error' : 'Erreur de traduction'; if (i18n.language == 'en' && children && children.en) { text = children.en } ...
luxor37/cookbook-vercel
src/@components/shared/nav/nav-button/index.tsx
import Link from 'next/link'; export default function NavButton({ href, text }) { return ( <Link href={href}> <a className="text-white opacity-75 block font-extrabold uppercase hover:opacity-100 focus:opacity-100 hover:text-white focus:text-white my-3"> {text} </a> ...
benkaiser/vscode-extension-auto-import
src/import-scanner.ts
import { NodeUpload } from './node-upload'; import * as FS from 'fs'; import * as vscode from 'vscode'; import * as _ from 'lodash'; import { ImportDb } from './import-db'; import { AutoImport } from './auto-import'; export class ImportScanner { private scanStarted: Date; private scanEnded: Date; priva...
fbi-templates/fbi-project-fullpack
src/scripts/ts.ts
<gh_stars>1-10 import '../styles/_base.css' function greeter (person: string) { return 'Hello, ' + person } const user = 'new User' document.querySelector('#text').innerHTML = greeter(user)
rick-schultz/rick-virtual-identity-coding-challenge-built
types/Users/Rick Schultz/Desktop/rick-virtual-identity-coding-challenge/.stencil/testing/index.d.ts
export * from './component-specs'; export * from './screenshot-stories';
rick-schultz/rick-virtual-identity-coding-challenge-built
types/global.d.ts
<gh_stars>0 // Add your global typings here declare module '*.md';
rick-schultz/rick-virtual-identity-coding-challenge-built
types/Users/Rick Schultz/Desktop/rick-virtual-identity-coding-challenge/.stencil/testing/screenshot-stories.d.ts
export declare const screenshotStories: (stories: any) => void;
rick-schultz/rick-virtual-identity-coding-challenge-built
types/Users/Rick Schultz/Desktop/rick-virtual-identity-coding-challenge/.stencil/testing/component-specs.d.ts
<filename>types/Users/Rick Schultz/Desktop/rick-virtual-identity-coding-challenge/.stencil/testing/component-specs.d.ts import { ComponentInterface } from '../../../../../../stencil-public-runtime'; export declare const createSpecComponent: <T>(componentTag: string, component: ComponentInterface | ComponentInterface[],...
rick-schultz/rick-virtual-identity-coding-challenge-built
types/components/example-component/example-component.stories.d.ts
declare const _default: { title: string; parameters: { docs: { description: { component: any; }; }; jest: string[]; }; }; export default _default; export declare const empty: (content: HTMLElement) => string;
rick-schultz/rick-virtual-identity-coding-challenge-built
types/components/example-component/example-component.d.ts
/// <reference types="react" /> export declare class ExampleComponent { headline: string; contactUS: string; private menuToggleOn; private menuToggleOff; render(): JSX.Element; }
costaivo/chapter
pages/dashboard/venues/index.tsx
import React, { useEffect } from 'react'; import { Grid } from '@material-ui/core'; import { useSelector } from 'react-redux'; import Link from 'next/link'; import { venueActions } from 'client/store/actions'; import { AppStoreState } from 'client/store/reducers'; import VenueItem from 'client/components/Dashboard/Ven...
costaivo/chapter
client/store/types/actions/events.ts
<reponame>costaivo/chapter export const FETCH_START = 'fcc/chapter/EVENTS_START'; export const FETCH_SUCCESS = 'fcc/chapter/EVENTS_SUCCESS'; export const FETCH_SINGLE_SUCCESS = 'fcc/chapter/EVENTS_SINGLE_SUCCESS'; export const FETCH_FAIL = 'fcc/chapter/EVENTS_FAIL'; export const CREATE_START = 'fcc/chapter/EVENT_CREAT...
costaivo/chapter
pages/dashboard/venues/[id]/edit.tsx
<reponame>costaivo/chapter import React, { useEffect } from 'react'; import { useSelector } from 'react-redux'; import { makeStyles } from '@material-ui/core'; import { useRouter } from 'next/router'; import { venueActions, locationActions } from 'client/store/actions'; import { AppStoreState } from 'client/store/redu...
costaivo/chapter
pages/dashboard/index.tsx
import React from 'react'; import Link from 'next/link'; import links from 'client/constants/DashboardLinks'; import { makeStyles } from '@material-ui/core'; const useStyles = makeStyles(() => ({ link: { fontSize: '1rem', marginRight: '1rem', }, })); const Dashboard: React.FC = () => { const styles = u...
costaivo/chapter
client/components/Dashboard/Events/EventForm.tsx
<gh_stars>0 import React from 'react'; import { useForm, Controller } from 'react-hook-form'; import { FormControl, TextField, Button, makeStyles, InputLabel, Select, MenuItem, } from '@material-ui/core'; import { IVenueModal } from 'client/store/types/venues'; interface IField { key: string; label: ...
costaivo/chapter
pages/dashboard/events/[id]/edit.tsx
import React from 'react'; import { Skeleton } from 'client/components/Dashboard/Events'; const EditEvent: React.FC = () => { return ( <Skeleton> <h1>Edit event</h1> </Skeleton> ); }; export default EditEvent;
costaivo/chapter
pages/dashboard/locations/new.tsx
import React from 'react'; import { useSelector } from 'react-redux'; import { makeStyles } from '@material-ui/core'; import { useRouter } from 'next/router'; import { locationActions } from 'client/store/actions'; import { AppStoreState } from 'client/store/reducers'; import sanitizeFormData from 'client/helpers/sani...
costaivo/chapter
pages/dashboard/venues/[id]/index.tsx
<gh_stars>0 import React, { useEffect } from 'react'; import { useSelector } from 'react-redux'; import { Card, Typography } from '@material-ui/core'; import { useRouter } from 'next/router'; import { venueActions } from 'client/store/actions'; import { AppStoreState } from 'client/store/reducers'; import { ProgressCa...
costaivo/chapter
server/controllers/userChapterController.ts
<reponame>costaivo/chapter import { Request, Response } from 'express'; import { Chapter, User } from 'server/models'; import { UserChapter } from 'server/models/UserChapter'; // The whole model is a json response, fix that if there's some sensitive data here export default { async join(req: Request, res: Response)...
costaivo/chapter
client/store/types/events.ts
import { ThunkAction } from 'redux-thunk'; import { AppStoreState } from '../reducers'; import * as ACTIONS from './actions/events'; export * from './actions/events'; export interface IEventModal { id?: number; chapterId?: string; name: string; description: string; start_at: Date; ends_at: Date; cancele...
costaivo/chapter
client/components/Dashboard/Events/EventItem.tsx
import React from 'react'; import { Card, Typography, Button } from '@material-ui/core'; import { useDispatch } from 'react-redux'; import Link from 'next/link'; import { IEventModal } from 'client/store/types/events'; import { eventActions } from 'client/store/actions'; import useConfirm from 'client/hooks/useConfirm...
costaivo/chapter
server/controllers/eventsController.ts
<gh_stars>0 import { Request, Response } from 'express'; import { Event } from 'server/models/Event'; import { PostgresErrorCodes } from 'server/util/PostgresErrorConstants'; import { Tag } from 'server/models/Tag'; import sanitizeTags from 'server/util/sanitizeTags'; // The whole model is a json response, fix that if...
costaivo/chapter
pages/dashboard/events/index.tsx
<reponame>costaivo/chapter import React, { useEffect } from 'react'; import { Grid } from '@material-ui/core'; import { useSelector } from 'react-redux'; import Link from 'next/link'; import { AppStoreState } from 'client/store/reducers'; import { eventActions } from 'client/store/actions'; import { IEventModal } from...
costaivo/chapter
client/store/reducers/events.ts
<filename>client/store/reducers/events.ts import produce from 'immer'; import { eventsTypes } from '../types'; const initialState: eventsTypes.IEventStoreState = { loading: true, events: [], chapterId: '', error: '', create: { state: 'idle', error: '', }, }; const reducer = (state = initialState, ...
costaivo/chapter
client/store/actions/events/index.ts
import { ActionCreator } from 'redux'; import { HttpService } from 'client/services/http-service'; import { eventsTypes } from '../../types'; import { fetchStart, fetchSuccess, fetchFail, fetchSingleSuccess, createStart, createFail, createSuccess, removeFail, removeSuccess, } from './actions'; export...
costaivo/chapter
pages/dashboard/locations/[id]/index.tsx
import React, { useEffect } from 'react'; import { useSelector } from 'react-redux'; import { Card, Typography } from '@material-ui/core'; import { useRouter } from 'next/router'; import { locationActions } from 'client/store/actions'; import { AppStoreState } from 'client/store/reducers'; import { ProgressCardContent...
costaivo/chapter
pages/dashboard/events/[id]/index.tsx
import React, { useEffect } from 'react'; import { useSelector } from 'react-redux'; import { Card, Typography } from '@material-ui/core'; import { useRouter } from 'next/router'; import { eventActions } from 'client/store/actions'; import { AppStoreState } from 'client/store/reducers'; import { ProgressCardContent } ...
costaivo/chapter
client/components/Dashboard/Venues/VenueForm.tsx
<reponame>costaivo/chapter import React from 'react'; import { useForm, Controller } from 'react-hook-form'; import { Button, TextField, makeStyles, FormControl, Select, InputLabel, MenuItem, } from '@material-ui/core'; import { ILocationModal } from 'client/store/types/locations'; import getLocationStri...
costaivo/chapter
client/store/actions/events/actions.ts
import { eventsTypes } from 'client/store/types'; export const fetchStart = (): eventsTypes.IEventActionTypes => { return { type: eventsTypes.FETCH_START, }; }; export const fetchSuccess = ( events: eventsTypes.IEventModal[], chapterId: string, ): eventsTypes.IEventActionTypes => { return { type: ev...
costaivo/chapter
pages/dashboard/venues/new.tsx
import React, { useEffect } from 'react'; import { useSelector } from 'react-redux'; import { makeStyles } from '@material-ui/core'; import { useRouter } from 'next/router'; import { locationActions, venueActions } from 'client/store/actions'; import { AppStoreState } from 'client/store/reducers'; import sanitizeFormD...
Mukkesh20/Trackcov
src/app/app.module.ts
<filename>src/app/app.module.ts<gh_stars>0 import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { AppRoutingModule } from './app-routing.module'; imp...
Mukkesh20/Trackcov
src/app/charts/chartjs/charts.component.ts
<filename>src/app/charts/chartjs/charts.component.ts import { Component, OnInit } from '@angular/core'; import { ThemeService } from 'ng2-charts'; @Component({ selector: 'app-chart', templateUrl: './charts.component.html', styleUrls: ['./charts.component.scss'], //providers:[] }) export class ChartsComponent i...
Mukkesh20/Trackcov
src/app/sidebar/sidebar.component.ts
<gh_stars>0 import { Component, OnInit } from '@angular/core'; import { DashBoardService } from '../dashboard/dashboard.service'; @Component({ selector: 'app-sidebar', templateUrl: './sidebar.component.html', styleUrls: ['./sidebar.component.scss'] }) export class SidebarComponent implements OnInit { countryLi...
Mukkesh20/Trackcov
src/app/dashboard/dashboard.component.ts
<filename>src/app/dashboard/dashboard.component.ts import { Component, OnInit } from '@angular/core'; import { ViewEncapsulation } from '@angular/core'; import { Subscription } from 'rxjs'; import { DashBoardService } from './dashboard.service'; import { Router, ActivatedRoute } from '@angular/router'; import { FormGro...
cowai/gccgce
src/main.ts
// eslint-disable-next-line @typescript-eslint/no-unused-vars function updateEventColor(): void { const timeMinDate = new Date() timeMinDate.setHours(timeMinDate.getHours() - 2) const optionalArgs = { timeMin: timeMinDate.toISOString(), showDeleted: false, singleEvents: true, maxResults: 10, o...
dejapong/grafana
public/app/features/library-panels/state/api.ts
<gh_stars>1-10 import { getBackendSrv } from '@grafana/runtime'; import { LibraryPanelDTO, PanelModelWithLibraryPanel } from '../types'; export async function getLibraryPanels(): Promise<LibraryPanelDTO[]> { const { result } = await getBackendSrv().get(`/api/library-panels`); return result; } export async functio...
multum/react-updates
types/index.d.ts
<gh_stars>1-10 import { ComponentType, FunctionComponent } from 'react'; interface DebuggerSettings { disabled?: boolean; } /** * @example * import { setDebuggerSettings } from 'react-updates'; * setDebuggerSettings({ * disabled: process.env.NODE_ENV === 'production' * }); */ export function setDebuggerSett...
FeatureToggleStudy/open-kilda
services/src/openkilda-gui/ui/src/app/modules/isl/isl-detail/isl-detail.component.ts
<gh_stars>0 import { Component, OnInit, EventEmitter, Output, AfterViewInit, OnDestroy } from '@angular/core'; import { HttpClient } from "@angular/common/http"; import { IslDetailModel } from '../../../common/data-models/isl-detail-model'; import { Observable } from "rxjs"; import { ActivatedRoute, Router } from '...
FeatureToggleStudy/open-kilda
services/src/openkilda-gui/ui/src/app/common/services/flowpath.service.ts
import { Injectable } from '@angular/core'; import { CommonService } from './common.service'; import * as d3 from "d3"; import { environment } from "src/environments/environment"; import { Subject } from 'rxjs'; import { Router } from '@angular/router'; @Injectable({ providedIn: 'root' }) export class Flow...
FeatureToggleStudy/open-kilda
services/src/openkilda-gui/ui/src/app/common/components/sidebar/sidebar.component.ts
import { Component, OnInit } from '@angular/core'; import { Router, NavigationEnd } from '@angular/router'; import { CommonService } from '../../services/common.service'; @Component({ selector: 'app-sidebar', templateUrl: './sidebar.component.html', styleUrls: ['./sidebar.component.css'] }) export class...
FeatureToggleStudy/open-kilda
services/src/openkilda-gui/ui/src/app/modules/flows/flow-path/flow-path.component.ts
<reponame>FeatureToggleStudy/open-kilda import { Component, OnInit, Input, OnDestroy } from "@angular/core"; import { FlowsService } from "../../../common/services/flows.service"; import { NgxSpinnerService } from "ngx-spinner"; import { LoaderService } from "../../../common/services/loader.service"; import { Route...
opstalent/ot-ng2-oauth
src/oauth.module.ts
<gh_stars>0 import { NgModule, ModuleWithProviders } from '@angular/core'; import { CommonModule } from '@angular/common'; import { OAuthService } from './services/oauth.service'; import { HttpService } from './services/http.service'; @NgMo...
opstalent/ot-ng2-oauth
src/services/oauth.service.ts
<reponame>opstalent/ot-ng2-oauth<filename>src/services/oauth.service.ts import { Injectable, Inject } from '@angular/core'; import { Http, Headers, RequestOptions, Response } from '@angular/http'; import { Observable } from 'rxjs/Rx'; import ...
opstalent/ot-ng2-oauth
src/services/oauth.service.spec.ts
<gh_stars>0 import { async, inject, TestBed } from '@angular/core/testing'; import { MockBackend } from '@angular/http/testing'; import { XHRBackend, Response, HttpModule } from '@angular/http'; import { OAuthSe...
opstalent/ot-ng2-oauth
src/services/http.service.spec.ts
<filename>src/services/http.service.spec.ts<gh_stars>0 import { Http, XHRBackend, HttpModule, Response, ResponseOptions } from '@angular/http'; import { fakeAsync, tick, async, inject, TestBed } from '@angular/core/testing'; im...
opstalent/ot-ng2-oauth
src/models/opAuthConfig.ts
<filename>src/models/opAuthConfig.ts<gh_stars>0 export interface IAuthConfig { clientId: string; clientSecret: string; baseUrl: string; grantPath: string; revokePath: string; } export const AUTH_CONFIG = 'authConfig';
opstalent/ot-ng2-oauth
index.ts
export * from './src/oauth.module'; export * from './src/services/oauth.service'; export * from './src/services/http.service';
opstalent/ot-ng2-oauth
src/services/user.service.ts
import { Injectable } from '@angular/core'; @Injectable() export class OAuthUser { storageKey: string = 'oauth_user'; /** * Retrieve user from local storage */ getUser(): any { if (typeof(Storage) !== 'undefined') { let data = localStorage.getItem(this.storageKey); ...
opstalent/ot-ng2-oauth
src/services/http.service.ts
import { Injectable } from '@angular/core'; import { Headers, Http, Request, RequestOptions, RequestOptionsArgs, Response } from '@angular/http'; import { OAuthService } from './oauth.service'; import { OAuthToken } from './token.service'; import { Observable, ...
opstalent/ot-ng2-oauth
src/services/token.service.ts
import { capitalize } from 'lodash'; export class OAuthToken { static storageKey: string = 'oauth'; /** * Retrieve token from local storage */ static getToken(): any { if (typeof(Storage) === 'undefined') { return false; } let data = localStorage.getItem(this....
thiessenp/chatapp-web
client/src/util/poll.ts
<gh_stars>0 /** * e.g. use: * useEffect(() => { const callback:any = () => { return dispatch(getChatAction({chatId})); } const poll = new Poll({callback}); return () => { poll.stop(); } }, [chatId]) */ export class Poll { isPolling:boolean = false; delay:...
thiessenp/chatapp-web
client/src/pages/ChatsPage/Chat.tsx
<reponame>thiessenp/chatapp-web import React, {useEffect, useState} from 'react'; import {useParams} from 'react-router-dom'; import {useDispatch, useSelector} from 'react-redux'; import {Poll} from '../../util/poll'; import {requestPostMessage, requestPostMessageFiles, getChatAction, addUserTochat} from '../../s...
thiessenp/chatapp-web
client/src/store/app.ts
/** * Stores shared Client Only Chats Data */ export const ACTIVE_CHAT = 'ACTIVE_CHAT'; export function activeChat({chatId}) { return async (dispatch) => { dispatch({type: ACTIVE_CHAT, payload: { activeChatId: chatId }}); } } const INITIAL_STATE = { activeChatId: null }; expo...
thiessenp/chatapp-web
client/src/store/store.ts
import {combineReducers, createStore, applyMiddleware} from 'redux'; import thunkMiddleware from 'redux-thunk'; import {composeWithDevTools} from 'redux-devtools-extension'; import {healthReducer} from './health'; import {accountReducer} from './account'; import {chatsReducer} from './chats'; import {appReducer...
thiessenp/chatapp-web
client/src/pages/ChatsPage/ChatsPage.tsx
<gh_stars>0 import {useEffect} from 'react'; import {useRouteMatch, Route, Switch} from 'react-router-dom'; import {useDispatch, useSelector} from 'react-redux'; import {getChatsAction} from '../../store/chats'; import {healthAction} from '../../store/health'; import {Poll} from '../../util/poll'; import {Chats...
thiessenp/chatapp-web
client/src/store/chats.ts
<reponame>thiessenp/chatapp-web import {getAuthHeader} from '../store/account'; import { formatFlux } from '../util/format'; export interface IChat { id: string, //uuid // Set on joining a chat - possibly independently chatUserId?: string, //uuid name: string, roster: [], transcript:...
thiessenp/chatapp-web
client/src/components/Transcript.tsx
<reponame>thiessenp/chatapp-web import {useState, useRef, useEffect} from 'react'; import {debounce} from 'debounce'; // import {useSelector} from 'react-redux'; import {ListNav} from 'keynav-web'; import './Transcript.scss'; export function Transcript(props) { // const getActiveChatId = useSelector(sta...
thiessenp/chatapp-web
client/src/components/ChatsList.tsx
<reponame>thiessenp/chatapp-web import {useEffect, useRef, useState} from 'react'; import {useDispatch, useSelector} from 'react-redux'; import {activeChat} from '../store/app'; import {useHistory,useRouteMatch} from 'react-router-dom'; import {ChatsListItem} from './ChatsListItem'; import './ChatsList.scss'; ...
thiessenp/chatapp-web
client/src/components/MainHeader.tsx
// import {useRef} from 'react'; import {Link} from 'react-router-dom'; // export const MainHeader = React.forwardRef((props, ref) => { export function MainHeader() { // const mainRef = useRef<HTMLDivElement>(null); return ( // <header ref={mainRef} className="sticky-top app-header"> <...
thiessenp/chatapp-web
client/src/pages/LoginPage/LoginPage.tsx
import React, {useEffect} from 'react'; import {useHistory /*,useLocation*/} from 'react-router-dom'; import {useDispatch, useSelector} from 'react-redux'; // import {isAuth} from '../../services/accountService'; // import {requestGetHealth} from '../../services/healthService'; import {healthAction} from '../../...
thiessenp/chatapp-web
client/src/store/account.ts
import { formatFlux } from '../util/format'; export interface IAccount { id: string, username: string, idToken: string, //TODO source of bug? on check auth need to check expiresIn also? //Actually get a 401 so better with a account action that triggers a redirect to login and resets all stat...
thiessenp/chatapp-web
client/src/components/DragAndDrop.tsx
import React from 'react'; type MyProps = {handleDropCallback: any}; type MyState = {drag: boolean}; export class DragAndDrop extends React.Component<MyProps, MyState> { dropRef: any; constructor(props) { super(props); this.state = { drag: false }; this.dropRef = React.cr...
thiessenp/chatapp-web
client/src/components/ChatsListItem.tsx
import {Link, useRouteMatch} from 'react-router-dom'; import {useDispatch, useSelector} from 'react-redux'; import {activeChat} from '../store/app'; import './ChatsListItem.scss'; export function ChatsListItem(props) { let {url} = useRouteMatch(); const dispatch = useDispatch(); const activeCha...
thiessenp/chatapp-web
client/src/components/FileUploadModal.tsx
<filename>client/src/components/FileUploadModal.tsx<gh_stars>0 import React, {FormEvent, useState /*, useEffect*/} from 'react'; import Button from 'react-bootstrap/Button'; import Modal from 'react-bootstrap/Modal'; import {DragAndDrop} from './DragAndDrop'; // TODO use my accessible modal later export func...
thiessenp/chatapp-web
client/src/components/ErrorMessage.tsx
<gh_stars>0 /** * Displays a generic and consistent error message in the UI * @param props Error data */ export function ErrorMessage(props) { if (!props || !props.message) { return null; } // TODO: could add logic here from more props return ( <div className="mt-4 ale...
thiessenp/chatapp-web
client/src/components/AuthGuard.tsx
<gh_stars>0 import {Route, Redirect} from 'react-router-dom'; import {useSelector} from 'react-redux'; import {isAuth} from '../store/account'; function RouteGuard({component: Component, /*auth,*/ ...rest}) { const account = useSelector(state => state.account); return( <Route {...rest} ...
thiessenp/chatapp-web
client/src/store/error.ts
<gh_stars>0 // DEPRECATED? // // Using the flux formatter, is simpler and clearer I think? // (plus keeps more state logic in the Reducer (BP)) import {IAction} from '../util/format'; /** * Used to format and create a standard error for all components. * Follows the Flux pattern * see: https://github...
thiessenp/chatapp-web
client/src/util/format.ts
<reponame>thiessenp/chatapp-web /** * Actions FLUX standard for Error object properties. * More info https://github.com/redux-utilities/flux-standard-action */ export interface IAction { // identifies to the consumer the nature of the action that has occurred type: string, // Any information ...
thiessenp/chatapp-web
client/src/store/health.ts
import {formatFlux, IAction} from '../util/format'; export interface IHealth { status: string } export enum HEALTH { UNKNOWN = 'UNKNOWN', DOWN = 'DOWN', UP = 'UP' } export const HEALTH_REQUEST = 'HEALTH_REQUEST'; export const HEALTH_SUCCESS = 'HEALTH_SUCCESS'; export const HEALTH_ERROR ...
thiessenp/chatapp-web
client/src/pages/HomePage/HomePage.tsx
import {useEffect,} from 'react'; import {Link} from 'react-router-dom'; import {useDispatch, useSelector} from 'react-redux'; // NOTE: Important to do Component specific imports. // This would import entire lib: import { Button } from 'react-bootstrap'; // import Button from 'react-bootstrap/Button'; // import...
thiessenp/chatapp-web
client/src/index.tsx
<gh_stars>0 import React from 'react'; import ReactDOM from 'react-dom'; import {BrowserRouter, Route, Switch, Redirect} from 'react-router-dom'; import {Provider} from 'react-redux'; import {store} from './store/store'; // import App from './App'; import reportWebVitals from './reportWebVitals'; import RouteGuard fr...
thiessenp/chatapp-web
client/src/components/Composer.tsx
import {useState, useEffect, useRef} from 'react'; import {useSelector} from 'react-redux'; import {FileUploadModal} from './FileUploadModal'; import './Composer.scss'; export function Composer(props) { const [files, setFiles] = useState([]); const [showFileModal, setShowFileModal] = useState(false); ...
thiessenp/chatapp-web
client/src/components/Roster.tsx
<filename>client/src/components/Roster.tsx import {useState, useRef, useEffect} from 'react'; import {ListNav} from 'keynav-web'; import './Roster.scss'; export function Roster(props) { const [listNav, setListNav] = useState<any>(null); const rosterRef = useRef<HTMLOListElement>(null); // Add ...
QuietWind/find-imports
test/index.test.ts
<gh_stars>0 import * as assert from "assert"; import * as path from "path"; import f, { findImports } from "./../src/index"; describe("findImports", () => { describe("#findImports fixture", () => { const strs = f.findImportsByName( path.resolve(__dirname, "./files/fixture.js") ); it("find all requ...
QuietWind/find-imports
test/files/NormalTodo.tsx
import * as React from "react"; import { Link } from "react-router-dom"; import { TodoItem, TTodoItem } from "./TodoItem"; import { Map } from "immutable"; import * as Perf from "react-addons-perf"; import testData from "./data"; import "./Todo.css"; window.Perf = Perf; interface TodoProps {} interface TodoState { ...
QuietWind/find-imports
src/index.ts
import { extname, relative, isAbsolute } from "path"; import * as fs from "fs"; import * as store from "data-store"; import { digest, findModulePath, extensions } from "./file"; import { findImportsByName, findImportsByNameAsync } from "./find.by.name"; export interface TFindImportsOptions { findChild: boolean; lo...
QuietWind/find-imports
test/files/prueRender.tsx
import * as React from "react"; import { is } from "immutable"; // function diffValue(a: any, b: any) { // if (typeof a === "function" || typeof b === "function") { // return true; // } else if (!is(Map(a), Map(b))) { // return false; // } // return true; // } // function diffEqual(a: Object, b: Obje...
QuietWind/find-imports
types/index.d.ts
<reponame>QuietWind/find-imports declare module "babel-traverse"; declare module "data-store";
QuietWind/find-imports
lib/find.by.name.d.ts
<reponame>QuietWind/find-imports<filename>lib/find.by.name.d.ts export declare function findImportsByName(filename: string): string[]; export declare function findImportsByNameAsync(filename: string): Promise<string[]>;
QuietWind/find-imports
src/util.ts
<gh_stars>0 import * as colors from "colors"; export function msgError(text: string) { console.log(colors.red(text)); } export function msgSuccess(text: string) { console.log(colors.green(text)); }
QuietWind/find-imports
src/find.by.name.ts
<gh_stars>0 import * as fs from "fs"; import * as path from "path"; import { findImportsByStr } from "./find.by.str"; const r = (str: string, filename: string): string[] => { const ext = path.extname(filename); const options = { isTS: /\.tsx?$/i.test(ext), filename }; return findImportsByStr(str, opti...
QuietWind/find-imports
lib/find.by.str.d.ts
export interface TFindImportsByStrOptions { isTS: boolean; filename: string; } export declare function findImportsByStr(str: string, options: TFindImportsByStrOptions): string[];
QuietWind/find-imports
test/files/TodoItem.tsx
<reponame>QuietWind/find-imports<filename>test/files/TodoItem.tsx import * as React from "react"; import { Map, is } from "immutable"; export interface TTodoItem { title: string; check?: boolean; } interface TodoItemProps { index: number; onChange: any; todo: Map<string, any>; } interface TodoItemState {} ...
QuietWind/find-imports
test/files/Todo.tsx
<gh_stars>0 import * as React from "react"; import { Link } from "react-router-dom"; import * as Perf from "react-addons-perf"; import { TodoItem } from "./TodoItem"; import { List, Map, fromJS, is } from "immutable"; import testData from "./data"; import "./Todo.css"; window.Perf = Perf; interface TodoProps {} inte...
QuietWind/find-imports
test/files/Enhance.tsx
<gh_stars>0 import * as React from "react"; export function IntervalEnhance<P>(ComposedComponent: React.ComponentClass<P>) { return class extends React.Component<any, any> { static displayName = "ComponentEnhancedWithIntervalHOC"; interval: number; constructor(props: any) { super(props); th...
QuietWind/find-imports
test/files/Home.tsx
<gh_stars>0 import * as React from "react"; interface HomeProps {} interface HomeState {} export class Home extends React.Component<HomeProps, HomeState> { public render(): JSX.Element { return <span>Home</span>; } } export default Home;
QuietWind/find-imports
lib/file.d.ts
<filename>lib/file.d.ts<gh_stars>0 export declare const extensions: string[]; export interface PathOption { baseUrl: string[]; } export declare function digest(str: string): string; export declare function genPath(root: string, filename: string): string | null; /** * node_modules do not thinks * @param filename_r...
QuietWind/find-imports
test/files/App.tsx
import * as React from "react"; import { BrowserRouter as Router, Route } from "react-router-dom"; import Todo from "./Todo"; import NormalTodo from "./NormalTodo"; import { Home } from "./Home"; import "./App.css"; const logo = require("./logo.svg"); class App extends React.Component { render() { return ( ...
QuietWind/find-imports
lib/util.d.ts
<filename>lib/util.d.ts export declare function msgError(text: string): void; export declare function msgSuccess(text: string): void;