Skip to content

Commit

Permalink
chore(react): rename interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
savindi7 committed Feb 14, 2023
1 parent 8afb14e commit 59365a5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import IconButton from '../IconButton';
import Link from '../Link';
import Toolbar from '../Toolbar';
import Typography from '../Typography';
import UserDropdownMenu, {ModeListInterface, UserTemplate} from '../UserDropdownMenu';
import UserDropdownMenu, {ModeList, UserTemplate} from '../UserDropdownMenu';

export interface HeaderProps extends AppBarProps {
/**
Expand All @@ -51,7 +51,7 @@ export interface HeaderProps extends AppBarProps {
/**
* List of modes.
*/
modes?: ModeListInterface[];
modes?: ModeList[];
/**
* Function to handle left navigation bar button toggle.
*/
Expand Down
10 changes: 5 additions & 5 deletions packages/react/src/components/MenuItem/MenuItem.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export const meta = {
<Meta title={meta.title} component={meta.component} />

export const Template = (args) => {
return (
<Menu open={true} role="menu">
<MenuItem {...args} />
</Menu>
)
return (
<Menu open={true} role="menu">
<MenuItem {...args} />
</Menu>
)
};

# Menu Item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export interface UserDropdownMenuProps extends Omit<MenuProps, 'open' | 'anchorE
/**
* Array list of modes
*/
modes?: ModeListInterface[];
modes?: ModeList[];
/**
* Heading of the modes list.
*/
Expand All @@ -78,7 +78,7 @@ export interface UserDropdownMenuProps extends Omit<MenuProps, 'open' | 'anchorE
user?: UserTemplate;
}

export interface ModeListInterface {
export interface ModeList {
/**
* Icon of the mode.
*/
Expand Down Expand Up @@ -191,7 +191,7 @@ const UserDropdownMenu: FC<UserDropdownMenuProps> & WithWrapperProps = (
<>
<Divider />
<ListSubheader>{modesHeading}</ListSubheader>
{modes?.map((theme: ModeListInterface) => {
{modes?.map((theme: ModeList) => {
const {name, icon} = theme;
return (
<MenuItem className="dropdown-menu-item" key={name} onClick={(): void => handleModeChange(name)}>
Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/components/UserDropdownMenu/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
*/

export {default} from './UserDropdownMenu';
export {UserDropdownMenuProps} from './UserDropdownMenu';
export {ModeListInterface} from './UserDropdownMenu';
export {UserTemplate} from './UserDropdownMenu';
export type {UserDropdownMenuProps} from './UserDropdownMenu';
export type {ModeList} from './UserDropdownMenu';
export type {UserTemplate} from './UserDropdownMenu';

0 comments on commit 59365a5

Please sign in to comment.