Bläddra i källkod

feat: hide support and sidebar button

Alexandru Cambose 2 månader sedan
förälder
incheckning
1adc759c50

+ 1 - 0
apps/developer-hub/src/components/Root/index.tsx

@@ -34,6 +34,7 @@ export const Root = ({ children }: Props) => (
   >
     <AppShell
       appName="Developer Hub"
+      displaySupportButton={false}
       amplitudeApiKey={AMPLITUDE_API_KEY}
       googleAnalyticsId={GOOGLE_ANALYTICS_ID}
       enableAccessibilityReporting={ENABLE_ACCESSIBILITY_REPORTING}

+ 1 - 0
apps/developer-hub/src/config/layout.config.tsx

@@ -20,5 +20,6 @@ export const docsOptions: DocsLayoutProps = {
   tree: source.pageTree,
   sidebar: {
     tabs: false,
+    collapsible: false,
   },
 };

+ 1 - 1
packages/component-library/src/AppShell/index.tsx

@@ -62,7 +62,7 @@ export const AppShell = ({
 
 type AppBodyProps = Pick<
   ComponentProps<typeof Header>,
-  "appName" | "mainCta" | "extraCta"
+  "appName" | "mainCta" | "extraCta" | "displaySupportButton"
 > & {
   tabs?: Tab[] | undefined;
   children: ReactNode;

+ 4 - 1
packages/component-library/src/Header/index.tsx

@@ -30,6 +30,7 @@ type Props = ComponentProps<"header"> & {
     | undefined;
   mainMenu?: ReactNode | undefined;
   extraCta?: ReactNode | undefined;
+  displaySupportButton?: boolean | undefined;
 };
 
 export const Header = ({
@@ -38,6 +39,7 @@ export const Header = ({
   mainCta,
   mainMenu,
   extraCta,
+  displaySupportButton = true,
   ...props
 }: Props) => (
   <header className={clsx(styles.header, className)} {...props}>
@@ -53,7 +55,7 @@ export const Header = ({
         {mainMenu}
       </div>
       <div className={styles.rightMenu}>
-        <Button
+        {displaySupportButton && <Button
           variant="ghost"
           size="sm"
           rounded
@@ -63,6 +65,7 @@ export const Header = ({
         >
           Support
         </Button>
+        }
         {extraCta}
         <MobileMenu className={styles.mobileMenu} mainCta={mainCta} />
         <Button