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

feat: added new user menu #1256

Merged
merged 5 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
22,556 changes: 5,614 additions & 16,942 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@
"@snapshot-labs/snapshot.js": "0.5.5",
"@tanstack/react-query": "^4.29.7",
"autoprefixer": "^10.4.4",
"chalk": "^4.1.2",
"chart.js": "^3.8.2",
"classnames": "^2.3.2",
"clipboard-copy": "^4.0.1",
"core-js": "^3.21.1",
"cssnano": "^6.0.1",
"dayjs-precise-range": "^1.0.1",
"dcl-catalyst-client": "^21.5.0",
"decentraland-gatsby": "^5.75.1",
"decentraland-gatsby": "^5.86.2",
"decentraland-ui": "^4.1.0",
"discord.js": "^14.7.1",
"dompurify": "^2.3.3",
Expand All @@ -84,6 +85,7 @@
"gatsby-plugin-typescript": "^4.10.0",
"gatsby-source-filesystem": "^4.10.0",
"gatsby-transformer-sharp": "^4.10.0",
"isomorphic-fetch": "^3.0.0",
"keccak": "^3.0.1",
"lodash": "^4.17.21",
"nft.storage": "^7.1.1",
Expand Down
11 changes: 8 additions & 3 deletions src/components/Layout/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
import React from 'react'

import { useLocation } from '@reach/router'
import UserMenu, { UserMenuProps } from 'decentraland-gatsby/dist/components/User/UserMenu'
import UserInformation, { UserInformationProps } from 'decentraland-gatsby/dist/components/User/UserInformation'
import UserMenu from 'decentraland-gatsby/dist/components/User/UserMenu'
import useFeatureFlagContext from 'decentraland-gatsby/dist/context/FeatureFlag/useFeatureFlagContext'
import { Mobile, NotMobile } from 'decentraland-ui/dist/components/Media/Media'

import { FeatureFlags } from '../../utils/features'

import BurgerMenu from './BurgerMenu/BurgerMenu'

const BURGER_MENU_LOCATIONS = ['/', '/proposals/', '/transparency/', '/projects/', '/profile/']

function Navbar(props: UserMenuProps) {
function Navbar(props: UserInformationProps) {
const location = useLocation()
const showBurgerMenu = BURGER_MENU_LOCATIONS.some((burgerLocation) => burgerLocation === location.pathname)

const [ff] = useFeatureFlagContext()
return (
<>
{showBurgerMenu && (
Expand All @@ -20,7 +25,7 @@ function Navbar(props: UserMenuProps) {
</Mobile>
)}
<NotMobile>
<UserMenu {...props} />
{ff.flags[FeatureFlags.NewNavbarDropdown] ? <UserInformation {...props} /> : <UserMenu {...props} />}
</NotMobile>
</>
)
Expand Down
6 changes: 6 additions & 0 deletions src/components/Layout/Navigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
vertical-align: middle;
}

.dcl.navbar-account .ui.button.inverted {
color: white;
background-color: var(--primary);
border: none;
}

@media (min-width: 768px) {
.Navigation .dcl.tabs {
display: flex;
Expand Down
4 changes: 2 additions & 2 deletions src/entities/Committee/isDAOCommittee.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { yellow } from 'colors/safe'
import chalk from 'chalk'
import env from 'decentraland-gatsby/dist/utils/env'
import isEthereumAddress from 'validator/lib/isEthereumAddress'

Expand All @@ -9,7 +9,7 @@ export const COMMITTEE_ADDRESSES = (env('COMMITTEE_ADDRESSES', '') || '')

const committeeAddresses = new Set(COMMITTEE_ADDRESSES)

committeeAddresses.forEach((address) => console.log('committee address:', yellow(address)))
committeeAddresses.forEach((address) => console.log('committee address:', chalk.yellow(address)))

export default function isDAOCommittee(user?: string | null | undefined) {
if (!user) {
Expand Down
4 changes: 2 additions & 2 deletions src/entities/Debug/isDebugAddress.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { magenta } from 'colors/safe'
import chalk from 'chalk'
import env from 'decentraland-gatsby/dist/utils/env'
import isEthereumAddress from 'validator/lib/isEthereumAddress'

Expand All @@ -9,7 +9,7 @@ export const DEBUG_ADDRESSES = (env('DEBUG_ADDRESSES', '') || '')

const debugAddresses = new Set(DEBUG_ADDRESSES)

debugAddresses.forEach((address) => console.log('debug address:', magenta(address)))
debugAddresses.forEach((address) => console.log('debug address:', chalk.magenta(address)))

export default function isDebugAddress(address: string | undefined) {
return address && address.length > 0 && debugAddresses.has(address.toLowerCase())
Expand Down
1 change: 1 addition & 0 deletions src/utils/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export enum FeatureFlags {
// Polygon = 'dao-enabled-polygon',
Ens = 'dao-enabled-ens',
Delegation = 'dao-enabled-delegation',
NewNavbarDropdown = 'dapps-new-navbar-dropdown',
}
Loading