Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: style more priority #7854

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/vkui/src/components/FixedLayout/FixedLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const FixedLayout = ({
vertical && stylesVertical[vertical],
className,
)}
style={{ ...style, width }}
style={{ width, ...style }}
>
{children}
</OnboardingTooltipContainer>
Expand Down
12 changes: 4 additions & 8 deletions packages/vkui/src/components/FormField/FormField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,10 @@ export const FormField = ({
<Component
{...restProps}
ref={elRef}
style={
maxHeight !== undefined
? {
...style,
maxHeight,
}
: style
}
style={{
maxHeight,
...style,
}}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
className={classNames(
Expand Down
2 changes: 1 addition & 1 deletion packages/vkui/src/components/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export const List = ({
role="list"
className={classNames(styles.host, className)}
style={{
...style,
gridGap: gap,
...style,
}}
{...restProps}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ export const ModalCardBase = ({
withSafeZone && styles.withSafeZone,
)}
style={{
...style,
maxWidth: size,
...style,
}}
>
<div
Expand Down
2 changes: 1 addition & 1 deletion packages/vkui/src/components/Popper/Popper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,14 @@ export const Popper = ({
baseClassName={styles.host}
getRootRef={handleRootRef}
style={{
...styleProp,
...convertFloatingDataToReactCSSProperties(
floatingPositionStrategy,
floatingDataX,
floatingDataY,
sameWidth ? null : undefined,
middlewareData,
),
...styleProp,
}}
>
{arrow && (
Expand Down
14 changes: 3 additions & 11 deletions packages/vkui/src/components/Progress/Progress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ function progressCustomHeightStyle(height: number | undefined): React.CSSPropert
: undefined;
}

function progressStyle(height: number | undefined, styleProps: React.CSSProperties | undefined) {
const styleHeight = progressCustomHeightStyle(height);
const style = styleHeight ? { ...styleProps, ...styleHeight } : styleProps;

return style;
}

export interface ProgressProps extends HTMLAttributesWithRootRef<HTMLDivElement> {
/**
* Стиль отображения прогрессбара
Expand All @@ -49,19 +42,18 @@ export const Progress = ({
value = 0,
appearance = 'accent',
height,
style: styleProps,
style,
...restProps
}: ProgressProps): React.ReactNode => {
const progress = clamp(value, PROGRESS_MIN_VALUE, PROGRESS_MAX_VALUE);
const title = `${progress} / ${PROGRESS_MAX_VALUE}`;

const style = progressStyle(height, styleProps);
const styleHeight = progressCustomHeightStyle(height);

return (
<RootComponent
aria-valuenow={value}
title={title}
style={style}
style={{ ...styleHeight, ...style }}
{...restProps}
role="progressbar"
aria-valuemin={PROGRESS_MIN_VALUE}
Expand Down
6 changes: 3 additions & 3 deletions packages/vkui/src/components/SplitCol/SplitCol.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ export const SplitCol = (props: SplitColProps): React.ReactNode => {
<RootComponent
{...restProps}
style={{
width,
maxWidth,
minWidth,
...style,
width: width,
maxWidth: maxWidth,
minWidth: minWidth,
}}
getRootRef={baseRef}
baseClassName={classNames(
Expand Down
Loading