Skip to content

Commit 17443b3

Browse files
Add announcement bar
* add rename annoucement bar * Add link and reduce vertical padding * remove unused default config --------- Co-authored-by: Alexandra Carrillo <[email protected]>
1 parent 9de6c5b commit 17443b3

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/scss/custom.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ code:hover .code-unfocus {
830830
div[class^='theme-announcement-bar'] {
831831
font-family: var(--font-mm-euclid);
832832
font-size: 1.4rem;
833-
padding: 1rem 2rem;
833+
padding: 0.5rem 2rem;
834834
text-align: center;
835835
border-bottom: 1px solid var(--general-gray-light);
836836
background-color: var(--developer-purple-light);
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 <a href="/smart-accounts-kit">Smart Accounts Kit</a>.</strong>
21+
</div>
22+
</div>
23+
)
24+
}

0 commit comments

Comments
 (0)