Skip to content

Commit

Permalink
fix: update redundant type export
Browse files Browse the repository at this point in the history
  • Loading branch information
jordankoschei-okta committed Jul 22, 2024
1 parent af78af3 commit f7b20d1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
densityValues,
} from "./constants";
import {
Layout,
DataLayout,
UniversalProps,
ViewProps,
TableState,
Expand All @@ -47,7 +47,7 @@ import {
} from "../../OdysseyDesignTokensContext";
import styled from "@emotion/styled";

export type DataViewProps = UniversalProps & ViewProps<Layout>;
export type DataViewProps = UniversalProps & ViewProps<DataLayout>;

const DataViewContainer = styled("div", {
shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
Expand Down Expand Up @@ -100,7 +100,7 @@ const DataView = ({
const odysseyDesignTokens = useOdysseyDesignTokens();
const { t } = useTranslation();

const [currentLayout, setCurrentLayout] = useState<Layout>(
const [currentLayout, setCurrentLayout] = useState<DataLayout>(
initialLayout ?? availableLayouts[0],
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
import { Dispatch, memo, useCallback, SetStateAction, useMemo } from "react";
import { useTranslation } from "react-i18next";

import { AvailableLayouts, Layout } from "./componentTypes";
import { AvailableLayouts, DataLayout } from "./componentTypes";
import { MenuButton } from "../../MenuButton";
import { MenuItem } from "../../MenuItem";

export type LayoutSwitcherProps = {
availableLayouts: AvailableLayouts;
currentLayout: Layout;
setCurrentLayout: Dispatch<SetStateAction<Layout>>;
currentLayout: DataLayout;
setCurrentLayout: Dispatch<SetStateAction<DataLayout>>;
};

const LayoutSwitcher = ({
Expand All @@ -31,15 +31,15 @@ const LayoutSwitcher = ({
const { t } = useTranslation();

const changeLayout = useCallback(
(value: Layout) => {
(value: DataLayout) => {
setCurrentLayout(value);
},
[setCurrentLayout],
);

const memoizedMenuItems = useMemo(
() =>
availableLayouts.map((value: Layout) => ({
availableLayouts.map((value: DataLayout) => ({
value,
onClick: () => changeLayout(value),
label: t(`dataview.layout.${value}`),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ import { paginationTypeValues } from "../DataTablePagination";
import { ReactNode } from "react";
import { StackCardProps } from "./StackCard";

export type Layout = (typeof availableLayouts)[number];
export type DataLayout = (typeof availableLayouts)[number];
export type StackLayout = (typeof availableStackLayouts)[number];

export type AvailableLayouts = Layout[];
export type AvailableLayouts = DataLayout[];
export type AvailableStackLayouts = StackLayout[];

export type UniversalProps = {
Expand Down Expand Up @@ -97,7 +97,7 @@ export type StackProps = {
rowActionMenuItems?: DataTableRowActionsProps["rowActionMenuItems"];
};

export type ViewProps<L extends Layout> = {
export type ViewProps<L extends DataLayout> = {
availableLayouts?: L[];
initialLayout?: L;
stackOptions?: StackProps;
Expand Down

0 comments on commit f7b20d1

Please sign in to comment.