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
Prev Previous commit
Next Next commit
feat: Add new Navbar
  • Loading branch information
LautaroPetaccio committed Jan 24, 2024
commit d68c4e503d2f2b530d78ba2d21c287225c18fdec
8 changes: 4 additions & 4 deletions src/components/common/Layout/Navbar/Navbar.container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
} 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 { MapStateProps, MapDispatchProps } from './Navbar.types'
import Navbar from './Navbar'

const mapState = (state: StoreType): any => {
const mapState = (state: StoreType): MapStateProps => {
const address = getAddress(state)
const profile = address ? getProfiles(state)[address] : undefined
return {
Expand All @@ -24,8 +24,8 @@ const mapState = (state: StoreType): any => {
}
}

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

export default connect(mapState, mapDispatch)(Navbar) as any
export default connect(mapState, mapDispatch)(Navbar)
10 changes: 1 addition & 9 deletions src/components/common/Layout/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@ const Navbar = (props: any) => {
props.onSignOut()
}, [props.onSignOut])

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

export default Navbar
11 changes: 11 additions & 0 deletions src/components/common/Layout/Navbar/Navbar.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Dispatch } from 'redux'
import { DisconnectWalletAction } from 'decentraland-dapps/dist/modules/wallet/actions'
import { NavbarProps } from 'decentraland-ui/dist/components/Navbar/Navbar.types'

export type Props = Pick<NavbarProps, 'avatar' | 'manaBalances' | 'address' | 'isSignedIn' | 'isSigningIn'> & {
onSignOut: () => void
}

export type MapStateProps = Pick<Props, 'avatar' | 'manaBalances' | 'address' | 'isSignedIn' | 'isSigningIn'>
export type MapDispatchProps = Pick<Props, 'onSignOut'>
export type MapDispatch = Dispatch<DisconnectWalletAction>
4 changes: 1 addition & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { defineConfig, loadEnv } from 'vite'
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill'
import react from '@vitejs/plugin-react-swc'
import basicSsl from '@vitejs/plugin-basic-ssl'
import rollupNodePolyFill from 'rollup-plugin-polyfill-node'
import mime from 'mime-types'
import fs from 'fs'
Expand All @@ -13,13 +12,12 @@ export default defineConfig(({ command, mode }) => {
return {
// depending on your application, base can also be "/"
base: '',
plugins: [react(), basicSsl()],
plugins: [react()],
define: {
'process.env': {},
global: 'globalThis'
},
server: {
https: {},
// this ensures that the browser opens upon server start
open: true,
// this sets a default port to 3000
Expand Down