Skip to content

Commit

Permalink
feat: add settings for svgr plugin and fix sidebar icon
Browse files Browse the repository at this point in the history
  • Loading branch information
sashtje committed Oct 9, 2023
1 parent f4c4079 commit c02488b
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 23 deletions.
Binary file modified .loki/reference/chrome_iphone7_features_ThemeSwitcher_Dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_iphone7_features_ThemeSwitcher_Normal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_iphone7_widgets_Sidebar_Dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_iphone7_widgets_Sidebar_Light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_iphone7_widgets_Sidebar_No_Auth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_laptop_features_ThemeSwitcher_Dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_laptop_features_ThemeSwitcher_Normal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_laptop_widgets_Sidebar_Dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_laptop_widgets_Sidebar_Light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .loki/reference/chrome_laptop_widgets_Sidebar_No_Auth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 16 additions & 1 deletion config/build/buildLoaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,22 @@ export function buildLoaders(options: BuildOptions): webpack.RuleSetRule[] {

const svgLoader = {
test: /\.svg$/,
use: ['@svgr/webpack'],
use: [{
loader: '@svgr/webpack',
options: {
icon: true,
svgoConfig: {
plugins: [
{
name: 'convertColors',
params: {
currentColor: true,
}
}
]
}
}
}],
};

const codeBabelLoader = buildBabelLoader({ ...options, isTsx: false });
Expand Down
7 changes: 3 additions & 4 deletions src/features/ThemeSwitcher/ui/ThemeSwitcher.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { memo, useCallback } from 'react';

import { classNames } from '@/shared/lib/classNames';
import LightIcon from '@/shared/assets/icons/theme-light.svg';
import DarkIcon from '@/shared/assets/icons/theme-dark.svg';
import { Button, ButtonTheme } from '@/shared/ui/Button';
import { Theme } from '@/shared/const/theme';
import { useTheme } from '@/shared/lib/hooks/useTheme/useTheme';
import { saveJsonSettings } from '@/entities/User';
import { useAppDispatch } from '@/shared/lib/hooks/useAppDispatch/useAppDispatch';
import ThemeIcon from '@/shared/assets/icons/theme.svg';
import { Icon } from '@/shared/ui/Icon';

interface ThemeSwitcherProps {
className?: string;
Expand All @@ -29,7 +28,7 @@ export const ThemeSwitcher = memo(({ className }: ThemeSwitcherProps) => {
className={classNames('', {}, [className])}
onClick={onToggleHandler}
>
{theme === Theme.DARK ? <DarkIcon /> : <LightIcon />}
<Icon Svg={ThemeIcon} width={40} height={40} inverted />
</Button>
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export const ArticleViewSelector = memo((props: ArticleViewSelectorProps) => {
<Icon
className={classNames('', { [cls.notSelected]: viewType.view !== view }, [])}
Svg={viewType.icon}
width={24}
height={24}
/>
</Button>
))}
Expand Down
18 changes: 0 additions & 18 deletions src/shared/assets/icons/theme-dark.svg

This file was deleted.

File renamed without changes

0 comments on commit c02488b

Please sign in to comment.