Skip to content

Commit

Permalink
removes paywall in /create for local network set in env.json
Browse files Browse the repository at this point in the history
  • Loading branch information
edsonayllon committed Dec 13, 2019
1 parent eda6bd5 commit 595316b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
12 changes: 6 additions & 6 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Kickback</title>


</head>

<body>
Expand Down Expand Up @@ -84,9 +82,11 @@
const environment = "%NODE_ENV%";
const networkId = environment === "production" ? 1 : 4;

// Kovan is included, but currently only Rinkeby and Mainnet is unsupported with paywall
// tokens entered first to last are displayed right to left in paywall modal
// NOTE: Replace Mainnet keys with keys Kickback owns
/*
Kovan is included, but currently only Rinkeby and Mainnet is supported with paywall
tokens entered first to last are displayed right to left in paywall modal
NOTE: Replace Mainnet keys with keys Kickback owns
*/
const locks = {
1: {
"enter-key-address-here": {
Expand Down Expand Up @@ -120,7 +120,7 @@
icon: "https://kickback.events/card.png",
callToAction: {
default:
'Select a membership to access page',
'Select a membership to access page.',
},
}
</script>
Expand Down
8 changes: 6 additions & 2 deletions src/components/Header/HamburgerMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ function HamburgerMenu({ isMenuOpen }) {
<Link to="/pricing">Pricing</Link>
{links.map(l =>
isExternal(l.url) ? (
<Link to={l.href}>{l.label}</Link>
<Link to={l.href} key={l.href}>
{l.label}
</Link>
) : (
<a href={l.href}>{l.label}</a>
<a href={l.href} key={l.href}>
{l.label}
</a>
)
)}
</HamburgerMenuContainer>
Expand Down
22 changes: 11 additions & 11 deletions src/routes/CreateEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import DefaultTextInput from '../components/Forms/TextInput'
import Label from '../components/Forms/Label'
import DefaultButton from '../components/Forms/Button'
import Loader from '../components/Loader'

import { ENV } from '../config'
import PartyForm from '../components/SingleEvent/Admin/PartyForm'
import { CREATE_PENDING_PARTY } from '../graphql/mutations'

Expand Down Expand Up @@ -38,7 +38,7 @@ const UnlockedLogo = styled('a')`
font-weight: 800;
`

function Create() {
export default function Create() {
const [password, setPassword] = useState('')
const [locked, setLocked] = useState('pending')
let history = useHistory()
Expand Down Expand Up @@ -66,12 +66,18 @@ function Create() {
}

useEffect(() => {
window.addEventListener('unlockProtocol', unlockHandler)
console.log(ENV)
if (ENV !== 'local') {
window.addEventListener('unlockProtocol', unlockHandler)
} else {
setLocked('unlocked')
}
}, [])

useEffect(() => {
return () => {
window.removeEventListener('unlockProtocol', unlockHandler)
if (ENV !== 'local')
window.removeEventListener('unlockProtocol', unlockHandler)
}
}, [])

Expand Down Expand Up @@ -116,16 +122,10 @@ function Create() {
</UnlockCredit>
</LockedContainer>
),
pending: (
<div>
<Loader />
</div>
),
pending: <Loader />,
default: <div>Please enable Javascript</div>
}[locked || locked['default']]
}
</CreateContainer>
)
}

export default Create

0 comments on commit 595316b

Please sign in to comment.