Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,13 @@ const config = {
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
announcementBar: {
id: 'delegation-toolkit-rename-announcement-bar',
content: 'Delegation Toolkit is now renamed to Smart Accounts Kit.',
backgroundColor: '#eac2ff',
textColor: '#0a0a0a',
isCloseable: false,
},
metadata: [
{
name: 'keywords',
Expand Down
24 changes: 24 additions & 0 deletions src/theme/AnnouncementBar/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react'
import { useLocation } from '@docusaurus/router'

export default function AnnouncementBar(): JSX.Element | null {
const location = useLocation()

// Show on smart-accounts-kit paths or main/homepage
const isSmartAccountsKitPath = location.pathname.includes('/smart-accounts-kit')
const isMainPath = location.pathname === '/'

const isValidPath = isSmartAccountsKitPath || isMainPath

if (!isValidPath) {
return null
}

return (
<div className="theme-announcement-bar" role="banner" data-announcement-bar="true">
<div style={{ textAlign: 'center' }}>
<strong>Delegation Toolkit is now renamed to Smart Accounts Kit.</strong>
</div>
</div>
)
}
Loading