Skip to content

Commit

Permalink
Added 'successTip' admonition with green background color.
Browse files Browse the repository at this point in the history
  • Loading branch information
shimkiv committed Jun 5, 2024
1 parent 9a0a02a commit 015cf5e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/welcome.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import HomepageFeatures from "@site/src/components/features/HomepageFeatures";

# Welcome

:::caution Berkeley Mainnet release has landed
:::successTip Berkeley Mainnet release has landed

Please make sure to upgrade your mina nodes to **3.0.0** ([Release notes](https://github.com/MinaProtocol/mina/releases/tag/3.0.0))
[See instructions on how to upgrade your Mina node](/berkeley-upgrade/requirements).
Expand Down
1 change: 1 addition & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ module.exports = {
'caution',
'danger',
'experimental',
'successTip',
],
},
},
Expand Down
1 change: 1 addition & 0 deletions src/scss/utilities/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ $mina-white: #ffffff;
$mina-error: #e93939;
$mina-purple: #5362c8;
$mina-lavender: #cab2ff;
$mina-green: green;
18 changes: 16 additions & 2 deletions src/theme/Admonition/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { type ReactNode } from 'react';
import Translate from '@docusaurus/Translate';
import type { Props } from '@theme/Admonition';
import React, { type ReactNode } from 'react';

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

Expand Down Expand Up @@ -90,7 +90,6 @@ const AdmonitionConfigs: Record<Props['type'], AdmonitionConfig> = {
</Translate>
),
},

note: {
infimaClassName: 'secondary',
iconComponent: NoteIcon,
Expand Down Expand Up @@ -151,6 +150,18 @@ const AdmonitionConfigs: Record<Props['type'], AdmonitionConfig> = {
</Translate>
),
},
successTip: {
infimaClassName: 'green',
iconComponent: NoteIcon,
label: (
<Translate
id="theme.admonition.note"
description="The default label used for the SuccessTip admonition (:::successTip)"
>
successTip
</Translate>
),
},
};

// Legacy aliases, undocumented but kept for retro-compatibility
Expand All @@ -159,6 +170,7 @@ const aliases = {
important: 'info',
success: 'tip',
warning: 'danger',
successTip: 'successTip',
} as const;

function getAdmonitionConfig(unsafeType: string): AdmonitionConfig {
Expand Down Expand Up @@ -230,6 +242,8 @@ export default function Admonition(props: Props): JSX.Element {
admonitionStyles = styles.admonitionDanger;
} else if (type === 'experimental') {
admonitionStyles = styles.admonitionExperimental;
} else if (type === 'successTip') {
admonitionStyles = styles.admonitionSuccessTip;
}

return (
Expand Down
4 changes: 4 additions & 0 deletions src/theme/Admonition/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
@include admonition($backgroundColor: variables.$mina-orange);
}

.admonitionSuccessTip {
@include admonition($backgroundColor: variables.$mina-green);
}

.admonitionHeading code {
text-transform: none;
}
Expand Down

0 comments on commit 015cf5e

Please sign in to comment.