Skip to content

Commit

Permalink
feat: redesign scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
sashtje committed Oct 16, 2023
1 parent 9cc9ed3 commit a030d35
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/app/providers/ThemeProvider/ui/ThemeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const ThemeProvider = (props: ThemeProviderProps) => {
if (!isThemeInited && !initialTheme && defaultTheme) {
setTheme(defaultTheme);
setThemeInited(true);
(document.childNodes[1] as HTMLElement).className = defaultTheme;
}
}, [defaultTheme, initialTheme, isThemeInited]);

Expand Down
8 changes: 4 additions & 4 deletions src/app/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body {
}

* {
scrollbar-color: var(--card-bg) var(--inverted-primary-color);
scrollbar-color: var(--icon-redesigned) var(--light-bg-redesigned);
scrollbar-width: 10px;
}

Expand Down Expand Up @@ -39,11 +39,11 @@ body.redesigned {
}

*::-webkit-scrollbar-track {
background: var(--card-bg);
background: var(--light-bg-redesigned);
}

*::-webkit-scrollbar-thumb {
background-color: var(--inverted-primary-color);
background-color: var(--icon-redesigned);
border-radius: 20px;
border: 3px solid var(--primary-color);
border: 3px solid var(--accent-redesigned);
}
2 changes: 1 addition & 1 deletion src/features/ThemeSwitcher/ui/ThemeSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface ThemeSwitcherProps {
}

export const ThemeSwitcher = memo(({ className }: ThemeSwitcherProps) => {
const { theme, toggleTheme } = useTheme();
const { toggleTheme } = useTheme();
const dispatch = useAppDispatch();

const onToggleHandler = useCallback(() => {
Expand Down
2 changes: 2 additions & 0 deletions src/shared/lib/hooks/useTheme/useTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export function useTheme(): UseThemeResult {
on: () => 'redesigned',
off: () => '',
})} ${theme || Theme.LIGHT}`;

(document.childNodes[1] as HTMLElement).className = theme || Theme.LIGHT;
}, [theme]);

const toggleTheme = (saveAction: (theme: Theme) => void) => {
Expand Down
1 change: 1 addition & 0 deletions src/shared/ui/redesigned/StarRating/ui/StarRating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const StarRating = memo((props: StarRatingProps) => {
<div className={classNames(cls.starRating, {}, [className])}>
{stars.map((starNumber) => (
<ToggleFeatures
key={starNumber}
feature="isAppRedesigned"
on={
<Icon
Expand Down

0 comments on commit a030d35

Please sign in to comment.