Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use the Community Bubble instead of the custom Discord bubble #453

Merged
merged 10 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Use new navbar
  • Loading branch information
LautaroPetaccio committed Jan 19, 2024
commit aed05e0b00c4414fd74b3c496846c6c3e895233c
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@decentraland" />
<meta name="twitter:creator" content="@decentraland" />
<meta property="og:url" content="https://play.decentraland.org/" />
<meta property="og:url" content="https://decentraland.org/play" />
<meta property="og:title" content="Decentraland" />
<meta
property="og:description"
Expand Down
898 changes: 752 additions & 146 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
]
},
"dependencies": {
"@0xsquid/sdk": "^2.8.9",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this being used?

"@0xsquid/squid-types": "^0.1.51",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be on dev dependencies

"@dcl/explorer": "^1.0.158859-20240110140315.commit-19935b0",
"@dcl/feature-flags": "^1.2.0",
"@dcl/kernel-interface": "^2.0.0-20230512115658.commit-b582e05",
Expand All @@ -43,7 +45,7 @@
"@sentry/browser": "^7.91.0",
"@sentry/tracing": "^7.91.0",
"decentraland-connect": "^5.5.0",
"decentraland-dapps": "^16.31.3",
"decentraland-dapps": "^17.0.0",
"decentraland-ui": "^5.2.0",
"detect-browser": "^5.2.0",
"dotenv": "^16.3.1",
Expand Down Expand Up @@ -77,4 +79,4 @@
"typescript": "^4.5.5"
},
"homepage": ""
}
}
6 changes: 5 additions & 1 deletion src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ const App: React.FC<AppProps> = (props) => {
}

if (small || mobile) {
return <MobileContainer />
return (
<WalletProvider>
<MobileContainer />
</WalletProvider>
)
}

if (props.error) {
Expand Down
8 changes: 0 additions & 8 deletions src/components/common/Layout/Navbar.css

This file was deleted.

38 changes: 0 additions & 38 deletions src/components/common/Layout/Navbar.tsx

This file was deleted.

31 changes: 31 additions & 0 deletions src/components/common/Layout/Navbar/Navbar.container.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { connect } from 'react-redux'
import { Dispatch } from 'redux'
import {
isConnected,
isConnecting,
getAddress,
getManaBalances
} from 'decentraland-dapps/dist/modules/wallet/selectors'
import { disconnectWallet } from 'decentraland-dapps/dist/modules/wallet/actions'
import { getData as getProfiles } from 'decentraland-dapps/dist/modules/profile/selectors'
// import { MapStateProps, MapDispatchProps } from './Navbar.types'
import { StoreType } from '../../../../state/redux'
import Navbar from './Navbar'

const mapState = (state: StoreType): any => {
const address = getAddress(state)
const profile = address ? getProfiles(state)[address] : undefined
return {
avatar: profile ? profile.avatars[0] : undefined,
manaBalances: getManaBalances(state),
address: getAddress(state),
isSignedIn: isConnected(state),
isSigningIn: isConnecting(state)
}
}

const mapDispatch = (dispatch: Dispatch): any => ({
onSignOut: () => dispatch(disconnectWallet())
})

export default connect(mapState, mapDispatch)(Navbar) as any
25 changes: 25 additions & 0 deletions src/components/common/Layout/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { useCallback } from 'react'
import { Navbar as Base } from 'decentraland-ui/dist/components/Navbar/Navbar'

const Navbar = (props: any) => {
const handleSignIn = useCallback(() => {
const site = /^decentraland.(zone|org|today)$/.test(window.location.host) ? '/play' : ''
window.location.replace(`/auth/login?redirectTo=${site}`)
}, [])

const handleSignOut = useCallback(() => {
props.onSignOut()
}, [props.onSignOut])

return (
<Base
onClickSignIn={handleSignIn}
onClickSignOut={handleSignOut}
onClickSignOut={handleSignOut}
activePage="play"
{...props}
/>
)
}

export default Navbar
2 changes: 2 additions & 0 deletions src/components/common/Layout/Navbar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import Navbar from './Navbar.container'
export default Navbar
6 changes: 3 additions & 3 deletions src/components/common/MobileContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect } from 'react'
import { Button } from 'decentraland-ui/dist/components/Button/Button'
import { useMobileResize } from '../../integration/mobile'
import { Navbar } from './Layout/Navbar'
import Navbar from './Layout/Navbar'
import { track } from '../../utils/tracking'
import './MobileContainer.css'

Expand All @@ -14,13 +14,13 @@ export default React.memo(function MobileContainer() {

return (
<div className="MobileContainer">
<Navbar rightMenu={false} />
<Navbar />
<main className="MobileHero">
<div>
<h1>Play Decentraland on Desktop</h1>
<p>Decentraland is not available on mobile.</p>
<p>
Visit <strong>play.decentraland.org</strong> in your desktop browser to access Decentraland.
Visit <strong>decentraland.org/play</strong> in your desktop browser to access Decentraland.
</p>
</div>
</main>
Expand Down