Skip to content

Commit

Permalink
Rebrand banner in Desktop App. Closes #2004 (#2007)
Browse files Browse the repository at this point in the history
* new link to blog

* fix lint

* change close icon to white and remove boldface

---------

Co-authored-by: patrickwoodhead <patrick.woodhead@protocol.ai>
Co-authored-by: Julian Gruber <julian@juliangruber.com>
  • Loading branch information
3 people authored Jan 21, 2025
1 parent e928313 commit b0a8ec9
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const allowedURLs = [
'https://filstation.app/',
'https://github.com/filecoin-station/spark',
'https://beryx.io',
'https://pl-strflt.notion.site/Station-Terms-Conditions-e97da76bb89f49e280c2897aebe4c41f?pvs=4'
'https://pl-strflt.notion.site/Station-Terms-Conditions-e97da76bb89f49e280c2897aebe4c41f?pvs=4',
'https://checker.network',
'https://blog.checker.network/posts/why-web3-needs-the-checker-network'
].map(str => new URL(str))

const allowedURLsRegEx = [
Expand Down
2 changes: 2 additions & 0 deletions renderer/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import Sidebar from 'src/components/Sidebar'
import UpdateBanner from 'src/components/UpdateBanner'
import WalletWidget from 'src/components/WalletWidget'
import DraggableArea from 'src/components/DraggableArea'
import RebrandBanner from 'src/components/RebrandBanner'

const Layout = ({ children }: {children: ReactNode}) => {
return (
<div className='h-screen w-screen overflow-x-hidden flex relative app-bg'>
<DraggableArea />
<Sidebar />
<RebrandBanner />
<WalletWidget />
<div className='w-full flex flex-wrap justify-end absolute'>
<UpdateBanner />
Expand Down
36 changes: 36 additions & 0 deletions renderer/src/components/RebrandBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import Text from './Text'
import { useState } from 'react'
import CloseIcon from 'src/assets/img/icons/close.svg?react'
import { openExternalURL } from 'src/lib/station-config'
import { useLocation } from 'react-router'
import { ROUTES } from 'src/lib/routes'

const RebrandBanner = () => {
const { pathname } = useLocation()
const [visible, setVisible] = useState<boolean>(true)

if (!visible) {
return null
}

if (pathname === ROUTES.wallet) {
return null
}

return (
<div className='absolute top-0 left-0 pl-28 pt-6 flex'>
<div className='bg-primary ml-1 p-6 pr-12 left-40 flex gap-5 rounded-lg'>
<Text font='mono' size='xs' className="text-white">🚨 Filecoin Station is becoming the Checker Network. <button onClick={() => openExternalURL('https://blog.checker.network/posts/why-web3-needs-the-checker-network')}><Text font='mono' size='xs' bold className="text-white underline" >Read more</Text></button></Text>
<button
className="absolute top-8 right-2"
onClick={() => setVisible(false)}
>
<CloseIcon color="white" />
</button>
</div>

</div>
)
}

export default RebrandBanner

0 comments on commit b0a8ec9

Please sign in to comment.