@@ -1,14 +1,13 @@ -import { Modal, usePlatesStore } from '#/features/modals/model' +import { Modal, useModal } from '#/features/modals/model' import { useEffect } from 'react' import { jestRender } from './render' const ModalTester = ({ id, onModal }: { id: string; onModal: (modal: Modal) => void }) => { - const { getModal } = usePlatesStore() + const modal = useModal(id) useEffect(() => { - const modal = getModal(id) onModal(modal) - }, [id, onModal]) + }, [id, modal, onModal]) return null } Binary files /dev/null and b/public/subscription/svg-icons/copy.png differ Binary files /dev/null and b/public/subscription/svg-icons/decor.png differ @@ -2,8 +2,6 @@ import React from 'react' import { FormControlLabel, Typography } from '@mui/material' import Switch from '@mui/material/Switch' -import { setParams } from '#/app/store/model-parametres-store' -import { useAppDispatch } from '#/app/store/store' import TooltipModelTypes from '#/widgets/filters-gpt/ui/tooltip-model-types' interface IProps { @@ -1,8 +1,9 @@ import React from 'react' import { Typography } from '@mui/material' import Box from '@mui/material/Box' -import TooltipModelTypes from '#/widgets/filters-gpt/ui/tooltip-model-types' + import { CommonTextArea } from '#/shared/ui/common-textarea' +import TooltipModelTypes from '#/widgets/filters-gpt/ui/tooltip-model-types' interface IProps { title: string @@ -0,0 +1,3 @@ +.selectTransparent { + background-color: transparent; +} @@ -2,11 +2,11 @@ import * as React from 'react' import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown' import { MenuItem, Select, SelectChangeEvent, Stack, Typography } from '@mui/material' -import { setParams } from '#/app/store/model-parametres-store' -import { useAppDispatch, useAppSelector } from '#/app/store/store' import { baseColor } from '#/shared/lib/constants/colors' import TooltipModelTypes from '#/widgets/filters-gpt/ui/tooltip-model-types' +import styles from './select_filter.module.scss' + interface IProps { selects: { availables: string[]; default: any; end: number; start: number; step: number } name: string @@ -45,9 +45,7 @@ export const SelectFilter = ({ selects, filters, item_key, name, description, se sx: { backgroundColor: '#151518', color: '#A6A5A5' }, }, }} - style={{ - backgroundColor: 'transparent', - }} + className={styles.selectTransparent} sx={{ boxShadow: 'none', borderRadius: '13px', @@ -1,7 +1,5 @@ import * as React from 'react' -import { setParams } from '#/app/store/model-parametres-store' -import { useAppDispatch } from '#/app/store/store' import { Slider as Sl } from '#/shared' import TooltipModelTypes from '#/widgets/filters-gpt/ui/tooltip-model-types' @@ -1,8 +1,9 @@ import React, { useRef, useState } from 'react' -import Image from 'next/image' import { Box, Tooltip, Typography } from '@mui/material' +import Image from 'next/image' import { getFileTypeIcon, isImageFile } from '#/shared/lib/helpers' + import styles from './load_image.module.scss' const isVideoFile = (file: File) => { @@ -0,0 +1,3 @@ +.selectTransparent { + background-color: transparent; +} @@ -6,6 +6,8 @@ import { IModelVersions } from '#/shared/api/models/models' import { baseColor } from '#/shared/lib/constants/colors' import TooltipModelTypes from '#/widgets/filters-gpt/ui/tooltip-model-types' +import styles from './chat_select.module.scss' + interface ISelect { value: string setValue: React.Dispatch> @@ -37,9 +39,7 @@ export const ChatSelect: React.FC = ({ value, setValue, list, setDefaul sx: { backgroundColor: '#151518', color: '#A6A5A5' }, }, }} - style={{ - backgroundColor: 'transparent', - }} + className={styles.selectTransparent} sx={{ boxShadow: 'none', borderRadius: '13px', @@ -0,0 +1,3 @@ +.sectionSpacing { + margin-top: 15px; +} @@ -1,21 +1,22 @@ import React from 'react' import { Avatar, Box, Popover, Stack, Typography } from '@mui/material' import Button from '@mui/material/Button' -import axios from 'axios' import Image from 'next/image' import Link from 'next/link' import { useRouter } from 'next/router' import { signOut } from 'next-auth/react' import styles from '#/app/layout/styles/styles.module.css' + +import infoBarStyles from './info-bar.module.scss' import { useAppSelector } from '#/app/store/store' import { TooltipCustom } from '#/shared' -import { useFeatureFlag } from '#/shared/lib/hooks' -import { SvgIcon } from '#/shared/ui/svg' +import { getDaysLeft } from '#/shared/lib/helpers/date-helper' import { declineToken } from '#/shared/lib/helpers/get-token' +import { useFeatureFlag } from '#/shared/lib/hooks' import { IProps } from '#/shared/lib/types/entities' -import { getDaysLeft } from '#/shared/lib/helpers/date-helper' import { SubscriptionDaysBadge } from '#/shared/ui/subscription-days-badge/subscription-days-badge' +import { SvgIcon } from '#/shared/ui/svg' interface InfoBarProps extends IProps {} @@ -190,7 +191,7 @@ const InfoBar: React.FC = ({ device }) => { - + router.push('/account?scope=business')}> {''} @@ -203,7 +204,7 @@ const InfoBar: React.FC = ({ device }) => { {account_type === 'regular' && ( - + router.push('/account?scope=referral')}> {''} @@ -5,11 +5,11 @@ import { paramsStore } from '#/app/store/model-parametres-store' import { balanceSlice } from '#/entities/balance' import { userSlice } from '#/entities/user-account' import { chatsReducer } from '#/features/chats/chats-slice' +import modalsReducer from '#/features/modals/model/modals-slice' import { pendingSlice } from '#/features/pending' import { stepperSlice } from '#/features/register-business' -import { copySlice } from '#/features/use-copy/copy-slice' - import { notificationSlice } from './notification-slice' +import toastReducer from './toast-slice' export const store = configureStore({ reducer: { @@ -17,8 +17,9 @@ export const store = configureStore({ stepper: stepperSlice.reducer, user: userSlice.reducer, notification: notificationSlice.reducer, + toast: toastReducer, + modals: modalsReducer, params: paramsStore.reducer, - copy: copySlice.reducer, loading: pendingSlice.reducer, chats: chatsReducer, }, @@ -0,0 +1,43 @@ +import { createSlice, PayloadAction } from '@reduxjs/toolkit' + +export type ToastVariant = 'error' | 'success' + +export interface ToastState { + message: string + variant: ToastVariant + isOpened: boolean +} + +const initialState: ToastState = { + message: '', + variant: 'error', + isOpened: false, +} + +export const toastSlice = createSlice({ + name: 'toast', + initialState, + reducers: { + show: (state, action: PayloadAction<{ message: string; variant: ToastVariant }>) => { + state.message = action.payload.message + state.variant = action.payload.variant + state.isOpened = true + }, + hide: (state) => { + state.isOpened = false + }, + setOpened: (state, action: PayloadAction) => { + state.isOpened = action.payload + }, + setMessage: (state, action: PayloadAction) => { + state.message = action.payload + }, + setVariant: (state, action: PayloadAction) => { + state.variant = action.payload + }, + }, +}) + +export const { show, hide, setOpened, setMessage, setVariant } = toastSlice.actions + +export default toastSlice.reducer @@ -73,6 +73,14 @@ justify-content: flex-start; height: 100%; + .chartColumn { + display: flex; + justify-content: flex-start; + width: 53%; + height: 100%; + margin-right: 15px; + } + .list { width: 100%; overflow-y: auto; @@ -1,3 +1,9 @@ +/* Yandex Metrika noscript pixel (off-screen) */ +.metrika-pixel-hidden { + position: absolute; + left: -9999px; +} + :root { --air-color: #8280ff; --background-color-main: #303030; @@ -1,14 +0,0 @@ -import { Template } from '#/domains/copywrite/proxy/types/template' - -export const emptyTemplate: Template = { - id: 1000, - title: 'Пустой шаблон', - content: '', - keywords: [], - tov: '', - language: '', - resources_urls: [], - picture: '123', - target_audience: '', - description: '', -} @@ -1,6 +0,0 @@ -import { ContentState, EditorState } from 'draft-js' - -export const toEditorState = (text: string) => { - const newContentState = ContentState.createFromText(text) - return EditorState.createWithContent(newContentState) -} @@ -1,12 +0,0 @@ -export interface Template { - id: number - title: string - description: string - picture: string - content: string - target_audience: string - resources_urls: string[] - keywords: string[] - tov: string - language: string -} @@ -1,34 +0,0 @@ -import axios from 'axios' - -import { Template } from '#/domains/copywrite/proxy/types/template' -import { getApiUrl } from '#/shared/lib/constants' -import { Message } from '#/shared/lib/types/model' - -export class CopywriteProxy { - token?: string - - constructor(token: string | undefined) { - this.token = token - } - - static async getGeneration(token?: string): Promise { - const { data } = await axios.get(getApiUrl() + '/copywrite/', { - headers: { Authorization: `Bearer ${token}` }, - }) - return data - } - - static async getTemplates(token?: string): Promise { - const { data } = await axios.get(getApiUrl() + '/copywrite/templates/', { - headers: { Authorization: `Bearer ${token}` }, - }) - return data - } - - static async createTemplates(token?: string): Promise { - const { data } = await axios.post(getApiUrl() + '/copywrite/templates/', { - headers: { Authorization: `Bearer ${token}` }, - }) - return data - } -} @@ -1,44 +0,0 @@ -import React from 'react' -import { Typography } from '@mui/material' - -import { Input, Slider } from '#/shared' - -import { FiltersProps } from './types' - -export function Filters({ - strength, - setStrength, - upscale, - setUpscale, - negative_prompt, - num_inference_steps, - guidance_scale, - setGuidanceScale, - setNegative_prompt, - setSteps, -}: FiltersProps) { - return ( - <> - - - - - Запрос для исключения из генерации - - - ) -} @@ -1,17 +0,0 @@ -import { ChangeEvent } from 'react' - -export interface Setting { - strength: number - upscale: number - negative_prompt: string - num_inference_steps: number - guidance_scale: number -} - -export interface FiltersProps extends Setting { - setStrength: (e: Event, cur: number | number[]) => void - setUpscale: (e: Event, cur: number | number[]) => void - setGuidanceScale: (e: Event, cur: number | number[]) => void - setNegative_prompt: (e: ChangeEvent) => void - setSteps: (e: Event, cur: number | number[]) => void -} @@ -1,57 +0,0 @@ -import React from 'react' -import { Stack, Typography } from '@mui/material' - -import { Input, Slider } from '#/shared' -import { SelectUI } from '#/shared/ui/select' - -import { Filters } from './types' - -const sizes = [128, 256, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024] - -export function EpicPhotoFilters({ - guidance_scale, - height, - negative_prompt, - num_inference_steps, - num_outputs, - setGuidance_scale, - setHeight, - setNegative_prompt, - setNum_inference_steps, - setNum_outputs, - setWidth, - width, -}: Filters) { - return ( - <> - - - - - - Запрос для исключения из генерации - - - ) -} @@ -1,2 +0,0 @@ -export * from './epic-photo-filters' -export * from './types' @@ -1,20 +0,0 @@ -import { ChangeEvent, ChangeEventHandler } from 'react' -import { SelectChangeEvent } from '@mui/material' - -export interface Setting { - num_outputs: number - negative_prompt: string - width: number - height: number - num_inference_steps: number - guidance_scale: number -} - -export interface Filters extends Setting { - setWidth: (e: SelectChangeEvent) => void - setHeight: (e: SelectChangeEvent) => void - setNum_outputs: (e: Event, cur: number | number[]) => void - setNum_inference_steps: (e: Event, cur: number | number[]) => void - setGuidance_scale: (e: Event, cur: number | number[]) => void - setNegative_prompt: (e: ChangeEvent) => void -} @@ -1,2 +0,0 @@ -export * from './kandinsky-filters' -export * from './types' @@ -1,83 +0,0 @@ -import React from 'react' -import { Box, Typography } from '@mui/material' - -import { Input, Slider, SwitchCustom } from '#/shared' -import { SelectUI } from '#/shared/ui/select' - -import { Filters } from './types' - -export function KandinskyFilters({ - height, - isTranslate, - negativePrompt, - num_outputs, - setHeight, - setNegative_prompt, - setNumber, - setSteps, - setWidth, - steps, - width, - setIsTranslate, -}: Filters) { - return ( - <> - Настройки - - - - - - - - - - - - - - - - Переводить запрос - - - - - - - Запрос для исключения из генерации - - - - - ) -} @@ -1,20 +0,0 @@ -import { ChangeEvent } from 'react' -import { SelectChangeEvent } from '@mui/material' - -export interface Setting { - steps: number - num_outputs: number - width: number - height: number - isTranslate: boolean - negativePrompt: string -} - -export interface Filters extends Setting { - setWidth: (e: SelectChangeEvent) => void - setHeight: (e: SelectChangeEvent) => void - setSteps: (e: Event, cur: number | number[]) => void - setNumber: (e: Event, cur: number | number[]) => void - setNegative_prompt: (e: ChangeEvent) => void - setIsTranslate: () => void -} @@ -1,47 +0,0 @@ -import React from 'react' -import { Typography } from '@mui/material' - -import { Input, Slider } from '#/shared' -import { SelectUI } from '#/shared/ui/select' - -import { FiltersProps } from './types' - -const sizes = [384, 512, 576, 640, 704, 768] - -export function Filters({ - height, - negative_prompt, - num_inference_steps, - num_outputs, - setHeight, - setNegative_prompt, - setNumOutputs, - setSteps, - setWidth, - width, -}: FiltersProps) { - return ( - <> - - - - - Запрос для исключения из генерации - - - ) -} @@ -1,2 +0,0 @@ -export * from './filters' -export * from './types' @@ -1,18 +0,0 @@ -import { ChangeEvent } from 'react' -import { SelectChangeEvent } from '@mui/material' - -export interface Setting { - width: number - height: number - num_outputs: number - negative_prompt: string - num_inference_steps: number -} - -export interface FiltersProps extends Setting { - setWidth: (e: SelectChangeEvent) => void - setHeight: (e: SelectChangeEvent) => void - setNumOutputs: (e: Event, cur: number | number[]) => void - setSteps: (e: Event, cur: number | number[]) => void - setNegative_prompt: (e: ChangeEvent) => void -} @@ -34,7 +34,7 @@ export function AudioModelCard({ return ( -
+
{title}
@@ -181,3 +181,11 @@ letter-spacing: -1%; } } + +.card_blocked { + user-select: none; +} + +.card_selectable { + user-select: auto !important; +} @@ -179,3 +179,11 @@ letter-spacing: -1%; } } + +.card_blocked { + user-select: none; +} + +.card_selectable { + user-select: auto !important; +} @@ -25,8 +25,7 @@ export function ChatModelCard({ description, image, title, slug, accessed_models
{title} @@ -25,8 +25,7 @@ export function ImageModelCard({ description, image, title, slug, accessed_model
{title} @@ -23,7 +23,7 @@ export function VideoModelCard({ description, image, title, slug, accessed_model return ( -
+
{title}
@@ -1,8 +1,6 @@ import React, { useState } from 'react' import { Box, TextField, Typography } from '@mui/material' -import axios from 'axios' import dayjs, { Dayjs } from 'dayjs' -import { useRouter } from 'next/navigation' import { useSession } from 'next-auth/react' import { ButtonGray, ButtonUI, Error, InputStyleDark, Loader, Modal } from '#/shared' @@ -1,17 +0,0 @@ -import { accountApi } from '#/shared/api/account-endpoints' - -export const authTelegram = async (email: any, password: any) => { - const user = await accountApi.loginByEmail(email, password) - - if (user !== null) { - ;(window as any).Telegram.WebApp.sendData(user.token.access) - } -} - -export const authTelegramYandex = async (email: any, password: any) => { - const user = await accountApi.loginByEmail(email, password) - - if (user !== null) { - ;(window as any).Telegram.WebApp.sendData(user.token.access) - } -} @@ -1 +0,0 @@ -export { authTelegram } from './model/auth' @@ -1,4 +1,4 @@ -import axios, { AxiosResponse } from 'axios' +import axios from 'axios' import { getApiUrl } from '#/shared/lib/constants' @@ -1,4 +1,4 @@ -import axios, { AxiosResponse } from 'axios' +import axios from 'axios' import { getApiUrl } from '#/shared/lib/constants' @@ -1,4 +1,4 @@ -import axios, { AxiosResponse } from 'axios' +import axios from 'axios' import { getApiUrl } from '#/shared/lib/constants' @@ -1,4 +1,4 @@ -import axios, { AxiosResponse } from 'axios' +import axios from 'axios' import { getApiUrl } from '#/shared/lib/constants' @@ -1,6 +1,6 @@ import React, { FC, useState } from 'react' import { useForm } from 'react-hook-form' -import { SubmitErrorHandler } from 'react-hook-form/dist/types/form' +import { SubmitErrorHandler } from 'react-hook-form' import { Box, TextField, Typography } from '@mui/material' import { useSession } from 'next-auth/react' @@ -1,6 +1,6 @@ import React, { FC, useEffect, useState } from 'react' import { useForm } from 'react-hook-form' -import { SubmitErrorHandler } from 'react-hook-form/dist/types/form' +import { SubmitErrorHandler } from 'react-hook-form' import { Box, TextField, Typography } from '@mui/material' import axios from 'axios' import { useSession } from 'next-auth/react' @@ -2,7 +2,6 @@ import React, { useState } from 'react' import { Box, Typography } from '@mui/material' import axios from 'axios' import { Dayjs } from 'dayjs' -import { useRouter } from 'next/navigation' import { useSession } from 'next-auth/react' import { ButtonGray, ButtonUI, Error, Loader, Modal } from '#/shared' @@ -77,7 +77,7 @@ export const LimitModal: React.FC = ({ }} > - Сотрудник {person?.email} + Сотрудник {person?.email} @@ -1,4 +1,3 @@ -import { useSession } from 'next-auth/react' import { changePassword } from '../api/change-password' import { useState } from 'react' import { getModalById, PLATE_CHANGE_PASSWORD } from '#/features/modals' @@ -1,32 +0,0 @@ -import React, { ReactNode } from 'react' -import { Menu, MenuItem } from '@mui/material' - -interface IProps { - children: ReactNode - clicked: boolean - handleClose: () => void - pointY: number - pointX: number -} - -export const ContextMenu = ({ children, pointX, pointY, clicked, handleClose }: IProps) => { - return ( - - {children} - - ) -} @@ -13,7 +13,7 @@ export function useCreateMediaMessage( modelType: 'video' | 'image' | 'audio' | 'voice', device: Device, setMessages: Dispatch>, - mobileScrollContainer: RefObject + mobileScrollContainer: RefObject ) { const [isComplete, setIsComplete] = useState(false) const [createLoading, setCreateLoading] = useState(false) @@ -120,6 +120,14 @@ } } +.fileInputHidden { + display: none; +} + +.fileInputLabel { + cursor: pointer; +} + .textarea { &__file { background: rgba(255, 255, 255, 0.06); @@ -40,10 +40,10 @@ export const ErrorReportPlate = () => { onChange={handleFileChange} type='file' accept='.jpg,.jpeg,.png' - style={{ display: 'none' }} + className={styles.fileInputHidden} id='file-input' /> -