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

Staging #1

Open
wants to merge 4 commits into
base: production
Choose a base branch
from
Open
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
96 changes: 64 additions & 32 deletions src/components/sidebar/SidebarFooter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ import {
SidebarListItemIcon,
SidebarListItemText,
} from '@/components/sidebar/SidebarList'
import { loadBeamer } from '@/services/beamer'
import { BEAMER_SELECTOR, loadBeamer } from '@/services/beamer'
import { useAppSelector } from '@/store'
import { CookieAndTermType, hasConsentFor } from '@/store/cookiesAndTermsSlice'
import HelpCenterIcon from '@/public/images/sidebar/help-center.svg'
import { Link, ListItem, SvgIcon, Typography } from '@mui/material'
import { ListItem, SvgIcon, Typography } from '@mui/material'
import DebugToggle from '../DebugToggle'
import { HELP_CENTER_URL, IS_PRODUCTION } from '@/config/constants'
import { useCurrentChain } from '@/hooks/useChains'
import darkPalette from '@/components/theme/darkPalette'
import ProtofireLogo from '@/public/images/protofire-logo.svg'
import SuggestionIcon from '@/public/images/sidebar/lightbulb_icon.svg'
import SafeLogo from '@/public/images/logo-text.svg'
import ExternalLink from '@/components/common/ExternalLink'
import Track from '@/components/common/Track'
import { OVERVIEW_EVENTS } from '@/services/analytics'

export const NEW_SUGGESTION_FORM =
'https://docs.google.com/forms/d/e/1FAIpQLSfojsADYCiWq9AqbLqsUTzCDSpA8FMgdAQp0Pyl0BOeurlq9A/viewform'
Expand All @@ -27,7 +30,7 @@ const SidebarFooter = (): ReactElement => {
const hasBeamerConsent = useAppSelector((state) => hasConsentFor(state, CookieAndTermType.UPDATES))

useEffect(() => {
// Initialise Beamer when consent was previously given
// Initialize Beamer when consent was previously given
if (hasBeamerConsent && chain?.shortName) {
loadBeamer(chain.shortName)
}
Expand All @@ -41,42 +44,71 @@ const SidebarFooter = (): ReactElement => {
</ListItem>
)}

<ListItem disablePadding>
<a target="_blank" rel="noopener noreferrer" href={HELP_CENTER_URL} style={{ width: '100%' }}>
<SidebarListItemButton>
<Track {...OVERVIEW_EVENTS.WHATS_NEW}>
<ListItem disablePadding>
<SidebarListItemButton id={BEAMER_SELECTOR}>
<SidebarListItemIcon color="primary">
<HelpCenterIcon />
</SidebarListItemIcon>
<SidebarListItemText data-testid="list-item-need-help" bold>
Need help?
What &apos; s New
</SidebarListItemText>
</SidebarListItemButton>
</a>
</ListItem>
</ListItem>
</Track>

<Track {...OVERVIEW_EVENTS.HELP_CENTER}>
<ListItem disablePadding>
<a target="_blank" rel="noopener noreferrer" href={HELP_CENTER_URL} style={{ width: '100%' }}>
<SidebarListItemButton>
<SidebarListItemIcon color="primary">
<HelpCenterIcon />
</SidebarListItemIcon>
<SidebarListItemText data-testid="list-item-need-help" bold>
Need Help?
</SidebarListItemText>
</SidebarListItemButton>
</a>
</ListItem>
</Track>

<Track {...OVERVIEW_EVENTS.SUGGESTIONS}>
<ListItem disablePadding>
<a target="_blank" rel="noopener noreferrer" href={NEW_SUGGESTION_FORM} style={{ width: '100%' }}>
<SidebarListItemButton style={{ backgroundColor: '#5FDDFF', color: 'black' }}>
<SidebarListItemIcon color="primary">
<SuggestionIcon />
</SidebarListItemIcon>
<SidebarListItemText bold>New Features Suggestion?</SidebarListItemText>
</SidebarListItemButton>
</a>
</ListItem>
</Track>

<ListItem disablePadding>
<a target="_blank" rel="noopener noreferrer" href={NEW_SUGGESTION_FORM} style={{ width: '100%' }}>
<SidebarListItemButton style={{ backgroundColor: '#5FDDFF', color: 'black' }}>
<SidebarListItemIcon color="primary">
<SuggestionIcon />
</SidebarListItemIcon>
<SidebarListItemText bold>New Features Suggestion?</SidebarListItemText>
</SidebarListItemButton>
</a>
<SvgIcon
component={SafeLogo}
inheritViewBox
sx={{ height: '3.5em', verticalAlign: 'middle', width: '100%', mb: '-12%' }}
/>
</ListItem>

<ListItem>
<SidebarListItemText>
<Typography variant="caption">
Supported by{' '}
<SvgIcon
component={ProtofireLogo}
inheritViewBox
fontSize="small"
sx={{ verticalAlign: 'middle', mx: 0.5 }}
/>
<ExternalLink href="https://protofire.io" sx={{ textDecoration: 'none' }} noIcon>
Protofire
</ExternalLink>
</Typography>
</SidebarListItemText>
</ListItem>
<SidebarListItemText sx={{ marginLeft: 2 }}>
<Typography variant="caption">
Supported by{' '}
<SvgIcon
component={ProtofireLogo}
inheritViewBox
fontSize="small"
sx={{ verticalAlign: 'middle', mx: 0.5 }}
/>
<Link href="https://protofire.io" sx={{ color: darkPalette.primary.main, textDecoration: 'none' }}>
Protofire
</Link>
</Typography>
</SidebarListItemText>
</SidebarList>
)
}
Expand Down
4 changes: 4 additions & 0 deletions src/services/analytics/events/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export const OVERVIEW_EVENTS = {
action: 'Add new network',
category: OVERVIEW_CATEGORY,
},
SUGGESTIONS: {
action: 'Suggestions',
category: OVERVIEW_CATEGORY,
},
SUBMIT_ADD_NEW_NETWORK: {
action: 'Submit add new network',
category: OVERVIEW_CATEGORY,
Expand Down
Loading