Skip to content

Commit

Permalink
Powered by Joystream
Browse files Browse the repository at this point in the history
  • Loading branch information
WRadoslaw committed Mar 20, 2024
1 parent f9e6643 commit a6f2936
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,22 @@ export const Header = styled.header`

export const LogoLink = styled(Link)`
display: flex;
gap: ${sizes(2)};
width: fit-content;
align-items: center;
text-decoration: none;
/* increase the clickable area */
padding: 16px;
margin: -16px;
h4 {
white-space: nowrap;
}
`

export const LogoDivider = styled.div`
background-color: ${cVar('colorBackgroundStrongAlpha')};
width: 1px;
height: 24px;
`
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { FC, PropsWithChildren, ReactNode } from 'react'

import { AppLogo } from '@/components/AppLogo'
import { Text } from '@/components/Text'
import { useMediaMatch } from '@/hooks/useMediaMatch'

import { Header, LogoLink } from './TopbarBase.styles'
import { Header, LogoDivider, LogoLink } from './TopbarBase.styles'

export type TopbarBaseProps = PropsWithChildren<{
fullLogoNode: ReactNode
Expand All @@ -14,12 +15,20 @@ export type TopbarBaseProps = PropsWithChildren<{

export const TopbarBase: FC<TopbarBaseProps> = ({ children, fullLogoNode, logoLinkUrl, noLogo, className }) => {
const mdMatch = useMediaMatch('md')
const smMatch = useMediaMatch('sm')
const xsMatch = useMediaMatch('xs')

return (
<Header className={className} data-scroll-lock-fill-gap>
{!noLogo && (
<LogoLink to={logoLinkUrl}>
{mdMatch ? fullLogoNode : <AppLogo variant="short" height={32} width={undefined} />}
{xsMatch && <LogoDivider />}
{xsMatch && (
<Text variant="h200" as="h4" color="colorTextMuted" margin={{ right: 2 }}>
{smMatch ? 'Powered' : ''} by Joystream
</Text>
)}
</LogoLink>
)}
{children}
Expand Down

0 comments on commit a6f2936

Please sign in to comment.