-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add available artwork banner to collection page
- Loading branch information
1 parent
cb2aeaa
commit 1765e20
Showing
2 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { useState } from 'react'; | ||
import { TimesSvg } from 'components'; | ||
import { ExternalLink, ExternalUrl } from 'router'; | ||
import { | ||
colors, | ||
focusOutlineCSS, | ||
getRems, | ||
media, | ||
unstyledButtonCSS, | ||
} from 'styles'; | ||
import { styled, Paragraph } from '../shared'; | ||
|
||
const AvailableArtworkBanner = () => { | ||
const [didDismiss, setDidDismiss] = useState<boolean>(false); | ||
|
||
if (didDismiss) return null; | ||
|
||
return ( | ||
<Wrapper> | ||
<Paragraph className="fs-6 m-0"> | ||
<span>For available artwork contact:</span>{' '} | ||
<ExternalLink href={ExternalUrl.JKenneth}> | ||
J. Kenneth Fine Art | ||
</ExternalLink> | ||
</Paragraph> | ||
<Dismiss onClick={() => setDidDismiss(true)} /> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
const Wrapper = styled.aside` | ||
align-items: center; | ||
background-color: #faf4f1; // shade of colors.lightRed | ||
border: 1px solid ${colors.lightRed}; | ||
border-radius: 6px; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
margin-bottom: 16px; | ||
padding: 8px; | ||
position: relative; | ||
p { | ||
display: flex; | ||
flex-direction: column; | ||
line-height: 1.5; | ||
text-align: center; | ||
${media.md` | ||
flex-direction: row; | ||
gap: 6px; | ||
`} | ||
} | ||
`; | ||
|
||
const DismissIcon = styled(TimesSvg)` | ||
height: ${getRems(20)}; | ||
`; | ||
|
||
const Dismiss = styled.button.attrs({ | ||
'aria-label': 'Dismiss banner', | ||
children: <DismissIcon />, | ||
title: 'Dismiss banner', | ||
})` | ||
${unstyledButtonCSS} | ||
color: ${colors.lightGray}; | ||
position: absolute; | ||
right: 16px; | ||
&:hover, | ||
&:focus { | ||
color: ${colors.darkGray}; | ||
} | ||
&:focus { | ||
${focusOutlineCSS} | ||
} | ||
`; | ||
|
||
export default AvailableArtworkBanner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters