Skip to content

Commit

Permalink
Merge pull request #580 from reportportal/hotfix/update-pricing-text-…
Browse files Browse the repository at this point in the history
…in-header

Sync develop with master
  • Loading branch information
AmsterGet authored Feb 10, 2025
2 parents 53fac47 + 0952ef5 commit b26cb85
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
15 changes: 1 addition & 14 deletions src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import React, { FC, ReactElement, useCallback, useRef } from 'react';
import { useLocation } from '@reach/router';
import Snowfall, { SnowfallProps } from 'react-snowfall';
import { StyleProvider } from '@ant-design/cssinjs';
import { useAtom } from 'jotai';
import { AnimatePresence } from 'framer-motion';
import classNames from 'classnames';
import { announcementOpenAtom, isNewYearMode, watchProductOverviewAtom } from '@app/utils';
import { AnnouncementBar } from '@app/components/AnnouncementBar';
import { isNewYearMode, watchProductOverviewAtom } from '@app/utils';

// eslint-disable-next-line import/no-unresolved
import '../../../static/antd.min.css'; // Will be generated at build time
Expand All @@ -31,12 +28,9 @@ interface LayoutProps {
}

export const Layout: FC<LayoutProps> = ({ children, className }) => {
const location = useLocation();
const [watchProductOverviewState, setWatchProductOverviewState] =
useAtom(watchProductOverviewAtom);
const [isAnnouncementBarOpen] = useAtom(announcementOpenAtom);
const announcementBarRef = useRef<HTMLDivElement>(null);
const isIndexPage = location.pathname === '/';

const toggleEmbedVideoOpen = useCallback(
() => setWatchProductOverviewState(({ isOpen }) => ({ isOpen: !isOpen })),
Expand All @@ -46,13 +40,6 @@ export const Layout: FC<LayoutProps> = ({ children, className }) => {
return (
<StyleProvider hashPriority="high">
<div className={classNames(className, { 'new-year-mode': isNewYearMode })}>
<AnimatePresence>
{isAnnouncementBarOpen && isIndexPage && (
<div ref={announcementBarRef}>
<AnnouncementBar />
</div>
)}
</AnimatePresence>
<Navigation announcementBarRef={announcementBarRef} />
<main>{children}</main>
<Footer />
Expand Down
20 changes: 14 additions & 6 deletions src/components/Layout/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,26 @@ import {
CrossIcon,
ArrowIconMobile,
} from './icons';
import { MENU_INITIAL_STATE, MENU_ORDER } from './constants';
import {
MENU_INITIAL_STATE,
MENU_ORDER,
OFFERINGS,
LEARN,
COMMUNITY,
PRODUCT,
SOLUTIONS,
} from './constants';

import './Navigation.scss';

const { Panel } = Collapse;

const menuItems = {
product: { Component: ProductMenu },
solutions: { Component: SolutionsMenu },
offerings: { Component: OfferingsMenu },
learn: { Component: LearnMenu },
community: { Component: CommunityMenu },
[PRODUCT]: { Component: ProductMenu },
[SOLUTIONS]: { Component: SolutionsMenu },
[OFFERINGS]: { Component: OfferingsMenu },
[LEARN]: { Component: LearnMenu },
[COMMUNITY]: { Component: CommunityMenu },
};

const getBlocksWith = createBemBlockBuilder(['top-header']);
Expand Down
18 changes: 12 additions & 6 deletions src/components/Layout/Navigation/constants.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
export const PRODUCT = 'product';
export const SOLUTIONS = 'solutions';
export const OFFERINGS = 'pricing';
export const LEARN = 'learn';
export const COMMUNITY = 'community';

export const MENU_INITIAL_STATE = {
product: false,
solutions: false,
offerings: false,
learn: false,
community: false,
[PRODUCT]: false,
[SOLUTIONS]: false,
[OFFERINGS]: false,
[LEARN]: false,
[COMMUNITY]: false,
};

export interface MenuProps {
Expand All @@ -12,4 +18,4 @@ export interface MenuProps {
isDesktop?: boolean;
}

export const MENU_ORDER = ['product', 'solutions', 'offerings', 'learn', 'community'];
export const MENU_ORDER = [PRODUCT, SOLUTIONS, OFFERINGS, LEARN, COMMUNITY];
2 changes: 1 addition & 1 deletion src/containers/BlogPostPage/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CopyToClipboardButton } from '@app/components/CopyToClipboardButton';

export const OPTIONS = {
renderMark: {
[MARKS.BOLD]: text => <b className="blog-post-page__bold-text">{text}</b>,
[MARKS.BOLD]: text => <strong className="blog-post-page__bold-text">{text}</strong>,
[MARKS.CODE]: text => (
<pre>
<code>{text}</code>
Expand Down

0 comments on commit b26cb85

Please sign in to comment.