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: Always show download (previously jump in), reorder navbar items, and hide social media in footer #563

Merged
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions src/components/Footer/Footer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ storiesOf('Footer', module)
<Footer isFullWidth />
</div>
))
.add('Without the social links', () => <Footer hideSocialLinks />)
34 changes: 19 additions & 15 deletions src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export type FooterProps = {
isFullscreen?: boolean
className?: string
isFullWidth?: boolean
hideSocialLinks?: boolean
}

export class Footer extends React.PureComponent<FooterProps> {
Expand Down Expand Up @@ -62,7 +63,8 @@ export class Footer extends React.PureComponent<FooterProps> {
i18n,
isFullscreen,
className,
isFullWidth
isFullWidth,
hideSocialLinks
} = this.props

let classes = 'dcl footer'
Expand Down Expand Up @@ -97,20 +99,22 @@ export class Footer extends React.PureComponent<FooterProps> {
</div>
</div>
<div className="secondary-footer">
<div className="social-links">
<a href="https://dcl.gg/discord">
<i className="social-icon discord" />
</a>
<a href="https://reddit.com/r/decentraland">
<i className="social-icon reddit" />
</a>
<a href="https://github.com/decentraland">
<i className="social-icon github" />
</a>
<a href="https://twitter.com/decentraland">
<i className="social-icon twitter" />
</a>
</div>
{!hideSocialLinks ? (
<div className="social-links">
<a href="https://dcl.gg/discord">
<i className="social-icon discord" />
</a>
<a href="https://reddit.com/r/decentraland">
<i className="social-icon reddit" />
</a>
<a href="https://github.com/decentraland">
<i className="social-icon github" />
</a>
<a href="https://twitter.com/decentraland">
<i className="social-icon twitter" />
</a>
</div>
) : null}
<div className="copyright">
© {new Date().getFullYear()} Decentraland
</div>
Expand Down
12 changes: 6 additions & 6 deletions src/components/Navbar/MainMenu/MainMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ export const MainMenu = (props: MainMenuProps) => {
title={i18n.create}
mainUrl={urls[NavbarPages.CREATE]}
/>
<MenuItem
{...menuItemProps}
section={NavbarPages.EXPLORE}
title={i18n.explore}
mainUrl={urls[NavbarPages.EXPLORE]}
/>
<MenuItem
{...menuItemProps}
section={NavbarPages.LEARN}
Expand All @@ -51,6 +45,12 @@ export const MainMenu = (props: MainMenuProps) => {
title={i18n.governance}
mainUrl={urls[NavbarPages.GOVERNANCE]}
/>
<MenuItem
{...menuItemProps}
section={NavbarPages.EXPLORE}
title={i18n.explore}
mainUrl={urls[NavbarPages.EXPLORE]}
/>
</div>
)
}
6 changes: 3 additions & 3 deletions src/components/Navbar/Navbar.defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { ChainSelectori18n } from '../ChainSelector/ChainSelector.props'
import { NavbarMenuI18nProps, NavbarSubmenuProps } from './Navbar.types'

export const navbarMainTitlesI18N = {
marketplace: 'marketplace',
marketplace: 'shop',
create: 'create',
explore: 'explore',
learn: 'learn',
governance: 'governance'
governance: 'vote',
explore: 'events'
} as NavbarMenuI18nProps

export const i18nChainSelectorDefault = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/Navbar.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export enum NavbarPages {
GOVERNANCE = 'governance'
}

export type NavbarMenuI18nProps = Record<NavbarPages, NavbarPages>
export type NavbarMenuI18nProps = Record<NavbarPages, string>

export type NavbarSubMenuItemsProps = {
column1Title?: string
Expand Down
2 changes: 1 addition & 1 deletion src/components/UserMenu/UserMenu.i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const i18n = {
account: 'Account Settings',
activity: 'Activity',
guest: 'Guest',
jumpIn: 'Jump In',
download: 'Download',
marketplaceAuthorizations: 'Marketplace Authorizations',
myAssets: 'My Assets',
myLists: 'My Lists',
Expand Down
36 changes: 17 additions & 19 deletions src/components/UserMenu/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const UserMenu = React.memo((props: UserMenuProps) => {
onClickSignIn,
onClickBalance,
onClickOpen,
onClickJumpIn,
onClickDownload,
onClickUserMenuItem,
...signInProps
} = props
Expand Down Expand Up @@ -66,26 +66,26 @@ export const UserMenu = React.memo((props: UserMenuProps) => {
}
}, [setIsOpen])

const handleClickJumpIn = useCallback(
const handleDownload = useCallback(
(event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
event.preventDefault()
onClickUserMenuItem &&
onClickUserMenuItem(event, {
type: UserMenuEventId.JUMP_IN,
type: UserMenuEventId.DOWNLOAD,
track_uuid: trackingId,
url: config.get('EXPLORER_URL')
url: config.get('DOWNLOAD_URL')
})

setTimeout(
() => {
onClickJumpIn
? onClickJumpIn(event)
: window.open(config.get('EXPLORER_URL'), '_blank', 'noopener')
onClickDownload
? onClickDownload(event)
: window.open(config.get('DOWNLOAD_URL'), '_blank', 'noopener')
},
onClickUserMenuItem ? 300 : 0
)
},
[onClickJumpIn, onClickUserMenuItem, trackingId]
[onClickDownload, onClickUserMenuItem, trackingId]
)

const handleClickSignIn = useCallback(
Expand Down Expand Up @@ -163,17 +163,15 @@ export const UserMenu = React.memo((props: UserMenuProps) => {
{i18n.signIn}
</Button>
) : null}
{isSignedIn && (
<Button
className="user-menu__jump-in"
primary
onClick={handleClickJumpIn}
as={'a'}
href={config.get('EXPLORER_URL')}
>
{i18n.jumpIn}
</Button>
)}
<Button
className="user-menu__jump-in"
primary
onClick={handleDownload}
as={'a'}
href={config.get('DOWNLOAD_URL')}
>
{i18n.download}
</Button>
kevinszuchet marked this conversation as resolved.
Show resolved Hide resolved
</>
)}
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/components/UserMenu/UserMenu.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type UserMenuProps = Omit<
event: React.MouseEvent<HTMLElement, MouseEvent>,
trackingId: string
) => void
onClickJumpIn?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void
onClickDownload?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void
}

export type UserMenuI18N = Record<
Expand All @@ -26,7 +26,7 @@ export type UserMenuI18N = Record<
| 'signOut'
| 'guest'
| 'marketplaceAuthorizations'
| 'jumpIn',
| 'download',
string
>

Expand All @@ -39,6 +39,6 @@ export enum UserMenuEventId {
SIGN_OUT = 'sign_out',
GUEST = 'guest',
MARKETPLACE_AUTHORIZATIONS = 'marketplace_authorizations',
JUMP_IN = 'jump_in',
DOWNLOAD = 'download',
BALANCE = 'balance'
}
3 changes: 2 additions & 1 deletion src/config/env/dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@
"DOCS_CONTRIBUTOR_URL": "https://docs.decentraland.org/contributor/",
"DOCS_DAO_URL": "https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/",
"BLOG_URL": "https://decentraland.zone/blog/",
"LANDING_CREATORS_URL": "https://decentraland.zone/create/"
"LANDING_CREATORS_URL": "https://decentraland.zone/create/",
"DOWNLOAD_URL": "https://decentraland.zone/download/"
}
3 changes: 2 additions & 1 deletion src/config/env/prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@
"DOCS_CONTRIBUTOR_URL": "https://docs.decentraland.org/contributor/",
"DOCS_DAO_URL": "https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/",
"BLOG_URL": "https://decentraland.org/blog/",
"LANDING_CREATORS_URL": "https://decentraland.org/create/"
"LANDING_CREATORS_URL": "https://decentraland.org/create/",
"DOWNLOAD_URL": "https://decentraland.org/download/"
}
3 changes: 2 additions & 1 deletion src/config/env/stg.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@
"DOCS_CONTRIBUTOR_URL": "https://docs.decentraland.org/contributor/",
"DOCS_DAO_URL": "https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/",
"BLOG_URL": "https://decentraland.today/blog/",
"LANDING_CREATORS_URL": "https://decentraland.today/create/"
"LANDING_CREATORS_URL": "https://decentraland.today/create/",
"DOWNLOAD_URL": "https://decentraland.todat/download/"
}
Loading