1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

removed redux completely

This commit is contained in:
Fedor Katurov 2022-01-09 19:03:01 +07:00
parent 26e6d8d41b
commit a4bb07e9cf
323 changed files with 2464 additions and 3348 deletions

View file

@ -1,11 +1,11 @@
import { IComment, INode, ITag } from '~/redux/types';
import { ISocialProvider } from '~/redux/auth/types';
import { IComment, INode, ITag } from '~/types';
import { OAuthProvider } from '~/types/auth';
export const API = {
BASE: process.env.REACT_APP_API_HOST,
USER: {
LOGIN: '/user/login',
OAUTH_WINDOW: (provider: ISocialProvider) =>
OAUTH_WINDOW: (provider: OAuthProvider) =>
`${process.env.REACT_APP_API_HOST}oauth/${provider}/redirect`,
ME: '/user/',
PROFILE: (username: string) => `/user/user/${username}/profile`,

View file

@ -0,0 +1,25 @@
import { IUser } from '~/types/auth';
export enum Role {
Guest = 'guest',
User = 'user',
Admin = 'admin',
}
export const EMPTY_USER: IUser = {
id: 0,
role: Role.Guest,
email: '',
name: '',
username: '',
photo: undefined,
cover: undefined,
is_activated: false,
is_user: false,
fullname: '',
description: '',
last_seen: '',
last_seen_messages: '',
last_seen_boris: '',
};

View file

@ -0,0 +1,6 @@
import { OAuthProvider } from '~/types/auth';
export const SOCIAL_ICONS: Record<OAuthProvider, string> = {
vkontakte: 'vk',
google: 'google',
};

6
src/constants/events.ts Normal file
View file

@ -0,0 +1,6 @@
export enum EventMessageType {
OpenProfile = 'open_profile',
OAuthLogin = 'oauth_login',
OAuthProcessed = 'oauth_processed',
OAuthError = 'oauth_error',
}

View file

@ -1,5 +1,5 @@
import { FC } from 'react';
import { IComment, INode, ValueOf } from 'src/redux/types';
import { IComment, INode, ValueOf } from '~/types';
import { NodeTextBlock } from '~/components/node/NodeTextBlock';
import { NodeAudioBlock } from '~/components/node/NodeAudioBlock';
import { NodeVideoBlock } from '~/components/node/NodeVideoBlock';

View file

@ -64,6 +64,11 @@ export const PHRASES = {
'Звук из преисподней',
'Симулятор счастливого человека',
],
REGISTER: [
'Сушёный кабачок особенно хорош в это время года, знаете ли.',
'Бывало, стреляешь по кабачку, или он стреляет в тебя.',
'Он всегда рядом, кабачок -- первый сорт! Надежда империи.',
],
};
export const getRandomPhrase = (key: keyof typeof PHRASES) =>

View file

@ -1,4 +1,4 @@
import { IFile } from '~/redux/types';
import { IFile } from '~/types';
export const EMPTY_FILE: IFile = {
id: undefined,

View file

@ -1,4 +1,4 @@
import { INode } from '~/redux/types';
import { INode } from '~/types';
export const URLS = {
BASE: '/',