Skip to content

Commit

Permalink
refactor(theme): nest theme icons under subfolder @theme/Icon/* (#7740)
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber authored Jul 8, 2022
1 parent c3ff131 commit d3d22d3
Show file tree
Hide file tree
Showing 28 changed files with 39 additions and 39 deletions.
10 changes: 5 additions & 5 deletions packages/docusaurus-theme-classic/src/getSwizzleConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,35 +93,35 @@ export default function getSwizzleConfig(): SwizzleConfig {
},
description: 'The footer logo',
},
IconArrow: {
'Icon/Arrow': {
actions: {
eject: 'safe',
wrap: 'safe',
},
description: 'The arrow icon component',
},
IconDarkMode: {
'Icon/DarkMode': {
actions: {
eject: 'safe',
wrap: 'safe',
},
description: 'The dark mode icon component.',
},
IconEdit: {
'Icon/Edit': {
actions: {
eject: 'safe',
wrap: 'safe',
},
description: 'The edit icon component',
},
IconLightMode: {
'Icon/LightMode': {
actions: {
eject: 'safe',
wrap: 'safe',
},
description: 'The light mode icon component.',
},
IconMenu: {
'Icon/Menu': {
actions: {
eject: 'safe',
wrap: 'safe',
Expand Down
18 changes: 9 additions & 9 deletions packages/docusaurus-theme-classic/src/theme-classic.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1256,71 +1256,71 @@ declare module '@theme/Logo' {
export default function Logo(props: Props): JSX.Element;
}

declare module '@theme/IconArrow' {
declare module '@theme/Icon/Arrow' {
import type {ComponentProps} from 'react';

export interface Props extends ComponentProps<'svg'> {}

export default function IconArrow(props: Props): JSX.Element;
}

declare module '@theme/IconDarkMode' {
declare module '@theme/Icon/DarkMode' {
import type {ComponentProps} from 'react';

export interface Props extends ComponentProps<'svg'> {}

export default function IconDarkMode(props: Props): JSX.Element;
}

declare module '@theme/IconEdit' {
declare module '@theme/Icon/Edit' {
import type {ComponentProps} from 'react';

export interface Props extends ComponentProps<'svg'> {}

export default function IconEdit(props: Props): JSX.Element;
}

declare module '@theme/IconHome' {
declare module '@theme/Icon/Home' {
import type {ComponentProps} from 'react';

export interface Props extends ComponentProps<'svg'> {}

export default function IconHome(props: Props): JSX.Element;
}

declare module '@theme/IconLightMode' {
declare module '@theme/Icon/LightMode' {
import type {ComponentProps} from 'react';

export interface Props extends ComponentProps<'svg'> {}

export default function IconLightMode(props: Props): JSX.Element;
}

declare module '@theme/IconMenu' {
declare module '@theme/Icon/Menu' {
import type {ComponentProps} from 'react';

export interface Props extends ComponentProps<'svg'> {}

export default function IconMenu(props: Props): JSX.Element;
}

declare module '@theme/IconClose' {
declare module '@theme/Icon/Close' {
import type {ComponentProps} from 'react';

export interface Props extends ComponentProps<'svg'> {}

export default function IconClose(props: Props): JSX.Element;
}

declare module '@theme/IconLanguage' {
declare module '@theme/Icon/Language' {
import type {ComponentProps} from 'react';

export interface Props extends ComponentProps<'svg'> {}

export default function IconLanguage(props: Props): JSX.Element;
}

declare module '@theme/IconExternalLink' {
declare module '@theme/Icon/ExternalLink' {
import type {ComponentProps} from 'react';

export interface Props extends ComponentProps<'svg'> {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import clsx from 'clsx';
import {useThemeConfig} from '@docusaurus/theme-common';
import {useAnnouncementBar} from '@docusaurus/theme-common/internal';
import {translate} from '@docusaurus/Translate';
import IconClose from '@theme/IconClose';
import IconClose from '@theme/Icon/Close';

import styles from './styles.module.css';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import React from 'react';
import clsx from 'clsx';
import useIsBrowser from '@docusaurus/useIsBrowser';
import {translate} from '@docusaurus/Translate';
import IconLightMode from '@theme/IconLightMode';
import IconDarkMode from '@theme/IconDarkMode';
import IconLightMode from '@theme/Icon/LightMode';
import IconDarkMode from '@theme/Icon/DarkMode';
import type {Props} from '@theme/ColorModeToggle';

import styles from './styles.module.css';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import Link from '@docusaurus/Link';
import useBaseUrl from '@docusaurus/useBaseUrl';
import {translate} from '@docusaurus/Translate';
import IconHome from '@theme/IconHome';
import IconHome from '@theme/Icon/Home';

import styles from './styles.module.css';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React from 'react';
import {translate} from '@docusaurus/Translate';
import IconArrow from '@theme/IconArrow';
import IconArrow from '@theme/Icon/Arrow';
import type {Props} from '@theme/DocPage/Layout/Sidebar/ExpandButton';

import styles from './styles.module.css';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import clsx from 'clsx';
import {translate} from '@docusaurus/Translate';
import IconArrow from '@theme/IconArrow';
import IconArrow from '@theme/Icon/Arrow';
import type {Props} from '@theme/DocSidebar/Desktop/CollapseButton';

import styles from './styles.module.css';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {ThemeClassNames} from '@docusaurus/theme-common';
import {isActiveSidebarItem} from '@docusaurus/theme-common/internal';
import Link from '@docusaurus/Link';
import isInternalUrl from '@docusaurus/isInternalUrl';
import IconExternalLink from '@theme/IconExternalLink';
import IconExternalLink from '@theme/Icon/ExternalLink';
import type {Props} from '@theme/DocSidebarItem/Link';

import styles from './styles.module.css';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import Translate from '@docusaurus/Translate';
import {ThemeClassNames} from '@docusaurus/theme-common';
import IconEdit from '@theme/IconEdit';
import IconEdit from '@theme/Icon/Edit';
import type {Props} from '@theme/EditThisPage';

export default function EditThisPage({editUrl}: Props): JSX.Element {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react';
import Link from '@docusaurus/Link';
import useBaseUrl from '@docusaurus/useBaseUrl';
import isInternalUrl from '@docusaurus/isInternalUrl';
import IconExternalLink from '@theme/IconExternalLink';
import IconExternalLink from '@theme/Icon/ExternalLink';
import type {Props} from '@theme/Footer/LinkItem';

export default function FooterLinkItem({item}: Props): JSX.Element {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';
import type {Props} from '@theme/IconArrow';
import type {Props} from '@theme/Icon/Arrow';

export default function IconArrow(props: Props): JSX.Element {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';
import type {Props} from '@theme/IconClose';
import type {Props} from '@theme/Icon/Close';

export default function IconClose({
width = 21,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';
import type {Props} from '@theme/IconDarkMode';
import type {Props} from '@theme/Icon/DarkMode';

export default function IconDarkMode(props: Props): JSX.Element {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React from 'react';
import clsx from 'clsx';
import type {Props} from '@theme/IconEdit';
import type {Props} from '@theme/Icon/Edit';

import styles from './styles.module.css';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';
import type {Props} from '@theme/IconExternalLink';
import type {Props} from '@theme/Icon/ExternalLink';

import styles from './styles.module.css';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';
import type {Props} from '@theme/IconHome';
import type {Props} from '@theme/Icon/Home';

export default function IconHome(props: Props): JSX.Element {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';
import type {Props} from '@theme/IconLanguage';
import type {Props} from '@theme/Icon/Language';

export default function IconLanguage({
width = 20,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';
import type {Props} from '@theme/IconLightMode';
import type {Props} from '@theme/Icon/LightMode';

export default function IconLightMode(props: Props): JSX.Element {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';
import type {Props} from '@theme/IconMenu';
import type {Props} from '@theme/Icon/Menu';

export default function IconMenu({
width = 30,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
import NavbarColorModeToggle from '@theme/Navbar/ColorModeToggle';
import IconClose from '@theme/IconClose';
import IconClose from '@theme/Icon/Close';
import NavbarLogo from '@theme/Navbar/Logo';

function CloseButton() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React from 'react';
import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
import IconMenu from '@theme/IconMenu';
import IconMenu from '@theme/Icon/Menu';

export default function MobileSidebarToggle(): JSX.Element {
const mobileSidebar = useNavbarMobileSidebar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import {useAlternatePageUtils} from '@docusaurus/theme-common/internal';
import {translate} from '@docusaurus/Translate';
import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem';
import IconLanguage from '@theme/IconLanguage';
import IconLanguage from '@theme/Icon/Language';
import type {LinkLikeNavbarItemProps} from '@theme/NavbarItem';
import type {Props} from '@theme/NavbarItem/LocaleDropdownNavbarItem';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Link from '@docusaurus/Link';
import useBaseUrl from '@docusaurus/useBaseUrl';
import isInternalUrl from '@docusaurus/isInternalUrl';
import {isRegexpStringMatch} from '@docusaurus/theme-common';
import IconExternalLink from '@theme/IconExternalLink';
import IconExternalLink from '@theme/Icon/ExternalLink';
import type {Props} from '@theme/NavbarItem/NavbarNavLink';

export default function NavbarNavLink({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React, {useState} from 'react';
import clsx from 'clsx';
import {useBlogPost} from '@docusaurus/theme-common/internal';
import BlogPostItemHeaderAuthor from '@theme/BlogPostItem/Header/Author';
import IconExpand from '@theme/IconExpand';
import IconExpand from '@theme/Icon/Expand';
import type {Props} from '@theme/BlogPostItem/Header/Authors';

import styles from './styles.module.css';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React from 'react';

import type {Props} from '@theme/IconExpand';
import type {Props} from '@theme/Icon/Expand';

export default function IconExpand({expanded, ...props}: Props): JSX.Element {
if (expanded) {
Expand Down
2 changes: 1 addition & 1 deletion website/src/plugins/changelog/theme/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ declare module '@theme/ChangelogItem/Header/Authors';
declare module '@theme/ChangelogList';
declare module '@theme/ChangelogList/Header';

declare module '@theme/IconExpand' {
declare module '@theme/Icon/Expand' {
import type {ComponentProps} from 'react';

export interface Props extends ComponentProps<'svg'> {
Expand Down

0 comments on commit d3d22d3

Please sign in to comment.