repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
adinvadim/vuex-orm-next
test/feature/repository/updates_update_composite_key.spec.ts
import { createStore, fillState, assertState } from 'test/Helpers' import { Model, Attr, Str, Num } from '@/index' describe('feature/repository/updates_update_composite_key', () => { class User extends Model { static entity = 'users' static primaryKey = ['idA', 'idB'] @Attr() idA!: any @Attr() idB!...
adinvadim/vuex-orm-next
test/feature/repository/save.spec.ts
import { createStore, fillState, assertState } from 'test/Helpers' import { Model, Str, Num } from '@/index' describe('feature/repository/save', () => { class User extends Model { static entity = 'users' @Num(0) id!: number @Str('') name!: string @Num(0) age!: number } it('does nothing when pas...
adinvadim/vuex-orm-next
test/feature/repository/deletes_delete.spec.ts
import { createStore, fillState, assertState } from 'test/Helpers' import { Model, Attr, Str } from '@/index' describe('feature/repository/deletes_delete', () => { class User extends Model { static entity = 'users' @Attr() id!: any @Str('') name!: string } it('deletes a record specified by the wher...
adinvadim/vuex-orm-next
test/feature/relations/has_many_insert.spec.ts
import { createStore, assertState } from 'test/Helpers' import { Model, Attr, Str, HasMany } from '@/index' describe('feature/relations/has_many_insert', () => { class User extends Model { static entity = 'users' @Attr() id!: number @Str('') name!: string @HasMany(() => Post, 'userId') posts!: ...
adinvadim/vuex-orm-next
test/feature/repository/inserts_new.spec.ts
<reponame>adinvadim/vuex-orm-next<gh_stars>0 import { createStore, assertState, mockUid } from 'test/Helpers' import { Model, Str, Num, Bool, Uid, Attr } from '@/index' describe('feature/repository/inserts_new', () => { it('inserts with a models default values', async () => { class User extends Model { sta...
adinvadim/vuex-orm-next
test/feature/repository/retrieves_revive.spec.ts
<reponame>adinvadim/vuex-orm-next<filename>test/feature/repository/retrieves_revive.spec.ts import { createStore, fillState } from 'test/Helpers' import { Model, Num, Str } from '@/index' describe('feature/repository/retrieves_revive', () => { class User extends Model { static entity = 'users' @Num(0) id!: ...
adinvadim/vuex-orm-next
test/feature/repository/inserts_replace.spec.ts
<reponame>adinvadim/vuex-orm-next<gh_stars>0 import { createStore, fillState, assertState } from 'test/Helpers' import { Model, Attr, Str } from '@/index' describe('feature/repository/inserts_replace', () => { class User extends Model { static entity = 'users' @Attr() id!: any @Str('') name!: string }...
adinvadim/vuex-orm-next
src/interpreter/Interpreter.ts
import { normalize, schema as Normalizr } from 'normalizr' import { isArray, isEmpty } from '../support/Utils' import { Element, NormalizedData } from '../data/Data' import { Model } from '../model/Model' import { Database } from '@/database/Database' export class Interpreter<M extends Model> { /** * The database...
adinvadim/vuex-orm-next
test/regression/normalizing_nested_relations_missing_parent_model.spec.ts
<gh_stars>0 import { createStore, assertState } from 'test/Helpers' import { Model, Str, Num, BelongsTo, HasMany } from '@/index' // A model with more than 2 related models related to the same model was // causing a normalization error. It was due to the Schema class was caching // the first created schema with its ke...
adinvadim/vuex-orm-next
src/query/Query.ts
<filename>src/query/Query.ts import { isArray, isFunction, isEmpty, orderBy, groupBy, assert } from '../support/Utils' import { Element, Elements, NormalizedData, Item, Collection, Collections } from '../data/Data' import { Relation } from '../model/attributes/relations/Relation' import { Model ...
adinvadim/vuex-orm-next
test/feature/relations/nested/nested_revive.spec.ts
<reponame>adinvadim/vuex-orm-next<filename>test/feature/relations/nested/nested_revive.spec.ts import { createStore, fillState } from 'test/Helpers' import { Model, Attr, BelongsTo, HasMany } from '@/index' describe('feature/relations/nested/nested_revive', () => { class User extends Model { static entity = 'use...
adinvadim/vuex-orm-next
test/unit/model/Model.spec.ts
import { Model } from '@/model/Model' describe('unit/model/Model', () => { class User extends Model { static entity = 'users' } it('throws when accessing the store but it is not injected', () => { expect(() => new User().$database()).toThrow() }) })
richmccartney/mono-test
packages/react/src/components/BackgroundProvider/BackgroundProvider.stories.tsx
import React from 'react'; import { Meta, Story } from '@storybook/react'; import BackgroundProvider, { BackgroundProviderProps } from '.'; import mdx from './BackgroundProvider.mdx'; export default { title: 'Components/BackgroundProvider', args: { children: 'BackgroundProvider' }, parameters: { docs: { ...
richmccartney/mono-test
packages/react/src/components/Surface/Surface.types.ts
<reponame>richmccartney/mono-test<filename>packages/react/src/components/Surface/Surface.types.ts import React, { HTMLAttributes } from 'react'; export type Backgrounds = 'primary' | 'secondary' | 'gray' | 'white' | 'dark'; export interface SurfaceProps extends HTMLAttributes<HTMLElement> { /** Content to display i...
richmccartney/mono-test
packages/react/src/components/Button/Button.types.ts
import React, { MouseEvent, ReactNode } from 'react'; export interface ButtonProps { children?: ReactNode; id?: string; isFullWidth?: boolean; /** Optionally specify Button onClick function */ onClick?: (e: MouseEvent<HTMLElement>) => void; }
richmccartney/mono-test
packages/react/src/components/ThemeProvider/ThemeProvider.test.ssr.tsx
import React from 'react'; import { renderToString } from 'react-dom/server'; import { ThemeProvider } from '..'; describe('<ThemeProvider /> Server-side rendering>', () => { test(': renders on a server without crashing', () => { const renderOnServer = () => renderToString(<ThemeProvider />); expect(renderO...
richmccartney/mono-test
packages/react/src/components/Surface/Surface.test.tsx
<reponame>richmccartney/mono-test import React from 'react'; import { render } from '@testing-library/react'; import { Surface } from '..'; import { SurfaceProps } from '.'; describe('<Surface />', () => { const defaultProps: SurfaceProps = { testId: 'test-surface', }; test(': matches snapshot', () => { ...
richmccartney/mono-test
packages/react/src/components/BackgroundProvider/BackgroundProvider.tsx
/** * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import React, { FunctionComponent, createContext } from 'react'; import type { BackgroundProviderProps } from '.'; const Context = createContext({ Background: '' }); const { Provider } ...
richmccartney/mono-test
packages/react/src/components/BackgroundProvider/BackgroundProvider.types.ts
export type BackgroundVariant = 'dark' | 'light' | undefined; export interface BackgroundProviderProps { /** * Background variant to be composed into the BackgroundProvider. */ background?: BackgroundVariant; /** * Content to display on the BackgroundProvider. */ children: any; }
richmccartney/mono-test
packages/react/.playroom/FrameComponent.tsx
<filename>packages/react/.playroom/FrameComponent.tsx<gh_stars>0 // .playroom/FrameComponent.tsx import React, { FunctionComponent } from 'react'; const reset = ` body { margin: 0; } `; const FrameComponent: FunctionComponent = ({ children }) => { return ( <> <style type="text/css">{reset}</style>...
richmccartney/mono-test
packages/react/src/components/ThemeProvider/ThemeProvider.stories.tsx
<filename>packages/react/src/components/ThemeProvider/ThemeProvider.stories.tsx<gh_stars>0 import React from 'react'; import { Meta, Story } from '@storybook/react'; import ThemeProvider, { ThemeProviderProps } from '.'; import mdx from './ThemeProvider.mdx'; export default { title: 'Components/ThemeProvider', arg...
richmccartney/mono-test
packages/react/src/components/ThemeProvider/ThemeProvider.test.tsx
<reponame>richmccartney/mono-test import React from 'react'; import { render } from '@testing-library/react'; import { ThemeProvider } from '..'; import { ThemeProviderProps } from '.'; describe('<ThemeProvider />', () => { const defaultProps: ThemeProviderProps = { testId: 'test-themeprovider', }; test(':...
richmccartney/mono-test
packages/react/src/components/ThemeProvider/themes/MonoTheme.tsx
<filename>packages/react/src/components/ThemeProvider/themes/MonoTheme.tsx<gh_stars>0 import React from 'react'; import './MonoTheme.scss'; const Theme = () => <React.Fragment></React.Fragment>; export default Theme;
richmccartney/mono-test
packages/react/src/components/Surface/Surface.tsx
/** * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import classNames from 'classnames'; import React, { FunctionComponent } from 'react'; import type { SurfaceProps } from '.'; import { BackgroundProvider } from '..'; import './Surface...
richmccartney/mono-test
packages/react/src/components/BackgroundProvider/BackgroundProvider.snippets.tsx
<filename>packages/react/src/components/BackgroundProvider/BackgroundProvider.snippets.tsx<gh_stars>0 export const BackgroundProviderSnippets = [ { group: 'BackgroundProvider', name: 'Default', code: ` <BackgroundProvider /> `, }, ];
richmccartney/mono-test
packages/react/src/components/ThemeProvider/ThemeProvider.snippets.tsx
<reponame>richmccartney/mono-test<filename>packages/react/src/components/ThemeProvider/ThemeProvider.snippets.tsx export const ThemeProviderSnippets = [ { group: 'ThemeProvider', name: 'Default', code: ` <ThemeProvider /> `, }, ];
richmccartney/mono-test
packages/react/src/components/index.ts
<filename>packages/react/src/components/index.ts /** * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ export { default as BackgroundProvider } from './BackgroundProvider'; export { default as Button } from './Button'; export { default as ...
richmccartney/mono-test
packages/react/src/components/Button/Button.tsx
<filename>packages/react/src/components/Button/Button.tsx import classNames from 'classnames'; import React, { forwardRef, FunctionComponent, useContext } from 'react'; import { ButtonProps } from './Button.types'; import { BackgroundProviderContext } from '../BackgroundProvider'; import './Button.scss'; type Ref = R...
richmccartney/mono-test
packages/react/src/components/BackgroundProvider/BackgroundProvider.test.a11y.tsx
<reponame>richmccartney/mono-test import React from 'react'; import { render } from '@testing-library/react'; import { BackgroundProvider } from '..'; import { BackgroundProviderProps } from '.'; import { axe, toHaveNoViolations } from 'jest-axe'; expect.extend(toHaveNoViolations); describe('<BackgroundProvider />',...
richmccartney/mono-test
packages/react/src/components/Surface/Surface.snippets.tsx
<gh_stars>0 export const SurfaceSnippets = [ { group: 'Surface', name: 'Default', code: ` <Surface /> `, }, ];
richmccartney/mono-test
packages/react/src/components/ThemeProvider/ThemeProvider.tsx
<filename>packages/react/src/components/ThemeProvider/ThemeProvider.tsx<gh_stars>0 /** * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import classNames from 'classnames'; import React, { FunctionComponent } from 'react'; import type { T...
richmccartney/mono-test
packages/react/src/components/snippets.ts
/** * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import { ButtonSnippets } from './Button/Button.snippets'; export default [...ButtonSnippets];
richmccartney/mono-test
packages/react/src/components/Button/Button.snippets.tsx
<filename>packages/react/src/components/Button/Button.snippets.tsx<gh_stars>0 export const ButtonSnippets = [ { group: 'Button', name: 'Default', code: ` <Button> Button </Button> `, }, ];
richmccartney/mono-test
packages/react/src/components/Surface/Surface.stories.tsx
import React from 'react'; import { Meta, Story } from '@storybook/react'; import Surface, { SurfaceProps } from '.'; import mdx from './Surface.mdx'; export default { title: 'Components/Surface', args: { children: 'Surface' }, parameters: { docs: { page: mdx, }, }, component: Surface, } as Met...
richmccartney/mono-test
packages/react/src/components/ThemeProvider/ThemeProvider.types.ts
export type ThemeVariant = 'mono' | 'chrome'; export type ScreenMode = 'light' | 'dark'; export interface ThemeProviderProps { /** Optional prop to specify the ID used for testing */ testId?: string; /** Content to display inside ThemeProvider. */ children?: React.ReactNode; /** Optional prop to specify cl...
richmccartney/mono-test
packages/react/src/components/Surface/Surface.test.a11y.tsx
<gh_stars>0 import React from 'react'; import { render } from '@testing-library/react'; import { Surface } from '..'; import { SurfaceProps } from '.'; import { axe, toHaveNoViolations } from 'jest-axe'; expect.extend(toHaveNoViolations); describe('<Surface />', () => { const defaultProps: SurfaceProps = { tes...
richmccartney/mono-test
packages/react/src/components/ThemeProvider/index.ts
<reponame>richmccartney/mono-test export { default } from './ThemeProvider'; export type { ThemeProviderProps } from './ThemeProvider.types';
richmccartney/mono-test
packages/react/src/components/BackgroundProvider/index.ts
export { default, BackgroundProviderContext } from './BackgroundProvider'; export type { BackgroundProviderProps } from './BackgroundProvider.types';
richmccartney/mono-test
packages/react/src/components/BackgroundProvider/BackgroundProvider.test.tsx
import React from 'react'; import { render } from '@testing-library/react'; import { BackgroundProvider } from '..'; import { BackgroundProviderProps } from '.'; describe('<BackgroundProvider />', () => { const defaultProps: BackgroundProviderProps = { testId: 'test-backgroundprovider', }; test(': matches ...
Colorfulstan/discord-bot-starter-kit
Lib/typescript-version/handlers/command.ts
import { readdirSync } from 'fs'; const ascii = require('ascii-table'); let table = new ascii('Commands'); table.setHeading('Commands', 'STATUS'); module.exports = (client: any) => { readdirSync('./commands/').forEach(dir => { const commands = readdirSync(`./commands/${dir}/`).filter(file => file.endsWith('...
Colorfulstan/discord-bot-starter-kit
Lib/typescript-version/index.ts
<reponame>Colorfulstan/discord-bot-starter-kit const { Client, Collection, RichEmbed } = require('discord.js'); const { config } = require('dotenv'); const client = new Client({ disableEveryone: true }); client.commands = new Collection(); client.aliases = new Collection(); config({ path: __dirname + '/.env' }); ['co...
Colorfulstan/discord-bot-starter-kit
Lib/typescript-version/functions.ts
module.exports = { getMember: function(message: any, toFind: any = '') { toFind = toFind.toLowerCase(); let target = message.guild.members.get(toFind); if (!target && message.mentions.members) target = message.mentions.members.first(); if (!target && toFind) { target = message.guild.member...
ArtMan-8/htmlacademy-dashboard
src/components/DataLoader/index.ts
export { default } from './DataLoader';
ArtMan-8/htmlacademy-dashboard
src/store/types.ts
import { IProject, INormalizedProject } from '../components/DataLoader/helpers'; export enum EActionType { SET_SELECTED_PROJECTS = 'SET_SELECTED_PROJECTS', SET_REQUEST_LIMIT = 'SET_REQUEST_LIMIT', ADD_REPOSITORIES = 'ADD_REPOSITORIES', UPDATE_FETCH_STATUS = 'UPDATE_FETCH_STATUS', CLEAR_REPOSITORIES = 'CLEAR_...
ArtMan-8/htmlacademy-dashboard
src/components/DataLoader/dataLoader.styles.ts
<filename>src/components/DataLoader/dataLoader.styles.ts import { createStyles, makeStyles } from '@material-ui/core/styles'; export default makeStyles(() => createStyles({ dataLoader: { margin: 20, padding: 20, }, progressBar: { margin: 20, }, button: { margin: 5, }, ...
ArtMan-8/htmlacademy-dashboard
src/pages/Charts/helpers.ts
import { INormalizedProject } from '../../components/DataLoader/helpers'; import { NotFound } from '../../constants'; function getRandomColor(opacity = 1) { const r = Math.random() * 255; const g = Math.random() * 255; const b = Math.random() * 255; return `rgba(${r}, ${g}, ${b}, ${opacity})`; } export const ...
ArtMan-8/htmlacademy-dashboard
src/pages/Table/helpers.ts
<reponame>ArtMan-8/htmlacademy-dashboard<filename>src/pages/Table/helpers.ts import { INormalizedProject } from '../../components/DataLoader/helpers'; export type Order = 'asc' | 'desc'; export function descendingComparator<T>(a: T, b: T, orderBy: keyof T): number { if (b[orderBy] < a[orderBy]) { return -1; }...
ArtMan-8/htmlacademy-dashboard
src/pages/Charts/charts.styles.ts
<gh_stars>0 import { createStyles, makeStyles } from '@material-ui/core/styles'; export default makeStyles(() => createStyles({ charts: { margin: '20px auto', maxWidth: 700, padding: 20, }, note: {}, }), );
ArtMan-8/htmlacademy-dashboard
src/graphql/GetStudentRepos.query.ts
<filename>src/graphql/GetStudentRepos.query.ts import { gql } from '@apollo/client'; import { PAGE_INFO, RATE_LIMIT, REPO_STUDENT_INFO, REPO_ACADEMY_INFO } from './fragment'; export const GET_STUDENT_REPOS = gql` ${RATE_LIMIT} ${PAGE_INFO} ${REPO_STUDENT_INFO} ${REPO_ACADEMY_INFO} query GetRepos($projectName...
ArtMan-8/htmlacademy-dashboard
src/pages/Search/helpers.ts
import { Courses, NotFound, PROXY_URL } from '../../constants'; export function generateOriginalCourseUrl(selectedCourse: string): string { return `${PROXY_URL}/get?url=https://github.com/${Courses[selectedCourse]?.organization}/`; } export function getCourseNumber(html: string): string { const parser = new DOMPa...
ArtMan-8/htmlacademy-dashboard
src/components/NotFoundRepo/index.ts
export { default } from './NotFoundRepo';
ArtMan-8/htmlacademy-dashboard
src/index.tsx
<gh_stars>0 import React from 'react'; import ReactDom from 'react-dom'; import { ApolloProvider } from '@apollo/client'; import StoreProvider from './store/store'; import App from './App'; import createApolloClient from './api/apollo.config'; import { GITHUB_GRAPHQL_ENDPOINT } from './constants'; ReactDom.render( <...
ArtMan-8/htmlacademy-dashboard
src/components/DataLoader/DataLoader.tsx
import React, { useContext, useState } from 'react'; import { useQuery } from '@apollo/client'; import { Link } from 'react-router-dom'; import LinearProgress from '@material-ui/core/LinearProgress'; import Paper from '@material-ui/core/Paper'; import Button from '@material-ui/core/Button'; import Typography from '@mat...
ArtMan-8/htmlacademy-dashboard
src/graphql/fragment.ts
<reponame>ArtMan-8/htmlacademy-dashboard import { gql } from '@apollo/client'; export const RATE_LIMIT = gql` fragment RateLimit on Query { rateLimit { remaining } } `; export const PAGE_INFO = gql` fragment PageInfo on SearchResultItemConnection { pageInfo { hasNextPage endCursor ...
ArtMan-8/htmlacademy-dashboard
src/components/DataLoader/helpers.ts
<filename>src/components/DataLoader/helpers.ts import { NotFound } from '../../constants'; export interface INormalizedPullRequest { branchName: string; branchUrl: string; merged: boolean; mentorName: string; mentorUrl: string; } export interface INormalizedProject { id: string; repoUrl: string; repoN...
ArtMan-8/htmlacademy-dashboard
src/module.d.ts
<gh_stars>0 declare module 'react-swipeable-views';
ArtMan-8/htmlacademy-dashboard
src/pages/Charts/Charts.tsx
<filename>src/pages/Charts/Charts.tsx import React, { useContext, useRef } from 'react'; import { Doughnut } from 'react-chartjs-2'; import Paper from '@material-ui/core/Paper'; import { store } from '../../store/store'; import NotFoundRepo from '../../components/NotFoundRepo'; import { getDataForDoughnutChart, options...
ArtMan-8/htmlacademy-dashboard
src/graphql/GetRateLimit.query.ts
import { gql } from '@apollo/client'; import { RATE_LIMIT } from './fragment'; export const GET_RATE_LIMIT = gql` ${RATE_LIMIT} query { ...RateLimit } `;
ArtMan-8/htmlacademy-dashboard
src/pages/Search/search.styles.ts
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles'; export default makeStyles((theme: Theme) => createStyles({ search: { margin: '20px auto', maxWidth: 600, }, form: { display: 'flex', flexDirection: 'column', margin: 20, padding: 20, back...
ArtMan-8/htmlacademy-dashboard
src/api/apollo.config.ts
import { ApolloClient, InMemoryCache, NormalizedCacheObject } from '@apollo/client'; export default function createApolloClient(uri: string): ApolloClient<NormalizedCacheObject> { return new ApolloClient({ uri, headers: { authorization: `Bearer ${process.env.GRAPHQL_API_KEY}`, }, connectToDevTo...
ArtMan-8/htmlacademy-dashboard
src/components/NotFoundRepo/NotFoundRepo.tsx
<filename>src/components/NotFoundRepo/NotFoundRepo.tsx import React from 'react'; import { Link } from 'react-router-dom'; import SearchIcon from '@material-ui/icons/Search'; import Paper from '@material-ui/core/Paper'; import Button from '@material-ui/core/Button'; import useStyles from './notFoundRepo.styles'; expor...
ArtMan-8/htmlacademy-dashboard
src/components/NotFoundRepo/notFoundRepo.styles.ts
import { createStyles, makeStyles } from '@material-ui/core/styles'; export default makeStyles(() => createStyles({ notFound: { margin: '20px auto', padding: 20, width: 'max-content', textAlign: 'center', fontSize: 16, fontWeight: 500, }, button: { margin: '20px ...
ArtMan-8/htmlacademy-dashboard
src/pages/Mentors/index.ts
export { default } from './Mentors';
ArtMan-8/htmlacademy-dashboard
src/components/Header/Header.tsx
import React from 'react'; import { Link } from 'react-router-dom'; import clsx from 'clsx'; import Drawer from '@material-ui/core/Drawer'; import AppBar from '@material-ui/core/AppBar'; import Toolbar from '@material-ui/core/Toolbar'; import List from '@material-ui/core/List'; import Typography from '@material-ui/core...
ArtMan-8/htmlacademy-dashboard
src/pages/Charts/index.ts
<reponame>ArtMan-8/htmlacademy-dashboard export { default } from './Charts';
ArtMan-8/htmlacademy-dashboard
src/pages/Table/table.styles.ts
<reponame>ArtMan-8/htmlacademy-dashboard import { createStyles, makeStyles } from '@material-ui/core/styles'; export default makeStyles(() => createStyles({ root: { width: '100%', }, paper: { margin: '20px', }, table: { minWidth: 1000, }, visuallyHidden: { border: ...
ArtMan-8/htmlacademy-dashboard
src/pages/Search/Search.tsx
<reponame>ArtMan-8/htmlacademy-dashboard<filename>src/pages/Search/Search.tsx import React, { useContext, useEffect, useState } from 'react'; import Button from '@material-ui/core/Button'; import Input from '@material-ui/core/Input'; import InputLabel from '@material-ui/core/InputLabel'; import MenuItem from '@material...
ArtMan-8/htmlacademy-dashboard
src/pages/Table/Table.tsx
<reponame>ArtMan-8/htmlacademy-dashboard<gh_stars>0 import React, { useContext, useState, useEffect } from 'react'; import MuiTable from '@material-ui/core/Table'; import TableBody from '@material-ui/core/TableBody'; import TableCell from '@material-ui/core/TableCell'; import { useMediaQuery } from '@material-ui/core';...
ArtMan-8/htmlacademy-dashboard
src/constants.ts
<filename>src/constants.ts<gh_stars>0 export const GITHUB_GRAPHQL_ENDPOINT = 'https://api.github.com/graphql'; export const PROXY_URL = 'https://hexlet-allorigins.herokuapp.com'; export const Author = { NAME: 'ArtMan-8', URL: 'https://github.com/ArtMan-8', }; export const NotFound = { TITLE: 'не определён', ...
ArtMan-8/htmlacademy-dashboard
src/store/reducer.ts
<filename>src/store/reducer.ts import { normalizeProject } from '../components/DataLoader/helpers'; import { EActionType, IState, TActions } from './types'; export default function reducer(state: IState, action: TActions): IState { switch (action.type) { case EActionType.SET_SELECTED_PROJECTS: return { ...
ArtMan-8/htmlacademy-dashboard
src/pages/Mentors/helpers.ts
<filename>src/pages/Mentors/helpers.ts<gh_stars>0 import { GridColDef } from '@material-ui/data-grid'; import { NotFound } from '../../constants'; import { INormalizedProject } from '../../components/DataLoader/helpers'; export const columns: GridColDef[] = [ { field: 'id', headerName: '№', width: 100, ...
ArtMan-8/htmlacademy-dashboard
src/pages/Mentors/Mentors.tsx
import React, { useContext } from 'react'; import { useMediaQuery } from '@material-ui/core'; import { DataGrid } from '@material-ui/data-grid'; import Paper from '@material-ui/core/Paper'; import NotFoundRepo from '../../components/NotFoundRepo'; import { store } from '../../store/store'; import getRowsForDataGrid, { ...
ArtMan-8/htmlacademy-dashboard
src/components/Main/Main.tsx
<filename>src/components/Main/Main.tsx import React from 'react'; interface IMain { children: React.ReactNode; } export default function Main({ children }: IMain): JSX.Element { return <main>{children}</main>; }
ArtMan-8/htmlacademy-dashboard
src/App/app.styles.ts
<filename>src/App/app.styles.ts<gh_stars>0 import { createStyles } from '@material-ui/core/styles'; export default createStyles({ '@global': { '#root': { display: 'flex', flexDirection: 'column', minHeight: '100vh', backgroundColor: '#f5f5f5', }, header: {}, main: { marg...
ArtMan-8/htmlacademy-dashboard
src/components/Footer/footer.styles.ts
import { createStyles, makeStyles } from '@material-ui/core/styles'; export default makeStyles(() => createStyles({ appBar: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', padding: 20, }, author: { color: 'white', textDecoration: 'underli...
ArtMan-8/htmlacademy-dashboard
src/components/Footer/Footer.tsx
<reponame>ArtMan-8/htmlacademy-dashboard<gh_stars>0 import React, { useState, useContext, useEffect } from 'react'; import { useQuery } from '@apollo/client'; import { Typography, Link, AppBar } from '@material-ui/core'; import Snackbar from '@material-ui/core/Snackbar'; import Slide from '@material-ui/core/Slide'; imp...
ArtMan-8/htmlacademy-dashboard
src/store/store.tsx
import React, { createContext, useReducer } from 'react'; import reducer from './reducer'; import { EFetchStatus, IState, TActions } from './types'; const initialState: IState = { selectedProjects: [], requestLimit: 0, fetchStatus: EFetchStatus.IDLE, projects: [], }; interface IStore { state: IState; disp...
ArtMan-8/htmlacademy-dashboard
src/pages/Mentors/mentors.styles.ts
<reponame>ArtMan-8/htmlacademy-dashboard<gh_stars>0 import { createStyles, makeStyles } from '@material-ui/core/styles'; export default makeStyles(() => createStyles({ root: { width: '100%', }, paper: { margin: '20px', }, }), );
ArtMan-8/htmlacademy-dashboard
src/App/App.tsx
import React from 'react'; import { BrowserRouter, Switch, Route } from 'react-router-dom'; import { CssBaseline, withStyles } from '@material-ui/core'; import Header from '../components/Header'; import Main from '../components/Main'; import Footer from '../components/Footer'; import styles from './app.styles'; import...
giorgiofederici/giorgiofederici-frontend
src/app/website/home/home.module.ts
import { NgModule } from '@angular/core'; // Routing import { RouterModule, Routes } from '@angular/router'; // FontAwesome import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { library } from '@fortawesome/fontawesome-svg-core'; import { faGithub, faTwitter, faLinkedin, faInstagram } from '@...
giorgiofederici/giorgiofederici-frontend
src/app/website/root/components/website-header/website-header.component.ts
import { Component } from '@angular/core'; @Component({ selector: 'website-header', templateUrl: './website-header.component.html', styleUrls: ['./website-header.component.scss'] }) export class WebsiteHeaderComponent { }
giorgiofederici/giorgiofederici-frontend
src/app/auth/services/auth.service.ts
import { Injectable } from '@angular/core'; import { Observable, of, throwError } from 'rxjs'; import { HttpClient } from '@angular/common/http'; import { environment } from 'src/environments/environment'; @Injectable({ providedIn: 'root' }) export class AuthService { /* private AUTH_BASE_URL = environmen...
giorgiofederici/giorgiofederici-frontend
src/app/admin/admin.module.ts
import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; // Router import { RouterModule, Routes } from '@angular/router'; // Guards import { AuthGuard } from '../auth/shared/guards/auth.guard'; // Shared import { SharedModule } from './shared/shared.module'; export const ROUTES: Ro...
giorgiofederici/giorgiofederici-frontend
src/app/website/root/website-root.module.ts
import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; // Routing import { RouterModule, Routes } from '@angular/router'; // Ng Bootstrap import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; // Font Awesome import { FontAwesomeModule } from '@fortawesome/angular-fontawes...
giorgiofederici/giorgiofederici-frontend
src/app/auth/auth.module.ts
<filename>src/app/auth/auth.module.ts import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; // Routing import { Routes, RouterModule } from '@angular/router'; // Material import { MaterialModule } from '../material/material.module'; // Shared import { SharedModule } from './shared...
giorgiofederici/giorgiofederici-frontend
src/app/admin/shared/resolvers/skills/skill.resolver.ts
<gh_stars>0 import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; // RxJS import { Observable } from 'rxjs'; import { filter, first, tap } from 'rxjs/operators'; // ngRx import { select, Store } from '@ngrx/store'; // Reducer import ...
giorgiofederici/giorgiofederici-frontend
src/app/website/root/components/website-nav/website-nav.component.ts
<reponame>giorgiofederici/giorgiofederici-frontend import { Component, OnInit } from '@angular/core'; @Component({ selector: 'website-nav', templateUrl: './website-nav.component.html', styleUrls: ['./website-nav.component.scss'] }) export class WebsiteNavComponent implements OnInit { isCollapsed: boo...
giorgiofederici/giorgiofederici-frontend
src/app/admin/shared/actions/skills/skills.actions.ts
// ngRx import { Action } from '@ngrx/store'; import { Update } from '@ngrx/entity'; // Shared import { Skill } from '../../models/skills/skill.model'; export enum SkillsActionTypes { // Get All Skills GetAllSkills = '[Skills] Get All Skills', GetAllSkillsSuccess = '[Skills/API] Get All Skills Success', GetAl...
giorgiofederici/giorgiofederici-frontend
src/app/admin/shared/models/projects/project.model.ts
export interface Project { _id: string; name: string; description: string; image?: string; repository?: string; link?: string; index?: number; modifiedAt: Date; createdAt: Date; }
giorgiofederici/giorgiofederici-frontend
src/app/website/cv/components/cv-skills/cv-skills.component.ts
<gh_stars>0 import { Component, Input } from '@angular/core'; // Models import { Skill } from '../../../../admin/shared/models/skills/skill.model'; @Component({ selector: 'website-cv-skills', templateUrl: './cv-skills.component.html', styleUrls: ['./cv-skills.component.scss'] }) export class CVSkillsComponent {...
giorgiofederici/giorgiofederici-frontend
src/app/admin/shared/reducers/projects/projects.reducer.ts
// NgRx import { createEntityAdapter, EntityAdapter, EntityState } from '@ngrx/entity'; import { createFeatureSelector, createSelector } from '@ngrx/store'; // Actions import { ProjectsActions } from '../../actions/projects'; // Models import { Project } from '../../models/projects/project.model'; export interface P...
giorgiofederici/giorgiofederici-frontend
src/app/website/shared/services/contact/contact.service.ts
import { Injectable } from '@angular/core'; export interface ContactMessage { firstName: string; lastName: string; email: string; message: string; } @Injectable() export class ContactService { constructor() { } sendMessage(contactMessage: ContactMessage): void { console.log('Message...
giorgiofederici/giorgiofederici-frontend
src/app/auth/shared/shared.module.ts
<reponame>giorgiofederici/giorgiofederici-frontend<filename>src/app/auth/shared/shared.module.ts import { NgModule, ModuleWithProviders } from '@angular/core'; import { CommonModule } from '@angular/common'; import { ReactiveFormsModule } from '@angular/forms'; // ngRx import { StoreModule } from '@ngrx/store'; import...
giorgiofederici/giorgiofederici-frontend
src/app/auth/logout/logout.module.ts
import { NgModule } from '@angular/core'; // Material import { MaterialModule } from 'src/app/material/material.module'; // Logout import { LogoutConfirmationDialogComponent } from './components/logout-confirmation-dialog/logout-confirmation-dialog.component'; @NgModule({ imports: [ MaterialModule ]...
giorgiofederici/giorgiofederici-frontend
src/app/admin/root/components/admin-footer/admin-footer.component.ts
import { Component, ChangeDetectionStrategy } from '@angular/core'; @Component({ selector: 'admin-footer', changeDetection: ChangeDetectionStrategy.OnPush, templateUrl: './admin-footer.component.html', styleUrls: ['./admin-footer.component.scss'] }) export class AdminFooterComponent {}
giorgiofederici/giorgiofederici-frontend
src/app/auth/shared/guards/auth.guard.ts
<filename>src/app/auth/shared/guards/auth.guard.ts import { CanActivate } from '@angular/router'; import { Injectable } from '@angular/core'; // RxJS import { Store, select } from '@ngrx/store'; import { Observable, of } from 'rxjs'; import { take, tap, filter, switchMap, catchError } from 'rxjs/operators'; // Auth s...
giorgiofederici/giorgiofederici-frontend
src/app/website/root/components/website-clip-text/website-clip-text.component.ts
import { Component, Input, ChangeDetectionStrategy, ViewChild, ElementRef, AfterViewInit, QueryList, ViewChildren, OnDestroy, OnInit } from '@angular/core'; import { style, animate, AnimationBuilder, AnimationPlayer } from '@angular/animations'; import { timer, Observable, Subscription } fro...
giorgiofederici/giorgiofederici-frontend
src/app/root/containers/app/app.component.ts
import { Component, OnInit } from '@angular/core'; // RxJs import { Observable } from 'rxjs'; // NgRx import { Store, select } from '@ngrx/store'; // Auth import * as fromAuth from '../../../auth/shared/reducers'; import { User } from 'src/app/auth/shared/models/user.model'; import { UserActions } from 'src/app/auth...
giorgiofederici/giorgiofederici-frontend
src/app/admin/shared/reducers/skills/skills.reducer.ts
<filename>src/app/admin/shared/reducers/skills/skills.reducer.ts // NgRx import { createEntityAdapter, EntityAdapter, EntityState } from '@ngrx/entity'; import { createFeatureSelector, createSelector } from '@ngrx/store'; // Actions import { SkillsActions } from '../../actions/skills'; // Models import { Skill } from...
giorgiofederici/giorgiofederici-frontend
src/app/website/shared/components/list-item/list-item.component.ts
<gh_stars>0 import { Component, Input, ChangeDetectionStrategy, Output, EventEmitter } from '@angular/core'; @Component({ selector: 'app-list-item', changeDetection: ChangeDetectionStrategy.OnPush, templateUrl: './list-item.component.html', styleUrls: ['list-item.component.scss'] }) export class ListIt...