-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
77 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/docusaurus-theme-classic/src/theme/Drafted/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import clsx from 'clsx'; | ||
import { | ||
ThemeClassNames, | ||
DraftedBannerTitle, | ||
DraftedBannerMessage, | ||
} from '@docusaurus/theme-common'; | ||
import Admonition from '@theme/Admonition'; | ||
import type {Props} from '@theme/Drafted'; | ||
|
||
export default function Drafted({className}: Props): JSX.Element | null { | ||
return ( | ||
<Admonition | ||
type="caution" | ||
title={<DraftedBannerTitle />} | ||
className={clsx(className, ThemeClassNames.common.draftedBanner)}> | ||
<DraftedBannerMessage /> | ||
</Admonition> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/docusaurus-theme-common/src/utils/draftedUtils.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import Translate from '@docusaurus/Translate'; | ||
|
||
export function DraftedBannerTitle(): JSX.Element { | ||
return ( | ||
<Translate | ||
id="theme.draftedContent.title" | ||
description="The drafted content banner title"> | ||
Drafted page | ||
</Translate> | ||
); | ||
} | ||
|
||
export function DraftedBannerMessage(): JSX.Element { | ||
return ( | ||
<Translate | ||
id="theme.draftedContent.message" | ||
description="The drafted content banner message"> | ||
This page is drafted and will be excluded from production build. | ||
</Translate> | ||
); | ||
} |