Skip to content

Commit 94a1db4

Browse files
committed
feat(FixedLayout): tokenized
1 parent a8f42bf commit 94a1db4

9 files changed

Lines changed: 15 additions & 16 deletions

File tree

src/components/FixedLayout/FixedLayout.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919

2020
.FixedLayout--filled {
21-
background: var(--background_content);
21+
background: var(--background_content, var(--vkui--color_background_content));
2222
}
2323

2424
.FixedLayout--top {

src/components/FixedLayout/FixedLayout.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { baselineComponent } from "../../testing/utils";
2-
import FixedLayout from "./FixedLayout";
2+
import { FixedLayout } from "./FixedLayout";
33

44
describe("FixedLayout", () => {
55
baselineComponent(FixedLayout);

src/components/FixedLayout/FixedLayout.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from "react";
2-
import { getClassName } from "../../helpers/getClassName";
2+
import { IOS } from "../../lib/platform";
33
import { classNames } from "../../lib/classNames";
44
import { HasRef, HasRootRef } from "../../types";
55
import { SplitColContext } from "../SplitCol/SplitCol";
@@ -31,7 +31,7 @@ export interface FixedLayoutState {
3131
/**
3232
* @see https://vkcom.github.io/VKUI/#/FixedLayout
3333
*/
34-
const FixedLayout: React.FC<FixedLayoutProps> = ({
34+
export const FixedLayout: React.FC<FixedLayoutProps> = ({
3535
children,
3636
style,
3737
vertical,
@@ -54,12 +54,10 @@ const FixedLayout: React.FC<FixedLayoutProps> = ({
5454
{...restProps}
5555
fixed
5656
ref={getRootRef}
57-
// eslint-disable-next-line vkui/no-object-expression-in-arguments
5857
vkuiClass={classNames(
59-
getClassName("FixedLayout", platform),
60-
{
61-
"FixedLayout--filled": filled,
62-
},
58+
"FixedLayout",
59+
platform === IOS && "FixedLayout--ios",
60+
filled && "FixedLayout--filled",
6361
`FixedLayout--${vertical}`
6462
)}
6563
style={{ ...style, width }}
@@ -70,6 +68,3 @@ const FixedLayout: React.FC<FixedLayoutProps> = ({
7068
</TooltipContainer>
7169
);
7270
};
73-
74-
// eslint-disable-next-line import/no-default-export
75-
export default FixedLayout;

src/components/PanelHeader/PanelHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { usePlatform } from "../../hooks/usePlatform";
33
import { getClassName } from "../../helpers/getClassName";
44
import { classNames } from "../../lib/classNames";
55
import { warnOnce } from "../../lib/warnOnce";
6-
import FixedLayout from "../FixedLayout/FixedLayout";
6+
import { FixedLayout } from "../FixedLayout/FixedLayout";
77
import { Separator } from "../Separator/Separator";
88
import { Platform, VKCOM } from "../../lib/platform";
99
import { HasRef, HasRootRef } from "../../types";

src/components/PanelHeaderContext/PanelHeaderContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from "react";
2-
import FixedLayout from "../FixedLayout/FixedLayout";
2+
import { FixedLayout } from "../FixedLayout/FixedLayout";
33
import { classNames } from "../../lib/classNames";
44
import { getClassName } from "../../helpers/getClassName";
55
import { ViewWidth } from "../AdaptivityProvider/AdaptivityContext";

src/components/PullToRefresh/PullToRefresh.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { usePlatform } from "../../hooks/usePlatform";
99
import { useGlobalEventListener } from "../../hooks/useGlobalEventListener";
1010
import { ScrollContextInterface, useScroll } from "../AppRoot/ScrollContext";
1111
import { Touch, TouchEvent, TouchProps } from "../Touch/Touch";
12-
import FixedLayout from "../FixedLayout/FixedLayout";
12+
import { FixedLayout } from "../FixedLayout/FixedLayout";
1313
import { PullToRefreshSpinner } from "./PullToRefreshSpinner";
1414
import TouchRootContext from "../Touch/TouchContext";
1515
import { usePrevious } from "../../hooks/usePrevious";

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export { default as TabbarItem } from "./components/TabbarItem/TabbarItem";
3333
export type { TabbarItemProps } from "./components/TabbarItem/TabbarItem";
3434
export { HorizontalScroll } from "./components/HorizontalScroll/HorizontalScroll";
3535
export type { HorizontalScrollProps } from "./components/HorizontalScroll/HorizontalScroll";
36-
export { default as FixedLayout } from "./components/FixedLayout/FixedLayout";
36+
export { FixedLayout } from "./components/FixedLayout/FixedLayout";
3737
export type { FixedLayoutProps } from "./components/FixedLayout/FixedLayout";
3838

3939
/**

src/tokenized/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ export type { HeadlineProps } from "../components/Typography/Headline/Headline";
107107
export { Div } from "../components/Div/Div";
108108
export type { DivProps } from "../components/Div/Div";
109109

110+
export { FixedLayout } from "../components/FixedLayout/FixedLayout";
111+
export type { FixedLayoutProps } from "../components/FixedLayout/FixedLayout";
112+
110113
export { Counter } from "../components/Counter/Counter";
111114
export type { CounterProps } from "../components/Counter/Counter";
112115

styleguide/tokenized.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const tokenized = [
3535
"SplitCol",
3636
"Headline",
3737
"Div",
38+
"FixedLayout",
3839
"Progress",
3940
"DateInput",
4041
"DateRangeInput",

0 commit comments

Comments
 (0)