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: add about button to header #10228

Merged
merged 9 commits into from
Dec 19, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import KnockNotifications from 'views/components/KnockNotifications';
import { CWDivider } from 'views/components/component_kit/cw_divider';
import { CWIconButton } from 'views/components/component_kit/cw_icon_button';
import { isWindowSmallInclusive } from 'views/components/component_kit/helpers';
import { CWButton } from 'views/components/component_kit/new_designs/CWButton';
import { CWSearchBar } from 'views/components/component_kit/new_designs/CWSearchBar';
import { CWTooltip } from 'views/components/component_kit/new_designs/CWTooltip';
import { CreateContentPopover } from 'views/menus/CreateContentMenu';
Expand Down Expand Up @@ -83,6 +84,24 @@ const DesktopHeader = ({ onMobile, onAuthModalOpen }: DesktopHeaderProps) => {
})}
>
<CreateContentPopover />
{!isWindowSmallInclusive(window.innerWidth) && (
<CWTooltip
content="About Common"
placement="bottom"
renderTrigger={(handleInteraction) => (
<CWButton
buttonType="secondary"
buttonHeight="sm"
label="About"
onClick={() =>
window.open('https://landing.common.xyz', '_blank')
}
onMouseEnter={handleInteraction}
onMouseLeave={handleInteraction}
/>
)}
/>
)}
<CWTooltip
content="Explore communities"
placement="bottom"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@

&.tipBottom {
@include tip(-4px, auto, auto, calc(50% - 8px));

@include medium {
@include tip(-4px, auto, auto, calc(20% - 8px));
}
}

&.tipBottomSidebarHidden {
@include tip(-4px, auto, auto, calc(20% - 8px / 2));
}

&.tipLeft {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Placement } from '@popperjs/core/lib';
import React, { FC } from 'react';
import useSidebarStore from 'state/ui/sidebar';
import { getClasses } from 'views/components/component_kit/helpers';
import { ComponentType } from 'views/components/component_kit/types';

Expand All @@ -13,8 +12,6 @@ export const TooltipContainer: FC<ContainerProps> = ({
placement,
children,
}) => {
const { menuVisible } = useSidebarStore();

return (
<div className={getClasses({ placement }, ComponentType.Tooltip)}>
{children}
Expand All @@ -24,7 +21,6 @@ export const TooltipContainer: FC<ContainerProps> = ({
placement,
Arrow: true,
tipTop: placement === 'top',
tipBottomSidebarHidden: placement === 'bottom' && !menuVisible,
tipRight: placement === 'right',
tipBottom: placement === 'bottom',
tipLeft: placement === 'left',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import useUserStore from 'state/ui/user';
import { CWCommunityAvatar } from '../component_kit/cw_community_avatar';
import { CWDivider } from '../component_kit/cw_divider';
import { CWIconButton } from '../component_kit/cw_icon_button';
import { isWindowSmallInclusive } from '../component_kit/helpers';
import { CWTooltip } from '../component_kit/new_designs/CWTooltip';
import './sidebar_quick_switcher.scss';

export const SidebarQuickSwitcher = ({
Expand Down Expand Up @@ -40,6 +42,23 @@ export const SidebarQuickSwitcher = ({
setMenu({ name: 'exploreCommunities' });
}}
/>
{isWindowSmallInclusive(window.innerWidth) && (
<CWTooltip
content="About Common"
placement="bottom"
renderTrigger={(handleInteraction) => (
<CWIconButton
iconButtonTheme="neutral"
iconName="infoEmpty"
onClick={() =>
window.open('https://landing.common.xyz', '_blank')
}
onMouseEnter={handleInteraction}
onMouseLeave={handleInteraction}
/>
)}
/>
)}
</div>
<CWDivider />
<div className="scrollable-community-bar">
Expand Down
Loading