Skip to content

Commit

Permalink
revert toc refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kendallstrautman committed Jul 24, 2020
1 parent b2aab25 commit c1779e4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
3 changes: 2 additions & 1 deletion components/ui/Toc.tsx → components/toc/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface TocProps {
activeIds: string[]
}

export const Toc = ({ tocItems, activeIds }: TocProps) => {
const Toc = ({ tocItems, activeIds }: TocProps) => {
const [isOpen, setIsOpen] = useState(false)

if (!tocItems) {
Expand Down Expand Up @@ -41,6 +41,7 @@ export const Toc = ({ tocItems, activeIds }: TocProps) => {
</>
)
}
export default Toc

const TocDesktopHeader = styled.span`
display: none;
Expand Down
1 change: 0 additions & 1 deletion components/ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ export * from './ActionableModal'
export * from './DesktopLabel'
export * from './ToolbarButton'
export * from './LoadingDots'
export * from './Toc'
2 changes: 1 addition & 1 deletion pages/blog/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Error from 'next/error'
import { getMarkdownPreviewProps } from 'utils/getMarkdownFile'
import { InlineWysiwyg } from 'components/inline-wysiwyg'
import { usePlugin, useCMS } from 'tinacms'

import Toc from '../../components/toc'
function BlogTemplate({ file, siteConfig, preview }) {
// fallback workaround
if (!file) {
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
DocsHeaderNav,
Overlay,
DocsPagination,
Toc,
} from 'components/ui'
import { InlineTextareaField, useInlineForm } from 'react-tinacms-inline'
import { TinaIcon } from 'components/logo'
Expand All @@ -25,6 +24,7 @@ import { OpenAuthoringSiteForm } from 'components/layout/OpenAuthoringSiteForm'
import { GithubError } from 'next-tinacms-github'
import { InlineWysiwyg } from 'components/inline-wysiwyg'
import { usePlugin } from 'tinacms'
import Toc from '../../components/toc'

function DocTemplate(props) {
// Registers Tina Form
Expand Down
9 changes: 2 additions & 7 deletions pages/guides/[category]/[guide]/[step].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ import {
Footer,
} from 'components/layout'
import { NextSeo } from 'next-seo'
import {
DocsNav,
DocsPagination,
Overlay,
DocsHeaderNav,
Toc,
} from 'components/ui'
import { DocsNav, DocsPagination, Overlay, DocsHeaderNav } from 'components/ui'
import {
DocsNavToggle,
DocsMobileTinaIcon,
Expand All @@ -38,6 +32,7 @@ import { InlineWysiwyg } from 'components/inline-wysiwyg'
import { getJsonPreviewProps } from 'utils/getJsonPreviewProps'
import { MarkdownCreatorPlugin } from 'utils/plugins'
import { fileToUrl } from '../../../../utils'
import Toc from '../../../../components/toc'

export default function GuideTemplate(props) {
const [open, setOpen] = React.useState(false)
Expand Down
14 changes: 14 additions & 0 deletions pages/packages/[slug].tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
import React, { useState } from 'react'
import { NextSeo } from 'next-seo'
// import {
// DocsLayout,
// Wrapper,
// DocsTextWrapper,
// Footer,
// MarkdownContent,
// } from '../../components/layout'
// import React, { useState } from 'react'
// import { NextSeo } from 'next-seo'
// import {
// DocsNav,
// DocsHeaderNav,
// Overlay,
// } from 'components/ui'
import { GetStaticProps, GetStaticPaths } from 'next'
import { GithubError } from 'next-tinacms-github'
import path from 'path'
Expand Down

0 comments on commit c1779e4

Please sign in to comment.