Skip to content

Commit

Permalink
feat: remove login functionality and adjust action menu (DPS-4428) (#…
Browse files Browse the repository at this point in the history
…1551)

* feat: remove login functionality and adjust action menu

* feat: update package.json and package-lock.json

* feat: delete action menu

---------

Co-authored-by: Artur Fracala <[email protected]>
  • Loading branch information
arturfracala and Artur Fracala authored Feb 13, 2025
1 parent 89b2af6 commit 06b473f
Show file tree
Hide file tree
Showing 13 changed files with 123 additions and 711 deletions.
22 changes: 0 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"@docsearch/react": "^3.3.3",
"@emotion/core": "^10.0.22",
"@emotion/styled": "^10.0.23",
"@livechat/accounts-sdk": "^2.0.6",
"@livechat/design-system": "^0.13.4",
"@mapbox/rehype-prism": "^0.7.0",
"@mdx-js/mdx": "^1.5.1",
Expand Down
35 changes: 0 additions & 35 deletions src/api/accounts.js

This file was deleted.

28 changes: 0 additions & 28 deletions src/api/index.js

This file was deleted.

35 changes: 0 additions & 35 deletions src/api/livechat.js

This file was deleted.

146 changes: 68 additions & 78 deletions src/components/Page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import {
RatingProvider,
PromotionProvider,
} from "../../contexts";
import { AuthProvider } from "../../contexts/auth";
import { canUseWindow } from "../../utils";
import { useRating } from "../../hooks";
import articlesVersions from "../../configs/articlesVersions.json";
Expand Down Expand Up @@ -161,92 +160,83 @@ const Page = ({ frontMatter, children }) => {
slug = slug[slug.length - 1] === "/" ? slug : `${slug}/`;

const ratingContext = useRating({ slug });
const useRedocPage = [
"global-accounts-api",
"customer-accounts-api",
"text-api",
"chat-api"
].includes(subcategory) || ["Chat API"].includes(title);
const useRedocPage =
[
"global-accounts-api",
"customer-accounts-api",
"text-api",
"chat-api",
].includes(subcategory) || ["Chat API"].includes(title);

return (
<AuthProvider>
<RatingProvider value={ratingContext}>
<VersionProvider value={versionContext}>
<PromotionProvider value={promotionContext}>
<SEO
desc={desc}
title={title}
subtitle={subtitle}
robots={robots}
/>
<Header />
<MainWrapper>
{!useRedocPage && (
<SideNav
category={category}
version={currentApiVersion}
title={title}
<RatingProvider value={ratingContext}>
<VersionProvider value={versionContext}>
<PromotionProvider value={promotionContext}>
<SEO desc={desc} title={title} subtitle={subtitle} robots={robots} />
<Header />
<MainWrapper>
{!useRedocPage && (
<SideNav
category={category}
version={currentApiVersion}
title={title}
/>
)}

<MiddleColumn
noMargin={useRedocPage}
noPadding={useRedocPage}
fullWidth={useRedocPage}
>
{currentApiVersion && (
<Version
leftPadding={useRedocPage}
articleVersions={
articlesVersions[category][subcategory][title]
}
redirectToVersion={redirectToVersion}
group={versionGroup}
/>
)}

<MiddleColumn
noMargin={useRedocPage}
<Content
className={
useRedocPage
? `redoc ${currentApiVersion ? "redoc-with-version" : ""}`
: ""
}
noPadding={useRedocPage}
fullWidth={useRedocPage}
>
{currentApiVersion && (
<Version
leftPadding={useRedocPage}
articleVersions={
articlesVersions[category][subcategory][title]
}
redirectToVersion={redirectToVersion}
group={versionGroup}
/>
{title && !useRedocPage && <PageHeader title={title} />}
{useRedocPage && (
<LeftColumnRedocWrapper>
<LeftColumnRedoc>
<NavHeader>
<Link href={"/"} style={{ color: "inherit" }}>
<span>
<HomeIcon width={18} style={{ display: "block" }} />
</span>
</Link>
<ChevronRight width={14} />
<CategoryRedoc>{category}</CategoryRedoc>
</NavHeader>
</LeftColumnRedoc>
</LeftColumnRedocWrapper>
)}
<Content
className={
useRedocPage
? `redoc ${currentApiVersion ? "redoc-with-version" : ""}`
: ""
}
noPadding={useRedocPage}
>
{title && !useRedocPage && <PageHeader title={title} />}
{useRedocPage && (
<LeftColumnRedocWrapper>
<LeftColumnRedoc>
<NavHeader>
<Link href={"/"} style={{ color: "inherit" }}>
<span>
<HomeIcon
width={18}
style={{ display: "block" }}
/>
</span>
</Link>
<ChevronRight width={14} />
<CategoryRedoc>{category}</CategoryRedoc>
</NavHeader>
</LeftColumnRedoc>
</LeftColumnRedocWrapper>
)}

<MDXProvider components={components}>{children}</MDXProvider>
<MDXProvider components={components}>{children}</MDXProvider>

{!useRedocPage && (
<StyledRating position={RATING_POSITION.BOTTOM} />
)}
</Content>
</MiddleColumn>

{!useRedocPage && <ContentSideNav version={currentApiVersion} />}
</MainWrapper>
<Footer />
</PromotionProvider>
</VersionProvider>
</RatingProvider>
</AuthProvider>
{!useRedocPage && (
<StyledRating position={RATING_POSITION.BOTTOM} />
)}
</Content>
</MiddleColumn>

{!useRedocPage && <ContentSideNav version={currentApiVersion} />}
</MainWrapper>
<Footer />
</PromotionProvider>
</VersionProvider>
</RatingProvider>
);
};

Expand Down
6 changes: 0 additions & 6 deletions src/components/core/Navbar/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ import APIsSDKs from "./APIsSDKs";
import Resources from "./Resources";
import MobileMenu from "./MobileMenu/MobileMenu";

const Profile = dynamic(() => import("../Profile/Profile"), {
ssr: false,
loading: () => <p>...</p>,
});

const Wrapper = styled.div`
font-family: Colfax, colfax-web, Proxima Nova, Open Sans, Gill Sans MT,
Gill Sans, Corbel, Arial, sans-serif;
Expand Down Expand Up @@ -220,7 +215,6 @@ const Header = () => {
<Search />
</MobileSearchField>
)}
<Profile />
{!openMenu ? (
<MenuIcon
fill="#ffffff"
Expand Down
Loading

0 comments on commit 06b473f

Please sign in to comment.