Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit 7eb7ea0

Browse files
authored
Add DShop Banner (#4475)
* Add DShop Banner * Update text
1 parent f99ae6d commit 7eb7ea0

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import React, { useState } from 'react'
2+
3+
const DShopBanner = () => {
4+
const [expanded, setExpanded] = useState()
5+
6+
const toggleExpand = () => setExpanded(!expanded)
7+
8+
return (
9+
<div
10+
className={`dshop-banner${expanded ? ' expanded' : ''}`}
11+
onClick={toggleExpand}
12+
>
13+
<div className="container">
14+
<div className="wrapper">
15+
<div className="title-text">
16+
A new version of the Origin Marketplace is coming!
17+
</div>
18+
<div className="more-text">
19+
All feedback and bug fixes will be applied to the next version. We
20+
recommend Origin Dshop as an alternative for sellers interested in
21+
decentralized commerce.
22+
</div>
23+
</div>
24+
{expanded ? (
25+
<a
26+
href="https://originprotocol.com/dshop"
27+
className="btn btn-link"
28+
target="_blank"
29+
rel="noreferrer noopener"
30+
>
31+
Try Dshop
32+
</a>
33+
) : (
34+
<div className="btn btn-link">Learn more</div>
35+
)}
36+
</div>
37+
</div>
38+
)
39+
}
40+
41+
export default DShopBanner
42+
43+
require('react-styl')(`
44+
.dshop-banner
45+
background-color: var(--dark)
46+
color: var(--white)
47+
padding: 0.875rem 0
48+
font-size: 0.875rem
49+
cursor: pointer
50+
51+
.container
52+
display: flex
53+
justify-content: space-between
54+
align-items: center
55+
56+
.btn.btn-link
57+
margin: 0
58+
padding: 0
59+
font-size: 0.875rem
60+
61+
.title-text
62+
font-weight: 700
63+
64+
.more-text
65+
height: 0px
66+
opacity: 0
67+
margin: 0
68+
transition: opacity 0.3s ease, margin 0.3s ease, height 0s linear 0.3s
69+
70+
&.expanded .more-text
71+
margin-top: 0.5rem
72+
height: auto
73+
opacity: 1
74+
75+
@media (max-width: 767.98px)
76+
.dshop-banner
77+
.container
78+
flex-direction: column
79+
text-align: center
80+
81+
.btn.btn-link
82+
margin-top: 0.5rem
83+
`)

dapps/marketplace/src/pages/App.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import { applyConfiguration } from 'utils/marketplaceCreator'
4242
import Sentry from 'utils/sentry'
4343
import CurrencyContext from 'constants/CurrencyContext'
4444
import { setReferralCode } from 'utils/growthTools'
45+
import DShopBanner from 'components/DShopBanner'
4546

4647
class App extends Component {
4748
state = {
@@ -122,6 +123,7 @@ class App extends Component {
122123
{isTestBuild ? (
123124
<div className="test-build-badge">TEST BUILD</div>
124125
) : null}
126+
<DShopBanner />
125127
{!hideNavbar && (
126128
<Nav
127129
onShowHelp={() => window.openZendeskChat()}

0 commit comments

Comments
 (0)