Skip to content

Commit 79c21ea

Browse files
add rename annoucement bar
1 parent 826843e commit 79c21ea

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

docusaurus.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,13 @@ const config = {
483483
themeConfig:
484484
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
485485
({
486+
announcementBar: {
487+
id: 'delegation-toolkit-rename-announcement-bar',
488+
content: 'Delegation Toolkit is now renamed to Smart Accounts Kit.',
489+
backgroundColor: '#eac2ff',
490+
textColor: '#0a0a0a',
491+
isCloseable: false,
492+
},
486493
metadata: [
487494
{
488495
name: 'keywords',
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from 'react'
2+
import { useLocation } from '@docusaurus/router'
3+
4+
export default function AnnouncementBar(): JSX.Element | null {
5+
const location = useLocation()
6+
7+
// Show on smart-accounts-kit paths or main/homepage
8+
const isSmartAccountsKitPath = location.pathname.includes('/smart-accounts-kit')
9+
const isMainPath = location.pathname === '/'
10+
11+
const isValidPath = isSmartAccountsKitPath || isMainPath
12+
13+
if (!isValidPath) {
14+
return null
15+
}
16+
17+
return (
18+
<div className="theme-announcement-bar" role="banner" data-announcement-bar="true">
19+
<div style={{ textAlign: 'center' }}>
20+
<strong>Delegation Toolkit is now renamed to Smart Accounts Kit.</strong>
21+
</div>
22+
</div>
23+
)
24+
}

0 commit comments

Comments
 (0)