@@ -18,7 +18,6 @@ interface IProps { export const SelectFilter = ({ selects, filters, item_key, name, description, setNewParam }: IProps) => { const [value, setValue] = React.useState(selects.default) - const theme = useAppSelector((state) => state.theme.theme) React.useEffect(() => { if (filters[item_key] !== undefined && filters[item_key] !== value) { @@ -43,29 +42,29 @@ export const SelectFilter = ({ selects, filters, item_key, name, description, se MenuProps: { MenuListProps: { sx: { - color: theme === 'light' ? '#373737' : '#A6A5A5', - backgroundColor: theme === 'light' ? 'transparent' : '#151518', + color: '#A6A5A5', + backgroundColor: '#151518', }, }, }, }} style={{ - backgroundColor: theme === 'light' ? 'transparent' : 'transparent', + backgroundColor: 'transparent', }} sx={{ boxShadow: 'none', borderRadius: '13px', - backgroundColor: theme === 'light' ? 'transparent' : '#4B4B4B', - border: theme === 'light' ? '1px solid transparent' : '2px solid #40404E;', - color: theme === 'light' ? '#373737' : '#A6A5A5', + backgroundColor: '#4B4B4B', + border: '2px solid #40404E;', + color: '#A6A5A5', '.MuiSelect-icon': { color: '#A6A5A5', }, '&& fieldset': { - border: theme === 'light' ? '1px solid #E9E9E9' : '0px solid transparent', + border: '0px solid transparent', }, '&.Mui-focused': { - border: theme === 'light' ? `1px solid ${baseColor}` : '2px solid #40404E;', + border: '2px solid #40404E;', borderColor: baseColor, '& .MuiOutlinedInput-notchedOutline': { border: 'none', @@ -73,7 +72,7 @@ export const SelectFilter = ({ selects, filters, item_key, name, description, se }, '&:hover': { '&& fieldset': { - border: theme === 'light' ? '1px solid #E9E9E9' : '0px solid transparent', + border: '0px solid transparent', }, }, }} @@ -2,7 +2,6 @@ import React, { useRef, useState } from 'react' import { Box, Typography } from '@mui/material' import Image from 'next/image' -import { useAppSelector } from '#/app/store/store' import { TooltipCustom } from '#/shared' interface IProps { @@ -27,7 +26,6 @@ const acceptTypes: any = { export const LoadImage = ({ loading, unpinImage, image, imageLoad, types }: IProps) => { const ref = useRef(null) const [inputTypes, setInputTypes] = useState('') - const theme = useAppSelector((state) => state.theme.theme) React.useEffect(() => { setInputTypes(types.map((el) => acceptTypes[el]).toString()) @@ -73,7 +71,7 @@ export const LoadImage = ({ loading, unpinImage, image, imageLoad, types }: IPro > @@ -2,7 +2,6 @@ import React from 'react' import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown' import { MenuItem, Select, SelectChangeEvent, Stack, Typography } from '@mui/material' -import { useAppSelector } from '#/app/store/store' import { IModelVersions } from '#/shared/api/models/models' import { baseColor } from '#/shared/lib/constants/colors' import TooltipModelTypes from '#/widgets/filters-gpt/ui/tooltip-model-types' @@ -16,7 +15,6 @@ interface ISelect { } export const ChatSelect: React.FC = ({ value, setValue, list, setDefaultParams, ...args }) => { - const theme = useAppSelector((state) => state.theme.theme) const onChange = (event: SelectChangeEvent) => { setValue(event.target.value as string) @@ -33,29 +31,29 @@ export const ChatSelect: React.FC = ({ value, setValue, list, setDefaul MenuProps: { MenuListProps: { sx: { - color: theme === 'light' ? '#373737' : '#A6A5A5', - backgroundColor: theme === 'light' ? 'transparent' : '#151518', + color: '#A6A5A5', + backgroundColor: '#151518', }, }, }, }} style={{ - backgroundColor: theme === 'light' ? 'transparent' : 'transparent', + backgroundColor: 'transparent', }} sx={{ boxShadow: 'none', borderRadius: '13px', - backgroundColor: theme === 'light' ? 'transparent' : '#4B4B4B', - border: theme === 'light' ? '1px solid transparent' : '2px solid #40404E;', - color: theme === 'light' ? '#373737' : '#A6A5A5', + backgroundColor: '#4B4B4B', + border: '2px solid #40404E;', + color: '#A6A5A5', '.MuiSelect-icon': { color: '#A6A5A5', }, '&& fieldset': { - border: theme === 'light' ? '1px solid #E9E9E9' : '0px solid transparent', + border: '0px solid transparent', }, '&.Mui-focused': { - border: theme === 'light' ? `1px solid ${baseColor}` : '2px solid #40404E;', + border: '2px solid #40404E;', borderColor: baseColor, '& .MuiOutlinedInput-notchedOutline': { border: 'none', @@ -63,7 +61,7 @@ export const ChatSelect: React.FC = ({ value, setValue, list, setDefaul }, '&:hover': { '&& fieldset': { - border: theme === 'light' ? '1px solid #E9E9E9' : '0px solid transparent', + border: '0px solid transparent', }, }, }} @@ -8,8 +8,7 @@ import { useRouter } from 'next/router' import { signOut } from 'next-auth/react' import styles from '#/app/layout/styles/styles.module.css' -import { useAppDispatch, useAppSelector } from '#/app/store/store' -import { change } from '#/entities/theme' +import { useAppSelector } from '#/app/store/store' import { TooltipCustom } from '#/shared' import { declineToken } from '#/shared/lib/helpers/get-token' import { IProps } from '#/shared/lib/types/entities' @@ -39,12 +38,9 @@ const convertLang = (toShort: T, lang: LangParam): LangRet } const InfoBar: React.FC = ({ device }) => { - const theme = useAppSelector((state) => state.theme.theme) const balance = useAppSelector((state) => state.balance.balance) const { email, first_name, last_name, profile_picture_link, account_type, show_balance } = useAppSelector((state) => state.user) - const dispatch = useAppDispatch() - const [anchorEl, setAnchorEl] = React.useState(null) const [anchorEl2, setAnchorEl2] = React.useState(null) @@ -87,7 +83,7 @@ const InfoBar: React.FC = ({ device }) => { sx={{ marginTop: '6px' }} PaperProps={{ style: { - backgroundColor: theme === 'dark' ? '#151518' : 'white', + backgroundColor: '#151518', borderRadius: '13px', boxShadow: 'none', }, @@ -115,17 +111,6 @@ const InfoBar: React.FC = ({ device }) => { - - {dispatch(change(null))}} - style={{ cursor: 'pointer', marginLeft: '30px' }} - src={'/sleep.svg'} - width={20} - height={20} - alt={''} - /> - - @@ -163,7 +148,7 @@ const InfoBar: React.FC = ({ device }) => { sx={{ marginTop: '6px' }} PaperProps={{ style: { - backgroundColor: theme === 'dark' ? '#151518' : 'white', + backgroundColor: '#151518', borderRadius: '13px', boxShadow: 'none', }, @@ -1,32 +1,4 @@ -:root[data-theme='light'] { - --air-color: #8280ff; - --background-color-main: #ffffff; - --background-color-additional: #ffffff; - --background-color-page: #fbfbfb; - --background-color-table: white; - --bg-color-button-gray: #e8e8e8; - --color-btn-gray: #5a5a5a; - --search-bg: white; - --text-color-purple: #7f7df3; - --text-color-main: #373737; - --text-color-additional-one: #868686; - --text-color-additional-two: #5e5e5e; - --border-color: #f5f5f5; - --border-color2: #e7e7e7; - --bg-audio: #f2f2fe; - - --new-ui-bg-app-color: #eff0f2; - --new-ui-main-color: white; - --new-ui-gray-color: #a4aab5; - --new-ui-text-color: #2b2b42; - --new-ui-border: 2px solid #eff0f2; - --new-ui-btn-danger-bg: #ff23721a; - --new-ui-ctrl-f-button-bg: #f9f9fc; - --new-ui-ctrl-f-button-border: 1px solid #c4cbd8; - --new-ui-table-cell-text: #97989f; -} - -:root[data-theme='dark'] { +:root { --air-color: #8280ff; --background-color-main: #303030; --background-color-page: #303030; @@ -1,7 +1,7 @@ import { createSlice } from '@reduxjs/toolkit' export interface Theme { - theme: 'light' | 'dark' + theme: 'dark' } const initialState: Theme = { @@ -13,13 +13,7 @@ export const themeSlice = createSlice({ initialState, reducers: { change: (state, action) => { - if (action.payload) { - state.theme = action.payload - localStorage.setItem('theme', state.theme) - return - } - state.theme = state.theme === 'dark' ? 'light' : 'dark' - localStorage.setItem('theme', state.theme) + state.theme = 'dark' }, }, }) @@ -4,12 +4,10 @@ import { change } from '#/entities/theme' import { useAppDispatch, useAppSelector } from '#/app/store/store' export const useTheme = () => { - const theme = useAppSelector((state) => state.theme.theme) - const dispatch = useAppDispatch() React.useEffect(() => { - dispatch(change(localStorage.getItem('theme') || 'light')) - document.documentElement.dataset.theme = theme - }, [theme]) + dispatch(change('dark')) + document.documentElement.dataset.theme = 'dark' + }, [dispatch]) } @@ -5,8 +5,7 @@ import { Dayjs } from 'dayjs' import { useRouter } from 'next/navigation' import { useSession } from 'next-auth/react' -import { useAppSelector } from '#/app/store/store' -import { ButtonGray, ButtonUI, Error, InputStyleDark, InputStyleLight, Loader, Modal } from '#/shared' +import { ButtonGray, ButtonUI, Error, InputStyleDark, Loader, Modal } from '#/shared' import { accountApi } from '#/shared/api/account-endpoints' import { API_URL } from '#/shared/lib/constants' import { DateInput } from '#/shared/ui/date-input/date-input' @@ -26,7 +25,6 @@ export const ApiKeyModal = ({ }) => { const [endDate, setEndDate] = useState() const [title, setTitle] = useState('') - const theme = useAppSelector((state) => state.theme.theme) const [isLoading, setIsLoading] = useState(false) @@ -75,7 +73,7 @@ export const ApiKeyModal = ({ placeholder={'Введите название ключа'} onChange={(e) => setTitle(e.target.value)} fullWidth - sx={theme === 'light' ? { ...InputStyleLight } : { ...InputStyleDark }} + sx={{ ...InputStyleDark }} /> @@ -8,8 +8,7 @@ import { addBusinessGroup } from '#/features/business-group/api/add-business-gro import { ResponseGetBusinessGroups } from '#/features/business-group/model/types' import { invitePerson } from '#/features/invite-person-in-business/api/invite-person' import { IEmailForms } from '#/features/register-by-email/model/types' -import { useAppSelector } from '#/app/store/store' -import { ButtonGray, ButtonUI, InputStyleDark, InputStyleLight, Loader, Modal, ModalProps } from '#/shared' +import { ButtonGray, ButtonUI, InputStyleDark, Loader, Modal, ModalProps } from '#/shared' import styles from './add-business-group.module.scss' import { useShowDataStore } from '#/shared/lib/hooks/use-show-data' @@ -28,7 +27,6 @@ export const AddBusinessGroup: FC = ({ open, onClose, company_ const [isLoading, setIsLoading] = useState(false) const [limit, setLimit] = useState('0') const [title, setTitle] = useState('') - const theme = useAppSelector((state) => state.theme.theme) const { showMessage } = useShowDataStore() const { data: session } = useSession() @@ -78,7 +76,7 @@ export const AddBusinessGroup: FC = ({ open, onClose, company_ placeholder={'Введите название бизнес-группы'} onChange={(e) => setTitle(e.target.value)} fullWidth - sx={theme === 'light' ? { ...InputStyleLight } : { ...InputStyleDark }} + sx={{ ...InputStyleDark }} /> @@ -91,7 +89,7 @@ export const AddBusinessGroup: FC = ({ open, onClose, company_ type='text' onChange={(e) => setLimit(e.target.value)} fullWidth - sx={theme === 'light' ? { ...InputStyleLight } : { ...InputStyleDark }} + sx={{ ...InputStyleDark }} /> @@ -13,8 +13,7 @@ import { InviteRoles, inviteRoles, InviteRolesEn, RoleSelect } from '#/features/ import { ResponseGetBusinessGroups } from '#/features/business-group/model/types' import { ResponseGetPersons } from '#/features/invite-person-in-business' import { IEmailForms } from '#/features/register-by-email/model/types' -import { useAppSelector } from '#/app/store/store' -import { ButtonGray, ButtonUI, Error, InputStyleDark, InputStyleLight, Loader, Modal, ModalProps } from '#/shared' +import { ButtonGray, ButtonUI, Error, InputStyleDark, Loader, Modal, ModalProps } from '#/shared' import { API_URL } from '#/shared/lib/constants' import styles from './add-business-group.module.scss' @@ -37,7 +36,6 @@ export const ChangeBusinessGroup: FC = ({ open, onClose, compa const [title, setTitle] = useState('0') const [accounts, setAccounts] = useState() const [addUsers, setAddUsers] = useState() - const theme = useAppSelector((state) => state.theme.theme) const { showMessage } = useShowDataStore() const { data: session } = useSession() @@ -126,7 +124,7 @@ export const ChangeBusinessGroup: FC = ({ open, onClose, compa placeholder={'Введите название бизнес-группы'} onChange={(e) => setTitle(e.target.value)} fullWidth - sx={theme === 'light' ? { ...InputStyleLight } : { ...InputStyleDark }} + sx={{ ...InputStyleDark }} /> @@ -139,7 +137,7 @@ export const ChangeBusinessGroup: FC = ({ open, onClose, compa type='text' onChange={(e) => setLimit(e.target.value)} fullWidth - sx={theme === 'light' ? { ...InputStyleLight } : { ...InputStyleDark }} + sx={{ ...InputStyleDark }} /> @@ -5,7 +5,6 @@ import Image from 'next/image' import { useCalculating } from '#/features/calculation-tokens-gpt/model/use-calculating' import TooltipCalculating from '#/features/calculation-tokens-gpt/ui/tooltip-calculating' -import { useAppSelector } from '#/app/store/store' import { baseColor } from '#/shared/lib/constants/colors' import { ImessageContext } from '#/shared/lib/types/types-gpt' import { TypeModelGPT } from '#/widgets/filters-gpt/lib/constants' @@ -24,8 +23,6 @@ export const Calculation: React.FC = memo( ({ prompt, gptType, context, isAdditional, count, quality, model }) => { const price = useCalculating(model, count, quality, prompt, gptType, isAdditional, context) - const theme = useAppSelector((state) => state.theme.theme) - return ( = memo( marginRight: '24px', }, }, - bgcolor: theme === 'light' ? 'white' : '#4B4B4B', + bgcolor: '#4B4B4B', borderRadius: '10px', '& .MuiTooltip-arrow': { - color: theme === 'light' ? 'white' : '#4B4B4B', + color: '#4B4B4B', }, boxShadow: '0px 0px 4px rgba(0, 0, 0, 0.04), 0px 4px 32px rgba(0, 0, 0, 0.16)', }, @@ -3,17 +3,14 @@ import { Box } from '@mui/material' import Typography from '@mui/material/Typography' import { textTooltipCalculating } from '#/features/calculation-tokens-gpt/lib/constants' -import { useAppSelector } from '#/app/store/store' const TooltipCalculating = ({ model = 'dalle' }: { model?: 'gpt' | 'dalle' | 'sd' }) => { - const theme = useAppSelector((state) => state.theme.theme) - return ( {textTooltipCalculating} @@ -3,8 +3,7 @@ import { Box, TextField, Typography } from '@mui/material' import { useSession } from 'next-auth/react' import { ResponseGetPersons } from '#/features/invite-person-in-business' -import { useAppSelector } from '#/app/store/store' -import { ButtonUI, InputStyleDark, InputStyleLight, Modal, Select } from '#/shared' +import { ButtonUI, InputStyleDark, Modal, Select } from '#/shared' import styles from '#/widgets/business-models/ui/models-list/models-list.module.scss' import styles2 from '#/widgets/business-persons/ui/persons-list/persons-list.module.scss' @@ -30,7 +29,6 @@ export const LimitModal: React.FC = ({ addList, listType, }) => { - const theme = useAppSelector((state) => state.theme.theme) const [limit, setLimit] = useState(person?.token_limit ? Math.floor(+person.token_limit).toString() : '0') const [role, setRole] = useState('Сотрудник') const { data } = useSession() @@ -91,7 +89,7 @@ export const LimitModal: React.FC = ({ type='text' onChange={(e) => setLimit(e.target.value)} fullWidth - sx={theme === 'light' ? { ...InputStyleLight } : { ...InputStyleDark }} + sx={{ ...InputStyleDark }} /> @@ -1,8 +1,6 @@ import React, { ReactNode } from 'react' import { Menu, MenuItem } from '@mui/material' -import { useAppSelector } from '#/app/store/store' - interface IProps { children: ReactNode clicked: boolean @@ -12,8 +10,6 @@ interface IProps { } export const ContextMenu = ({ children, pointX, pointY, clicked, handleClose }: IProps) => { - const theme = useAppSelector((state) => state.theme.theme) - return ( = ({ token, device, product, group_by, start_date, end_date, theme }) => { +export const Stats: React.FC = ({ token, device, product, group_by, start_date, end_date }) => { const [stats, loading] = useGetStats(token, start_date, end_date, group_by, product) const [activeStep, setActiveStep] = React.useState(0) - - const light = theme === 'light' - - const dispatch = useAppDispatch() - - useEffect(() => { - dispatch(change('light')) - }, []) + const light = false return ( @@ -69,7 +60,7 @@ export const Stats: React.FC = ({ token, device, product, group_by, ) : ( <> {stats !== undefined && Object.keys(stats).length === 0 ? ( - + Данные отсутствуют ) : ( @@ -4,7 +4,6 @@ import { SubmitErrorHandler } from 'react-hook-form/dist/types/form' import { Box, TextField, Typography } from '@mui/material' import { useSession } from 'next-auth/react' -import { useAppSelector } from '#/app/store/store' import { invitePerson } from '#/features/invite-person-in-business/api/invite-person' import { IEmailForms } from '#/features/register-by-email/model/types' import { @@ -12,7 +11,6 @@ import { ButtonUI, emailOptions, InputStyleDark, - InputStyleLight, Loader, Modal, ModalProps, @@ -71,8 +69,6 @@ export const InviteModal: FC = ({ open, onClose, showNewPerson setValue('email', emailWithoutSpaces) } - const theme = useAppSelector((state) => state.theme.theme) - useEffect(() => { if (open) { getBusinessGroups(session?.access).then((res) => setBusinessGroups(res ? res : null)) @@ -105,7 +101,7 @@ export const InviteModal: FC = ({ open, onClose, showNewPerson Укажите адрес электронной почты { handleEmailChange(e) @@ -110,17 +110,3 @@ } } -html[data-theme='light'] { - .template__content { - background-color: var(--new-ui-main-color); - border-radius: 20px; - position: relative; - overflow: hidden; - height: fit-content; - transition: all 0.5s ease-in-out; - - &_secondary { - background-color: white; - } - } -} @@ -5,24 +5,7 @@ width: 100%; border-radius: 15px; gap: 10px; -} - -:root[data-theme='light'] { - .wrapper { - border: 2px solid #e1e1e1; - } - .divider { - background-color: #ebeff5; - } -} - -:root[data-theme='dark'] { - .wrapper { - border: 2px solid rgb(66, 66, 72) !important; - } - .divider { - background-color: #40404e; - } + border: 2px solid rgb(66, 66, 72) !important; } .area { @@ -60,4 +43,5 @@ height: 20px; width: 1px; margin: 0px 8px; + background-color: #40404e; } @@ -8,7 +8,6 @@ import classes from './model-input.module.scss' import { LoadImage } from '#/app/components/input_components/load_image' import { SendBtn } from '#/app/components/input_components/send_button' -import { useAppSelector } from '#/app/store/store' import { IModelInputs } from '#/shared/api/models/models' import { useThemeAndDevice } from '#/shared/lib/hooks' import { styleInputWithoutBorderFocus } from '#/shared/ui/input' @@ -55,7 +54,6 @@ export const ModelInput: FC = ({ value: externalValue, onValueChange: externalOnChange, }: Input) => { - const theme = useAppSelector((state) => state.theme.theme) const [disabled, setDisabled] = React.useState(true) const [required, setRequired] = React.useState<(string | null)[]>([]) const [types, setTypes] = React.useState([]) @@ -96,12 +94,7 @@ export const ModelInput: FC = ({
{!desktop && ( @@ -43,7 +43,6 @@ export const CompanyAutocomplete: React.FC = ({ onOpen, onClose, }) => { - const theme = useAppSelector((state) => state.theme.theme) const suggestedCompany = useAppSelector((state) => state.stepper.company) const dispatch = useAppDispatch() @@ -104,7 +103,7 @@ export const CompanyAutocomplete: React.FC = ({ className={className} sx={{ '& .MuiAutocomplete-clearIndicator': { - color: theme === 'light' ? 'black' : 'white', + color: 'white', }, ...sx, // Кастомные стили переопределяют дефолтные }} @@ -116,17 +115,13 @@ export const CompanyAutocomplete: React.FC = ({ helperText={error?.message} fullWidth sx={{ - ...(theme === 'light' - ? { ...InputStyleLight } - : { - ...InputStyleDark, - '& .MuiInputBase-input': { - color: 'white', - }, - '& .MuiInputLabel-root': { - color: 'rgba(255,255,255,0.7)', - }, - }), + ...InputStyleDark, + '& .MuiInputBase-input': { + color: 'white', + }, + '& .MuiInputLabel-root': { + color: 'rgba(255,255,255,0.7)', + }, ...textFieldSx, // Кастомные стили для TextField }} {...methods.register(fieldName, validationRules)} @@ -165,22 +160,22 @@ export const CompanyAutocomplete: React.FC = ({ componentsProps={{ paper: { sx: { - backgroundColor: theme === 'light' ? '#ffffff' : '#333', - color: theme === 'light' ? '#000000' : 'white', + backgroundColor: '#333', + color: 'white', '& .MuiAutocomplete-listbox': { maxHeight: '300px', overflow: 'auto', }, '& .MuiAutocomplete-option': { - whiteSpace: 'normal', - wordBreak: 'break-word', + whiteSpace: 'normal', + wordBreak: 'break-word', overflowWrap: 'anywhere', hyphens: 'auto', '&:hover': { - backgroundColor: theme === 'light' ? '#f5f5f5' : '#444', + backgroundColor: '#444', }, '&[aria-selected="true"]': { - backgroundColor: theme === 'light' ? '#e0e0e0' : '#555', + backgroundColor: '#555', }, }, ...paperSx, // Кастомные стили для Paper @@ -1,9 +1,7 @@ -import { InputStyleDark, InputStyleLight } from '#/shared' +import { InputStyleDark } from '#/shared' -type StepperTheme = 'light' | 'dark' - -export const getStepperInputStyles = (theme: StepperTheme, hasError: boolean) => { - const palette = theme === 'light' ? InputStyleLight : InputStyleDark +export const getStepperInputStyles = (hasError: boolean) => { + const palette = InputStyleDark const inputBg = palette.backgroundColor ?? 'transparent' return { @@ -17,11 +15,7 @@ export const getStepperInputStyles = (theme: StepperTheme, hasError: boolean) => }, '& .MuiOutlinedInput-notchedOutline': { borderWidth: 2 }, '&.Mui-error .MuiOutlinedInput-notchedOutline': { - borderColor: hasError - ? theme === 'light' - ? '#ff76a7' - : '#ff2372' - : 'inherit', + borderColor: hasError ? '#ff2372' : 'inherit', }, } } @@ -21,7 +21,6 @@ type ContactFormValues = { export const StepContact: React.FC = () => { const dispatch = useAppDispatch() - const theme = useAppSelector((state) => state.theme.theme) const { showMessage } = useShowDataStore() const { phone, email, name, job_title } = useAppSelector((state) => state.stepper.dataForCreate) const { data: session } = useSession() @@ -68,7 +67,7 @@ export const StepContact: React.FC = () => { Как вам обращаться? { Ваша должность { Ваш email { Ваш телефон ({ +const getSelectStyles = (hasError: boolean) => ({ boxShadow: 'none', borderRadius: '13px', - backgroundColor: theme === 'light' ? 'transparent' : '#4B4B4B', - border: hasError ? `2px solid ${theme === 'light' ? '#ff76a7' : '#ff2372'}` : theme === 'light' ? '1px solid transparent' : '2px solid #40404E', - color: theme === 'light' ? '#373737' : '#A6A5A5', + backgroundColor: '#4B4B4B', + border: hasError ? `2px solid #ff2372` : '2px solid #40404E', + color: '#A6A5A5', '.MuiSelect-icon': { color: '#A6A5A5', }, @@ -29,14 +29,13 @@ const getSelectStyles = (theme: 'light' | 'dark', hasError: boolean) => ({ border: 0, }, '&.Mui-focused': { - borderColor: theme === 'light' ? '#7F7DF3' : '#4B4BFF', + borderColor: '#4B4BFF', }, }) export const StepInformation = () => { const dispatch = useAppDispatch() const { frequency, fieldActivity, numberStuff } = useAppSelector((state) => state.stepper.dataForCreate) - const theme = useAppSelector((state) => state.theme.theme) const { showMessage } = useShowDataStore() const router = useRouter() @@ -96,7 +95,7 @@ export const StepInformation = () => { dispatch(setFieldActivity(event.target.value as FieldActivity)) }} list={selectOptions.fieldActivity} - sx={getSelectStyles(theme, !!errors.fieldActivity)} + sx={getSelectStyles(!!errors.fieldActivity)} /> )} /> @@ -118,7 +117,7 @@ export const StepInformation = () => { dispatch(setFrequency(event.target.value as Frequency)) }} list={selectOptions.frequency} - sx={getSelectStyles(theme, !!errors.frequency)} + sx={getSelectStyles(!!errors.frequency)} /> )} /> @@ -129,7 +128,7 @@ export const StepInformation = () => { Сколько вы планируете подключить сотрудников? { const dispatch = useAppDispatch() - const theme = useAppSelector((state) => state.theme.theme) const { companyName, ogrn, inn } = useAppSelector((state) => state.stepper.dataForCreate) const { showMessage } = useShowDataStore() @@ -59,7 +58,7 @@ export const StepLegalInformative = () => { const ogrnRules = useMemo(() => rulesData.ogrn, [rulesData]) const autoCompleteSx = { - ...getStepperInputStyles(theme, !!errors.companyName), + ...getStepperInputStyles(!!errors.companyName), '.MuiAutocomplete-inputRoot': { padding: '0 !important', }, @@ -101,7 +100,7 @@ export const StepLegalInformative = () => { ИНН { {isIP ? 'ОГРНИП' : 'ОГРН'} = ({ successLogin }) => { const { register, handleSubmit, reset, watch } = useForm() - const { theme, desktop } = useThemeAndDevice() + const { desktop } = useThemeAndDevice() const { showMessage } = useShowDataStore() @@ -98,7 +97,7 @@ export const RegisterEmailForm: React.FC = ({ successLo = ({ successLo @@ -119,7 +118,7 @@ export const RegisterEmailForm: React.FC = ({ successLo = ({ successLo ), }} - sx={theme === 'light' ? { ...InputStyleLight } : { ...InputStyleDark }} + sx={{ ...InputStyleDark }} {...register('password1', { ...PasswordOptions, })} @@ -163,7 +162,7 @@ export const RegisterEmailForm: React.FC = ({ successLo = ({ successLo { @@ -1,7 +1,6 @@ import React from 'react' import { Box, Typography } from '@mui/material' -import { useThemeAndDevice } from '#/shared/lib/hooks' interface ISuggestedMessage { title: string @@ -9,15 +8,13 @@ interface ISuggestedMessage { } const SuggestedMessage: React.FC = ({ title, sendMessage }) => { - const { theme } = useThemeAndDevice() - return ( sendMessage!(title)} sx={{ boxShadow: '0px 0px 20px rgba(0, 0, 0, 0.05)', padding: '10px 14px', - backgroundColor: theme === 'light' ? 'white' : '#3D3D3D', + backgroundColor: '#3D3D3D', borderRadius: '8px', color: '#7F7DF3', marginTop: 1.5, @@ -3,7 +3,6 @@ import { Box, Stack, Typography } from '@mui/material' import { suggestedMessagesList } from '#/features/send-suggested-message/lib/constants' import SuggestedMessage from '#/features/send-suggested-message/ui/suggested-message' -import { useThemeAndDevice } from '#/shared/lib/hooks' interface IProps { device: 'mobile' | 'desktop' @@ -11,7 +10,7 @@ interface IProps { } export const SuggestedMessages: React.FC = ({ device, sendMessage }) => { - const { theme, desktop } = useThemeAndDevice(device) + const desktop = device === 'desktop' return ( = ({ device, sendMessage }) => margin: '50px auto', width: desktop ? '30%' : '90%', textAlign: 'center', - color: theme === 'light' ? '#5E5E5E' : '#A6A5A5', + color: '#A6A5A5', }} > Не знаете с чего начать? @@ -1,7 +1,6 @@ import React from 'react' import { Box, Tooltip, Typography } from '@mui/material' -import { useAppSelector } from '#/app/store/store' import { baseColor } from '#/shared/lib/constants/colors' interface ITooltipMy { @@ -13,13 +12,11 @@ interface ITooltiptext { begin: () => void } const TooltipText: React.FC = ({ begin }) => { - const theme = useAppSelector((state) => state.theme.theme) - return ( @@ -27,7 +24,7 @@ const TooltipText: React.FC = ({ begin }) => { = ({ begin }) => { ) } const TooltipMy: React.FC = ({ children, begin }) => { - const theme = useAppSelector((state) => state.theme.theme) - return ( = ({ children, begin }) => { marginRight: '24px', }, }, - bgcolor: theme === 'light' ? 'white' : '#2B2828', + bgcolor: '#2B2828', borderRadius: '10px', '& .MuiTooltip-arrow': { - color: theme === 'light' ? 'white' : '#2B2828', + color: '#2B2828', }, padding: '15px 20px', boxShadow: '0px 0px 4px rgba(0, 0, 0, 0.04), 0px 4px 32px rgba(0, 0, 0, 0.16)', @@ -1,5 +1,3 @@ -import theme from '#/entities/theme/model/theme' -import { useThemeAndDevice } from '#/shared/lib/hooks' import { Button } from '@mui/material' import { signIn } from 'next-auth/react' import Image from 'next/image' @@ -8,8 +6,6 @@ import React, { useState } from 'react' interface YandexAuthButtonProps {} export const YandexAuthButton = ({}: YandexAuthButtonProps) => { - const { theme } = useThemeAndDevice() - const [hovered, setHovered] = useState(false) return ( @@ -26,8 +22,8 @@ export const YandexAuthButton = ({}: YandexAuthButtonProps) => { }} style={{ opacity: hovered ? 0.7 : 1 }} sx={{ - backgroundColor: theme === 'dark' ? '#1C1C1E' : '#F1FAFF', - color: theme === 'dark' ? 'white' : '#2B2B42', + backgroundColor: '#1C1C1E', + color: 'white', lineHeight: '20px', fontSize: '16px', fontWeight: '600px', @@ -38,7 +34,7 @@ export const YandexAuthButton = ({}: YandexAuthButtonProps) => { boxShadow: 'none', height: 50, '&:hover': { - backgroundColor: theme === 'dark' ? '#1C1C1E' : '#F1FAFF', + backgroundColor: '#1C1C1E', // opacity: 0.7, boxShadow: 'none', }, @@ -1,11 +1,8 @@ -import { useAppSelector } from '#/app/store/store' import { DeviceOs } from '../types/entities' export const useThemeAndDevice = (device?: 'desktop' | 'mobile', deviceOs?: DeviceOs) => { - const theme = useAppSelector((state) => state.theme.theme) - const desktop = device === 'desktop' const ios = deviceOs === 'ios' - return { theme, desktop, ios } + return { theme: 'dark', desktop, ios } } @@ -4,7 +4,6 @@ export type DeviceOs = 'android' | 'ios' export interface IProps { device: Device token: string | null | undefined - theme?: 'dark' | 'light' } export type TDeviceProp = { @@ -69,10 +69,3 @@ } } } - -html[data-theme='dark'] { - .button_gray { - color: white !important; - background-color: #5d5a5a !important; - } -} @@ -136,33 +136,31 @@ } } -html[data-theme='light'] { - .wrapper_outline { - border: 2px solid #f2f2f8 !important; - &:focus { - border: 2px solid var(--background-color-table) !important; - } +.wrapper_outline { + border: 2px solid #40404e !important; + &:focus { + border: 2px solid var(--background-color-table) !important; } +} - .wrapper_primary{ - border-color: #D4D7DB; +.wrapper_primary { + border-color: #40404e; - &:hover{ - border-color: var(--air-color); - } - } + &:hover { + border-color: var(--air-color); + } +} - .label_primary{ - color: #181C32; - } +.label_primary { + color: #ffffff; +} - .wrapper_error { - border-color: #ff76a7 !important; - &::placeholder { - color: #ff76a7 !important; - } - &:focus { - border: 2px solid #ff76a7 !important; - } +.wrapper_error { + border-color: #ff2372 !important; + &::placeholder { + color: #ff2372 !important; + } + &:focus { + border: 2px solid #ff2372 !important; } } @@ -90,35 +90,19 @@ } } -// Светлая тема -html[data-theme='light'] { - .header__error { - color: #ff76a7; - } - - .textarea { - &::placeholder { - color: rgba(128, 128, 142, 0.4); - } - - &_error { - &::placeholder { - color: #ff76a7 !important; - opacity: 0.7; - } - } - } +.header__error { + color: #ff2372; } -// Темная тема -html[data-theme='dark'] { - .header__error { - color: #ff2372; +.textarea { + &::placeholder { + color: rgba(128, 128, 142, 0.5); } - .textarea { + &_error { &::placeholder { - color: rgba(128, 128, 142, 0.5); + color: #ff2372 !important; + opacity: 0.7; } } } \ No newline at end of file @@ -4,7 +4,6 @@ import { Raleway } from 'next/font/google' import styles from './common-textarea.module.scss' -import { useAppSelector } from '#/app/store/store' import { c } from '#/shared/lib/helpers' export type TextAreaVariant = 'default' | 'outline' @@ -21,22 +20,16 @@ export interface CommonTextAreaProps extends React.TextareaHTMLAttributes { - const isLight = theme === 'light' - +// Извлекаем стили для textarea (только тёмная тема) +const getTextareaStyles = (error?: FieldError) => { return { wrapper: { - backgroundColor: isLight ? 'transparent' : '#151518', + backgroundColor: '#151518', borderRadius: '15px', - border: `2px solid ${ - error - ? (isLight ? '#ff76a7' : '#ff2372') - : (isLight ? '#d5d7db' : '#40404E') - }`, + border: `2px solid ${error ? '#ff2372' : '#40404E'}`, }, textarea: { - color: isLight ? '#272727' : '#E1E1E1', + color: '#E1E1E1', fontWeight: 500, }, } @@ -44,8 +37,7 @@ const getTextareaStyles = (theme: 'light' | 'dark', error?: FieldError) => { export const CommonTextArea = forwardRef( ({ showError = true, buttomSlot, label, error, className, disabled, trim = false, variant = 'default', ...props }, ref) => { - const theme = useAppSelector((state) => state.theme.theme) - const themeStyles = getTextareaStyles(theme, error) + const themeStyles = getTextareaStyles(error) const onChange = (event: React.ChangeEvent) => { if (props.onChange) { @@ -3,8 +3,6 @@ import { DateTimePicker, LocalizationProvider } from '@mui/x-date-pickers' import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs' import dayjs, { Dayjs } from 'dayjs' -import { useAppSelector } from '#/app/store/store' - import styles from './date.module.scss' export const DateInput = ({ @@ -18,7 +16,6 @@ export const DateInput = ({ date?: boolean prevdate?: boolean }) => { - const theme = useAppSelector((state) => state.theme.theme) useEffect(() => { if (date) { @@ -33,13 +30,13 @@ export const DateInput = ({ = ({ imageLoad, unpinImage, }) => { - const theme = useAppSelector((state) => state.theme.theme) const isCalculatePrice = useMemo(() => quality && count && desktop, []) @@ -102,7 +100,7 @@ export const InputImagesModels: FC = ({ ) } - const src = `/svg/chatgpt/send_message${theme === 'light' ? '' : '_dark'}.svg` + const src = `/svg/chatgpt/send_message_dark.svg` return ( = ({ borderRadius: '15px', ...styleInputWithoutBorderFocus, '& label': { color: '#8853FA' }, - backgroundColor: theme === 'light' ? 'white' : '#151518', + backgroundColor: '#151518', input: { - color: theme === 'light' ? '#272727' : '#E1E1E1', + color: '#E1E1E1', marginLeft: 1, }, fieldset: { borderRadius: '15px', - border: theme === 'light' ? '1px solid #E1E1E1' : 'none', + border: 'none', }, }} onKeyDown={(e) => { @@ -3,8 +3,6 @@ import { Box } from '@mui/material' import Dialog from '@mui/material/Dialog' import Image from 'next/image' -import { useAppSelector } from '#/app/store/store' - import styles from './modal.module.scss' export interface ModalProps { open: boolean @@ -12,8 +10,6 @@ export interface ModalProps { children?: ReactNode } export const Modal: FC = ({ open, onClose, children }) => { - const theme = useAppSelector((state) => state.theme.theme) - return ( = ({ open, onClose, children }) => { PaperProps={{ style: { borderRadius: 20, - backgroundColor: theme === 'dark' ? '#373737' : 'white', + backgroundColor: '#373737', }, }} open={open} @@ -2,8 +2,7 @@ import React from 'react' import { Typography } from '@mui/material' import Box from '@mui/material/Box' -import { useAppSelector } from '#/app/store/store' -import { PrettoSlider, PrettoSliderDark } from '#/widgets/filters-gpt/ui/filters' +import { PrettoSliderDark } from '#/widgets/filters-gpt/ui/filters' export const Slider = ({ value, @@ -22,8 +21,6 @@ export const Slider = ({ step: number onChangeCommitted?: () => void }) => { - const theme = useAppSelector((state) => state.theme.theme) - return ( @@ -42,29 +39,16 @@ export const Slider = ({ - {theme === 'light' ? ( - - ) : ( - - )} + ) @@ -2,7 +2,6 @@ import React from 'react' import { styled } from '@mui/material' import Switch, { SwitchProps } from '@mui/material/Switch' -import { useAppSelector } from '#/app/store/store' import { baseColor } from '#/shared/lib/constants/colors' import { pingFangFont } from '#/shared/lib/constants/font/font' @@ -26,7 +25,7 @@ const AntSwitch = styled(Switch)(({ theme }) => ({ color: 'white', '& + .MuiSwitch-track': { opacity: 1, - backgroundColor: theme.palette.mode === 'dark' ? '#177ddc' : baseColor, + backgroundColor: '#177ddc', }, }, }, @@ -42,20 +41,18 @@ const AntSwitch = styled(Switch)(({ theme }) => ({ '& .MuiSwitch-track': { borderRadius: 16 / 2, opacity: 1, - backgroundColor: theme.palette.mode === 'dark' ? 'rgba(255,255,255,.35)' : '#D4D4D4', + backgroundColor: 'rgba(255,255,255,.35)', boxSizing: 'border-box', }, })) export const SwitchCustom = (props: any) => { - const theme = useAppSelector((state) => state.theme.theme) - return ( = ({ children, title, placement, className, maxWidth }) => { - const theme = useAppSelector((state) => state.theme.theme) - return ( e.stopPropagation()} @@ -36,14 +32,14 @@ export const TooltipCustom: React.FC = ({ children, title, placement, cla componentsProps={{ tooltip: { sx: { - bgcolor: theme === 'light' ? '#E8E8FA' : '#4B4B4B', + bgcolor: '#4B4B4B', color: '#7F7DF3', fontSize: 15, borderRadius: '10px', maxWidth: maxWidth || 'auto', padding: '10px 13px', '& .MuiTooltip-arrow': { - color: theme === 'light' ? '#E8E8FA' : '#4B4B4B', + color: '#4B4B4B', }, boxShadow: '0px 0px 4px rgba(0, 0, 0, 0.04), 0px 4px 32px rgba(0, 0, 0, 0.16)', }, @@ -19,8 +19,6 @@ export const AccountMenu: React.FC = ({ anchorEl, changeVisible, d const open = Boolean(anchorEl) - const theme = useAppSelector((state) => state.theme.theme) - const desktop = device === 'desktop' const email = useAppSelector((state) => state.user.email) @@ -42,7 +40,7 @@ export const AccountMenu: React.FC = ({ anchorEl, changeVisible, d filter: 'drop-shadow(10px 10px 10px rgba(0,0,0,0.3))', width: desktop ? 'auto' : '100vw', zIndex: 10, - backgroundColor: theme === 'light' ? 'white' : '#2C2C2C', + backgroundColor: '#2C2C2C', }, }} MenuListProps={{ 'aria-labelledby': 'basic-button' }} @@ -6,7 +6,6 @@ import FormGroup from '@mui/material/FormGroup' import Menu from '@mui/material/Menu' import MenuItem from '@mui/material/MenuItem' -import { useAppSelector } from '#/app/store/store' interface IDalleFilterMenu { anchorEl: null | HTMLElement @@ -27,8 +26,6 @@ export const DalleFilterMenu: React.FC = ({ sliderChange, open, }) => { - const theme = useAppSelector((state) => state.theme.theme) - return ( = ({ MenuListProps={{ 'aria-labelledby': 'dalle-filter-button' }} PaperProps={{ sx: { - backgroundColor: theme === 'light' ? '' : '#151518', + backgroundColor: '#151518', }, }} > @@ -1,8 +1,6 @@ import React from 'react' import { Drawer } from '@mui/material' -import { useAppSelector } from '#/app/store/store' - type DrawerProps = { open: boolean onClose: (v: boolean) => void @@ -10,16 +8,15 @@ type DrawerProps = { } export function DrawerCustom(props: DrawerProps) { - const theme = useAppSelector((state) => state.theme.theme) return ( { - const { theme } = useThemeAndDevice() - - return {''} + return {''} } export const Error: React.FC = ({ handleClose }) => { const { message, variant, isOpened } = useShowDataStore() - const { theme } = useThemeAndDevice() const nodeRef = useRef(null) return ( @@ -37,9 +33,9 @@ export const Error: React.FC = ({ handleClose }) => { icon={} severity='error' sx={{ - backgroundColor: theme === 'light' ? 'white' : '#404040', + backgroundColor: '#404040', border: '1px solid #F15179', - color: theme === 'light' ? '#666666' : '#C7C7C7', + color: '#C7C7C7', borderRadius: '12px', }} > @@ -51,9 +47,9 @@ export const Error: React.FC = ({ handleClose }) => { icon={} severity='error' sx={{ - backgroundColor: theme === 'light' ? 'white' : '#404040', + backgroundColor: '#404040', border: '1px solid #5ef151', - color: theme === 'light' ? '#666666' : '#C7C7C7', + color: '#C7C7C7', borderRadius: '12px', }} > @@ -90,7 +90,5 @@ type FormStateProps = { option?: RegisterOptions } export const Input = (props: TextFieldProps & FormStateProps) => { - const { theme } = useThemeAndDevice() - - return + return } @@ -2,8 +2,6 @@ import * as React from 'react' import Menu from '@mui/material/Menu' import Typography from '@mui/material/Typography' -import { useAppSelector } from '#/app/store/store' - interface INotificationMenu { anchorEl: null | HTMLElement open: boolean @@ -11,7 +9,6 @@ interface INotificationMenu { } export const NotificationMenu: React.FC = ({ closeMenu, open, anchorEl }) => { - const theme = useAppSelector((state) => state.theme.theme) return ( = ({ closeMenu, open, PaperProps={{ elevation: 0, sx: { - backgroundColor: theme === 'light' ? 'white' : '#2B2828', + backgroundColor: '#2B2828', overflow: 'visible', filter: 'drop-shadow(0px 2px 8px rgba(0,0,0,0.32))', mt: 1, @@ -40,7 +37,7 @@ export const NotificationMenu: React.FC = ({ closeMenu, open, right: 14, width: 10, height: 10, - bgcolor: theme === 'light' ? 'white' : '#2B2828', + bgcolor: '#2B2828', transform: 'translateY(-50%) rotate(45deg)', zIndex: 0, }, @@ -2,7 +2,6 @@ import React from 'react' import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown' import { MenuItem, Select, SelectChangeEvent, Stack, Typography } from '@mui/material' -import { useAppSelector } from '#/app/store/store' import { baseColor } from '#/shared/lib/constants/colors' interface ISelect { @@ -25,7 +24,6 @@ export const SelectUI: React.FC = ({ children, ...args }) => { - const theme = useAppSelector((state) => state.theme.theme) return ( @@ -37,31 +35,31 @@ export const SelectUI: React.FC = ({ inputProps={{ MenuProps: { MenuListProps: { - backgroundColor: theme === 'light' ? 'transparent' : 'transparent', + backgroundColor: 'transparent', sx: { - color: theme === 'light' ? '#373737' : '#A6A5A5', - backgroundColor: theme === 'light' ? 'transparent' : '#151518', + color: '#A6A5A5', + backgroundColor: '#151518', }, }, }, }} style={{ - backgroundColor: theme === 'light' ? 'transparent' : 'transparent', + backgroundColor: 'transparent', }} sx={{ boxShadow: 'none', borderRadius: '13px', - backgroundColor: theme === 'light' ? 'transparent' : '#4B4B4B', - border: theme === 'light' ? '1px solid transparent' : '2px solid #40404E;', - color: theme === 'light' ? '#373737' : '#A6A5A5', + backgroundColor: '#4B4B4B', + border: '2px solid #40404E;', + color: '#A6A5A5', '.MuiSelect-icon': { color: '#A6A5A5', }, '&& fieldset': { - border: theme === 'light' ? '1px solid #E9E9E9' : '0px solid transparent', + border: '0px solid transparent', }, '&.Mui-focused': { - border: theme === 'light' ? `1px solid ${baseColor}` : '2px solid #40404E;', + border: '2px solid #40404E;', borderColor: baseColor, '& .MuiOutlinedInput-notchedOutline': { border: 'none', @@ -69,7 +67,7 @@ export const SelectUI: React.FC = ({ }, '&:hover': { '&& fieldset': { - border: theme === 'light' ? '1px solid #E9E9E9' : '0px solid transparent', + border: '0px solid transparent', }, }, }} @@ -1,7 +1,6 @@ import React from 'react' import { Stack } from '@mui/material' -import { useAppSelector } from '#/app/store/store' import { StatsField } from '#/widgets/stats-field' import { useSession } from 'next-auth/react' import { getDeviceType } from '#/shared/lib/helpers' @@ -11,8 +10,6 @@ import { NextPageWithLayout } from '#/pages/_app' * @deprecated */ const Admin: NextPageWithLayout = () => { - const theme = useAppSelector((state) => state.theme.theme) - const device = getDeviceType() const { data: session } = useSession() @@ -23,7 +20,7 @@ const Admin: NextPageWithLayout = () => { alignItems='center' sx={{ width: '80vw', margin: '40px auto' }} > - + ) } @@ -3,10 +3,9 @@ import { Stack, TextField, Typography } from '@mui/material' import Image from 'next/image' import { useSession } from 'next-auth/react' -import { useAppSelector } from '#/app/store/store' import { TooltipCustom } from '#/shared' import { API_URL } from '#/shared/lib/constants' -import { InputStyleSmallDark, InputStyleSmallLight } from '#/shared/ui/input' +import { InputStyleSmallDark } from '#/shared/ui/input' import axios from 'axios' export type KeyItemBaseProps = { @@ -21,7 +20,6 @@ export type KeyItemBaseProps = { export type KeyItemRenderProps = { isCopy: boolean limit: string | number | null - theme: string handleCopy: (text: string) => void handleLimitChange: (value: string) => void } @@ -33,7 +31,6 @@ type KeyItemProps = KeyItemBaseProps & { export const KeyItem: React.FC = ({ children, limit: initialLimit, name }) => { const [isCopy, setIsCopy] = useState(false) const [limit, setLimit] = useState(initialLimit) - const theme = useAppSelector((state) => state.theme.theme) const { data: session } = useSession() useEffect(() => { @@ -83,7 +80,6 @@ export const KeyItem: React.FC = ({ children, limit: initialLimit, {children({ isCopy, limit, - theme, handleCopy, handleLimitChange, })} @@ -106,16 +102,15 @@ export const KeyItemDetail: React.FC = ({ title, value }) = export const KeyItemLimitField: React.FC<{ value: string | number | null onChange: (value: string) => void - theme: string fullWidth?: boolean -}> = ({ value, onChange, theme, fullWidth = false }) => ( +}> = ({ value, onChange, fullWidth = false }) => ( onChange(event.target.value)} - sx={theme === 'light' ? { ...InputStyleSmallLight } : { ...InputStyleSmallDark }} + sx={{ ...InputStyleSmallDark }} /> ) @@ -126,7 +126,7 @@ type KeyRowProps = { const KeyRow: React.FC = ({ id, name, keyValue, limit, createdAt, expiresAt, onDelete }) => ( - {({ theme, handleCopy, handleLimitChange, isCopy, limit: currentLimit }) => ( + {({ handleCopy, handleLimitChange, isCopy, limit: currentLimit }) => ( = ({ id, name, keyValue, limit, createdAt, e - + {createdAt} @@ -88,7 +88,7 @@ type KeyCardProps = { const KeyCard: React.FC = ({ id, name, keyValue, limit, createdAt, expiresAt, onDelete }) => ( - {({ isCopy, handleCopy, handleLimitChange, theme, limit: currentLimit }) => ( + {({ isCopy, handleCopy, handleLimitChange, limit: currentLimit }) => ( @@ -110,7 +110,7 @@ const KeyCard: React.FC = ({ id, name, keyValue, limit, createdAt, Лимит токенов - + @@ -5,7 +5,6 @@ import axios from 'axios' import Image from 'next/image' import Link from 'next/link' import { useRouter } from 'next/router' -import { useAppSelector } from '#/app/store/store' import { API_URL } from '#/shared/lib/constants/constants' import { getDeviceType, getRandomImage } from '#/shared/lib/helpers' import { NextPageWithLayout } from '#/pages/_app' @@ -44,8 +43,6 @@ const ChangePassword: NextPageWithLayout = () => { const refImage = useRef(getRandomImage()) - const theme = useAppSelector((state) => state.theme.theme) - return ( <> { sx={{ padding: 0, margin: desktop ? 0 : '60px auto', - backgroundColor: theme === 'light' ? 'white' : '#373737', + backgroundColor: '#373737', }} > { { { paddingTop: 0, paddingBottom: 0, '& label': { color: '#8853FA' }, - backgroundColor: theme === 'light' ? 'transparent' : '#3D3D3D', + backgroundColor: '#3D3D3D', input: { - color: theme === 'light' ? '#272727' : '#E1E1E1', + color: '#E1E1E1', }, }} value={password1} @@ -179,7 +176,7 @@ const ChangePassword: NextPageWithLayout = () => { { paddingTop: 0, paddingBottom: 0, '& label': { color: '#8853FA' }, - backgroundColor: theme === 'light' ? 'transparent' : '#3D3D3D', + backgroundColor: '#3D3D3D', input: { - color: theme === 'light' ? '#272727' : '#E1E1E1', + color: '#E1E1E1', }, }} value={password2} @@ -151,7 +151,7 @@ const Page: NextPageWithLayout = () => { }) return true } - const theme = useAppSelector((state) => state.theme.theme) + // theme removed: always dark // Подготавливаем данные для API вкладки // Фильтруем параметры - оставляем только актуальные для текущей версии @@ -256,13 +256,7 @@ const Page: NextPageWithLayout = () => { spacing={0} sx={{ borderRadius: desktop ? '15px' : '13px', - backgroundColor: desktop - ? theme === 'light' - ? 'white' - : '#151518' - : theme === 'light' - ? 'white' - : '#151518', + backgroundColor: '#151518', padding: desktop ? (botParams?.blocked ? 2 : 2) : 1.25, paddingBlock: 1.5, width: '100%', @@ -11,7 +11,6 @@ import { signIn } from 'next-auth/react' import styles from './login.module.scss' -import { useAppSelector } from '#/app/store/store' import ClosedEyeSvg from '#/assets/svg/closed-eye.svg?react' import OpenedEyeSvg from '#/assets/svg/opened-eye.svg?react' import { PasswordOptions } from '#/features/register-by-email/lib/constants' @@ -90,8 +89,6 @@ const Login: NextPageWithLayout = () => { event.target.value = event.target.value.trim() } - const theme = useAppSelector((state) => state.theme.theme) - return ( <> { overflow: 'hidden', padding: 0, margin: desktop ? 0 : '0px auto', - backgroundColor: theme === 'light' ? 'white' : '#303035', + backgroundColor: '#303035', }} > {!desktop && ( @@ -147,7 +144,7 @@ const Login: NextPageWithLayout = () => { > { @@ -259,11 +252,7 @@ const Login: NextPageWithLayout = () => { ), }} - sx={ - theme === 'light' - ? { ...InputStyleLight } - : { ...InputStyleDark } - } + sx={{ ...InputStyleDark }} {...register('password', { ...PasswordOptions, })} @@ -24,7 +24,6 @@ const Register: NextPageWithLayout = () => { const [success, setSuccess] = useState(false) const [isReferral, setIsReferral] = useState(true) - const theme = useAppSelector((state) => state.theme.theme) const referral = useAppSelector((state) => state.user.referral) const dispatch = useDispatch() @@ -53,7 +52,7 @@ const Register: NextPageWithLayout = () => { overflow: 'hidden', padding: 0, margin: desktop ? 0 : '0px auto', - backgroundColor: theme === 'light' ? 'white' : '#303035', + backgroundColor: '#303035', }} > {!desktop && ( @@ -103,7 +102,7 @@ const Register: NextPageWithLayout = () => { { const refImage = React.useRef(getRandomImage()) - const theme = useAppSelector((state) => state.theme.theme) - return ( { sx={{ padding: 0, margin: desktop ? 0 : '60px auto', - backgroundColor: theme === 'light' ? 'white' : '#373737', + backgroundColor: '#373737', }} > {desktop && ( @@ -154,7 +151,7 @@ const Reset: NextPageWithLayout = () => { sx={{ fontSize: 21, textAlign: 'center', - color: theme === 'light' ? '#272727' : '#E1E1E1', + color: '#E1E1E1', }} > Письмо для восстановления пароля отправлено вам на почту! @@ -8,10 +8,9 @@ import { useSession } from 'next-auth/react' import styles from '#/app/styles/business.module.scss' import styles2 from '#/widgets/business-models/ui/models-list/models-list.module.scss' -import { useAppSelector } from '#/app/store/store' import { getAll, ResponseAllInfo } from '#/entities/user-account/model/user-type-slice' import { ResponseGetPersons } from '#/features/invite-person-in-business' -import { Error, InputStyleDark, InputStyleLight } from '#/shared' +import { Error, InputStyleDark } from '#/shared' import { API_URL } from '#/shared/lib/constants' import { useShowDataStore } from '#/shared/lib/hooks/use-show-data' import { DateInput } from '#/shared/ui/date-input/date-input' @@ -120,7 +119,6 @@ export default function BusinessHost() { const MailingBlock = ({ info, mailing }: { info: InfoBusiness | null | undefined; mailing: boolean | undefined }) => { const [showPersons, setShowPersons] = useState(true) const [newMail, setNewMail] = useState('') - const theme = useAppSelector((state) => state.theme.theme) const [allMails, setAllMails] = useState() const [isMailing, setIsMailing] = useState(false) const { data } = useSession() @@ -174,7 +172,7 @@ const MailingBlock = ({ info, mailing }: { info: InfoBusiness | null | undefined placeholder={'Введите почту'} onChange={(e) => setNewMail(e.target.value)} fullWidth - sx={theme === 'light' ? { ...InputStyleLight } : { ...InputStyleDark }} + sx={{ ...InputStyleDark }} /> @@ -11,7 +11,6 @@ import { Dayjs } from 'dayjs' import { useSession } from 'next-auth/react' import { ResponseGetLogsList } from '#/features/invite-person-in-business/model/types' -import { useAppSelector } from '#/app/store/store' import { Search } from '#/shared' import { DateInput } from '#/shared/ui/date-input/date-input' import styles from '#/widgets/business-models/ui/models-list/models-list.module.scss' @@ -29,7 +28,6 @@ export const LogList = () => { const [showPersons, setShowPersons] = useState(true) const [search, setSearch] = useState('') - const theme = useAppSelector((state) => state.theme.theme) const { data } = useSession() useEffect(() => { @@ -89,7 +87,7 @@ export const LogList = () => { color='inherit' aria-label='Basic button group' sx={{ - color: theme === 'light' ? 'black' : '#7f7df3', + color: '#7f7df3', }} >