(
+
+ handleIconClick({
+ e,
+ isMenuOpen: isVisible,
+ isTooltipOpen,
+ handleInteraction,
+ onClick: () => setIsVisible(!isVisible),
+ })
+ }
+ onMouseEnter={(e) => {
+ handleMouseEnter({
+ e,
+ isMenuOpen: isVisible,
+ handleInteraction,
+ });
+ }}
+ onMouseLeave={(e) => {
+ handleMouseLeave({
+ e,
+ isTooltipOpen,
+ handleInteraction,
+ });
+ }}
+ >
+ setIsVisible(!isVisible)}
+ />
+
+ )}
/>
+
{
const location = useLocation();
const user = useUserStore();
const newMobileNav = useFlag('newMobileNav');
+ const rewardsEnabled = useFlag('rewardsPage');
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
@@ -56,6 +57,15 @@ const MobileNavigation = () => {
},
]
: []),
+ ...(user.isLoggedIn && rewardsEnabled
+ ? [
+ {
+ type: 'rewards' as const,
+ onClick: () => navigate('/rewards', {}, null),
+ selected: !!matchRoutes([{ path: '/rewards' }], location),
+ },
+ ]
+ : []),
];
return (
diff --git a/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/NavigationButton.scss b/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/NavigationButton.scss
index d936f8f5b3f..f2608b97a06 100644
--- a/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/NavigationButton.scss
+++ b/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/NavigationButton.scss
@@ -6,8 +6,7 @@
flex-direction: column;
justify-content: center;
align-items: center;
- padding: 4px 16px 0;
- min-width: 80px;
+ padding: 4px 8px 0;
svg {
fill: $neutral-600;
diff --git a/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/NavigationButton.tsx b/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/NavigationButton.tsx
index ec5deb8c379..0b745af7b8e 100644
--- a/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/NavigationButton.tsx
+++ b/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/NavigationButton.tsx
@@ -7,7 +7,7 @@ import { typeToIconAndName } from './utils';
import './NavigationButton.scss';
export interface NavigationButtonProps {
- type: 'home' | 'create' | 'explore' | 'notifications';
+ type: 'home' | 'create' | 'explore' | 'notifications' | 'rewards';
selected: boolean;
onClick: () => void;
}
diff --git a/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/utils.ts b/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/utils.ts
index b94d12090ce..b3badcfc3df 100644
--- a/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/utils.ts
+++ b/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/utils.ts
@@ -17,5 +17,7 @@ export const typeToIconAndName = (
return ['compassPhosphor', 'Explore'];
case 'notifications':
return ['bell', 'Notifications'];
+ case 'rewards':
+ return ['cardholder', 'Rewards'];
}
};
diff --git a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/DesktopHeader.scss b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/DesktopHeader.scss
index 2e6527b0f80..7e75f2c78c8 100644
--- a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/DesktopHeader.scss
+++ b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/DesktopHeader.scss
@@ -55,6 +55,31 @@
margin-bottom: auto;
margin-left: 5px;
}
+
+ .rewards-button {
+ margin-left: 24px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ svg {
+ fill: $neutral-500;
+ }
+
+ .rewards-button-container {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ cursor: pointer;
+
+ .earnings {
+ margin-left: 4px;
+ font-family: $font-family-roboto;
+ color: $neutral-500;
+ white-space: nowrap;
+ }
+ }
+ }
}
.DesktopMenuContainer {
diff --git a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/DesktopHeader.tsx b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/DesktopHeader.tsx
index c5f1478c132..8751e07d37b 100644
--- a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/DesktopHeader.tsx
+++ b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/DesktopHeader.tsx
@@ -15,10 +15,13 @@ import { HelpMenuPopover } from 'views/menus/help_menu';
import UserDropdown from './UserDropdown';
+import { useFlag } from 'hooks/useFlag';
import { useFetchCustomDomainQuery } from 'state/api/configuration';
import useUserStore from 'state/ui/user';
import AuthButtons from 'views/components/SublayoutHeader/AuthButtons';
import { AuthModalType } from 'views/modals/AuthModal';
+import { capDecimals } from 'views/modals/ManageCommunityStakeModal/utils';
+import { CWText } from '../../component_kit/cw_text';
import './DesktopHeader.scss';
interface DesktopHeaderProps {
@@ -28,6 +31,7 @@ interface DesktopHeaderProps {
const DesktopHeader = ({ onMobile, onAuthModalOpen }: DesktopHeaderProps) => {
const navigate = useCommonNavigate();
+ const rewardsEnabled = useFlag('rewardsPage');
const { menuVisible, setMenu, menuName, setUserToggledVisibility } =
useSidebarStore();
const user = useUserStore();
@@ -118,7 +122,41 @@ const DesktopHeader = ({ onMobile, onAuthModalOpen }: DesktopHeaderProps) => {