export function classNames(cls: string, mods: Mods = {}, additional: string[] = []): string {
- return [
- cls,
- ...additional.filter(Boolean),
- ...Object.entries(mods)
- .filter(([, value]) => Boolean(value))
- .map(([className]) => className),
- ]
- .join(' ');
+ return [
+ cls,
+ ...additional.filter(Boolean),
+ ...Object.entries(mods)
+ .filter(([, value]) => Boolean(value))
+ .map(([className]) => className),
+ ]
+ .join(' ');
}
diff --git a/src/shared/lib/tests/renderWithTranslation/renderWithTranslation.tsx b/src/shared/lib/tests/renderWithTranslation/renderWithTranslation.tsx
index f29d33d..cdcf984 100644
--- a/src/shared/lib/tests/renderWithTranslation/renderWithTranslation.tsx
+++ b/src/shared/lib/tests/renderWithTranslation/renderWithTranslation.tsx
@@ -4,9 +4,9 @@ import { I18nextProvider } from 'react-i18next';
import i18nForTests from 'shared/config/i18n/i18nForTests';
export function renderWithTranslation(component: ReactNode) {
- return render(
-
- {component}
- ,
- );
+ return render(
+
+ {component}
+ ,
+ );
}
diff --git a/src/shared/ui/LangSwitcher/LangSwitcher.tsx b/src/shared/ui/LangSwitcher/LangSwitcher.tsx
index cc7ad92..7b94614 100644
--- a/src/shared/ui/LangSwitcher/LangSwitcher.tsx
+++ b/src/shared/ui/LangSwitcher/LangSwitcher.tsx
@@ -9,19 +9,19 @@ interface LangSwitcherProps {
}
export const LangSwitcher = ({ className, short }: LangSwitcherProps) => {
- const { t, i18n } = useTranslation();
+ const { t, i18n } = useTranslation();
- const toggle = async () => {
- i18n.changeLanguage(i18n.language === 'ru' ? 'en' : 'ru');
- };
+ const toggle = async () => {
+ i18n.changeLanguage(i18n.language === 'ru' ? 'en' : 'ru');
+ };
- return (
-
- );
+ return (
+
+ );
};
diff --git a/src/shared/ui/Loader/Loader.tsx b/src/shared/ui/Loader/Loader.tsx
index 292d8a7..4574c75 100644
--- a/src/shared/ui/Loader/Loader.tsx
+++ b/src/shared/ui/Loader/Loader.tsx
@@ -6,10 +6,10 @@ interface LoaderProps {
}
export const Loader = ({ className }: LoaderProps) => (
-
+
);
diff --git a/src/shared/ui/PageLoader/PageLoader.tsx b/src/shared/ui/PageLoader/PageLoader.tsx
index e765ed2..c0f319e 100644
--- a/src/shared/ui/PageLoader/PageLoader.tsx
+++ b/src/shared/ui/PageLoader/PageLoader.tsx
@@ -7,7 +7,7 @@ interface PageLoaderProps {
}
export const PageLoader = ({ className }: PageLoaderProps) => (
-
-
-
+
+
+
);
diff --git a/src/shared/ui/ThemeSwitcher/index.tsx b/src/shared/ui/ThemeSwitcher/index.tsx
index ca6bb12..5d862d7 100644
--- a/src/shared/ui/ThemeSwitcher/index.tsx
+++ b/src/shared/ui/ThemeSwitcher/index.tsx
@@ -1,5 +1,5 @@
import { ThemeSwitcher } from './ui/ThemeSwitcher';
export {
- ThemeSwitcher,
+ ThemeSwitcher,
};
diff --git a/src/shared/ui/ThemeSwitcher/ui/ThemeSwitcher.tsx b/src/shared/ui/ThemeSwitcher/ui/ThemeSwitcher.tsx
index 24cd433..1bd329a 100644
--- a/src/shared/ui/ThemeSwitcher/ui/ThemeSwitcher.tsx
+++ b/src/shared/ui/ThemeSwitcher/ui/ThemeSwitcher.tsx
@@ -10,15 +10,15 @@ interface ThemeSwitcherProps {
}
export const ThemeSwitcher = ({ className }: ThemeSwitcherProps) => {
- const { theme, toggleTheme } = useTheme();
+ const { theme, toggleTheme } = useTheme();
- return (
-
- );
+ return (
+
+ );
};
diff --git a/src/widgets/ErrorPage/ui/ErrorPage.tsx b/src/widgets/ErrorPage/ui/ErrorPage.tsx
index 740fe41..3c15630 100644
--- a/src/widgets/ErrorPage/ui/ErrorPage.tsx
+++ b/src/widgets/ErrorPage/ui/ErrorPage.tsx
@@ -8,19 +8,19 @@ interface ErrorPageProps {
}
export const ErrorPage = ({ className }: ErrorPageProps) => {
- const { t } = useTranslation();
+ const { t } = useTranslation();
- const reloadPage = () => {
- // eslint-disable-next-line no-restricted-globals
- location.reload();
- };
+ const reloadPage = () => {
+ // eslint-disable-next-line no-restricted-globals
+ location.reload();
+ };
- return (
-
-
{t('Произошла непредвиденная ошибка')}
-
-
- );
+ return (
+
+
{t('Произошла непредвиденная ошибка')}
+
+
+ );
};
diff --git a/src/widgets/Navbar/index.ts b/src/widgets/Navbar/index.ts
index 1e7468b..f1a33f4 100644
--- a/src/widgets/Navbar/index.ts
+++ b/src/widgets/Navbar/index.ts
@@ -1,5 +1,5 @@
import { Navbar } from './ui/Navbar';
export {
- Navbar,
+ Navbar,
};
diff --git a/src/widgets/Navbar/ui/Navbar.tsx b/src/widgets/Navbar/ui/Navbar.tsx
index a064974..a13c3fb 100644
--- a/src/widgets/Navbar/ui/Navbar.tsx
+++ b/src/widgets/Navbar/ui/Navbar.tsx
@@ -10,27 +10,27 @@ interface NavbarProps {
}
export const Navbar = ({ className }: NavbarProps) => {
- const { t } = useTranslation();
- const [isAuthModal, setIsAuthModal] = useState(false);
+ const { t } = useTranslation();
+ const [isAuthModal, setIsAuthModal] = useState(false);
- const onToggleModal = useCallback(() => {
- setIsAuthModal((prev) => !prev);
- }, []);
+ const onToggleModal = useCallback(() => {
+ setIsAuthModal((prev) => !prev);
+ }, []);
- return (
-
-
- {/* eslint-disable-next-line i18next/no-literal-string */}
-
- Lorem ipsum dolor sit amet,
- consectetur adipisicing elit. Nesciunt, suscipit?
-
-
- );
+ return (
+
+
+ {/* eslint-disable-next-line i18next/no-literal-string */}
+
+ Lorem ipsum dolor sit amet,
+ consectetur adipisicing elit. Nesciunt, suscipit?
+
+
+ );
};
diff --git a/src/widgets/Sidebar/index.ts b/src/widgets/Sidebar/index.ts
index def0fbc..add07ca 100644
--- a/src/widgets/Sidebar/index.ts
+++ b/src/widgets/Sidebar/index.ts
@@ -1,5 +1,5 @@
import { Sidebar } from './ui/Sidebar/Sidebar';
export {
- Sidebar,
+ Sidebar,
};
diff --git a/src/widgets/Sidebar/ui/Sidebar/Sidebar.tsx b/src/widgets/Sidebar/ui/Sidebar/Sidebar.tsx
index f1a0fe7..e3b2213 100644
--- a/src/widgets/Sidebar/ui/Sidebar/Sidebar.tsx
+++ b/src/widgets/Sidebar/ui/Sidebar/Sidebar.tsx
@@ -15,55 +15,55 @@ interface SidebarProps {
}
export const Sidebar = ({ className }: SidebarProps) => {
- const [collapsed, setCollapsed] = useState(false);
+ const [collapsed, setCollapsed] = useState(false);
- const { t } = useTranslation();
+ const { t } = useTranslation();
- const onToggle = () => {
- setCollapsed((prev) => !prev);
- };
+ const onToggle = () => {
+ setCollapsed((prev) => !prev);
+ };
- return (
-
+
+
+
-
-
-
-
-
- {t('Главная')}
-
-
-
-
-
- {t('О сайте')}
-
-
-
-
-
-
-
-
- );
+
+
+ {t('Главная')}
+
+
+
+
+
+ {t('О сайте')}
+
+
+
+
+
+
+
+
+ );
};
diff --git a/webpack.config.ts b/webpack.config.ts
index c29bd62..718b536 100644
--- a/webpack.config.ts
+++ b/webpack.config.ts
@@ -4,24 +4,24 @@ import { buildWebpackConfig } from './config/build/buildWebpackConfig';
import { BuildEnv, BuildPaths } from './config/build/types/config';
export default (env: BuildEnv) => {
- const paths: BuildPaths = {
- entry: path.resolve(__dirname, 'src', 'index.tsx'),
- build: path.resolve(__dirname, 'build'),
- html: path.resolve(__dirname, 'public', 'index.html'),
- src: path.resolve(__dirname, 'src'),
- };
+ const paths: BuildPaths = {
+ entry: path.resolve(__dirname, 'src', 'index.tsx'),
+ build: path.resolve(__dirname, 'build'),
+ html: path.resolve(__dirname, 'public', 'index.html'),
+ src: path.resolve(__dirname, 'src'),
+ };
- const mode = env.mode || 'development';
- const PORT = env.port || 3000;
+ const mode = env.mode || 'development';
+ const PORT = env.port || 3000;
- const isDev = mode === 'development';
+ const isDev = mode === 'development';
- const config: webpack.Configuration = buildWebpackConfig({
- mode,
- paths,
- isDev,
- port: PORT,
- });
+ const config: webpack.Configuration = buildWebpackConfig({
+ mode,
+ paths,
+ isDev,
+ port: PORT,
+ });
- return config;
+ return config;
};