Skip to content

Commit

Permalink
Fix misisng import
Browse files Browse the repository at this point in the history
  • Loading branch information
wileymc committed Dec 20, 2024
1 parent 939136f commit 6c02d15
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
4 changes: 1 addition & 3 deletions components/CodeBlock/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface CodeBlockProps {
language: HljsLanguage;
}

function CodeBlock({ code, language }: CodeBlockProps) {
export function CodeBlock({ code, language }: CodeBlockProps) {
const handleCopy = () => {
void navigator.clipboard.writeText(code);
toast("Copied to clipboard", {
Expand Down Expand Up @@ -43,5 +43,3 @@ function CodeBlock({ code, language }: CodeBlockProps) {
</div>
);
}

export { CodeBlock };
2 changes: 2 additions & 0 deletions components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ import { IndeterminateCheckbox } from "./IndeterminateCheckbox/IndeterminateChec
import { DocsLayout } from "./DocsLayout/DocsLayout";
import { OrganizationDashboardLink } from "./OrganizationDashboardLink";
import { Modal } from "./Modal/Modal";
import { CodeBlock } from "./CodeBlock/CodeBlock";

export type { EditVotingGuideCandidate, FlagColor, NavItem };

export {
CodeBlock,
Modal,
OrganizationDashboardLink,
DocsLayout,
Expand Down
13 changes: 13 additions & 0 deletions mdx-components.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { MDXComponents } from "mdx/types";

// This file allows you to provide custom React components
// to be used in MDX files. You can import and use any
// React component you want, including inline styles,
// components from other libraries, and more.

export function useMDXComponents(components: MDXComponents): MDXComponents {
return {
// Allows customizing built-in components, e.g. to add styling.
...components,
};
}
14 changes: 6 additions & 8 deletions pages/docs/api/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ A query to the Populist API could looks something like this:

<CodeBlock
code={`query {
elections(filter: {
state: CO
}) {
title
description
electionDate
}
}`}
elections(filter: { state: CO }) {
title
description
electionDate
}
}`}
language="graphql"
/>

Expand Down

0 comments on commit 6c02d15

Please sign in to comment.