Skip to content

Commit

Permalink
avoid deep imports
Browse files Browse the repository at this point in the history
  • Loading branch information
josephaxisa committed Oct 19, 2021
1 parent dc81cda commit 299422c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
16 changes: 11 additions & 5 deletions packages/api-explorer/src/ApiExplorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import type { RunItSetter } from '@looker/run-it'
import { funFetch, fallbackFetch, OAuthScene } from '@looker/run-it'
import { FirstPage } from '@styled-icons/material/FirstPage'
import { LastPage } from '@styled-icons/material/LastPage'

import { SearchContext, LodeContext, defaultLodeContextValue } from './context'
import type { IApixEnvAdaptor } from './utils'
import {
Expand All @@ -52,7 +53,14 @@ import {
registerEnvAdaptor,
unregisterEnvAdaptor,
} from './utils'
import { Header, SideNav, ErrorBoundary, Loader } from './components'
import {
Header,
SideNav,
ErrorBoundary,
Loader,
SelectorContainer,
HEADER_TOGGLE_LABEL,
} from './components'
import {
specReducer,
initDefaultSpecState,
Expand All @@ -63,8 +71,6 @@ import {
import { AppRouter } from './routes'
import { apixFilesHost } from './utils/lodeUtils'
import { useActions } from './hooks'
import { TOGGLE_LABEL } from './components/Header'
import { SelectorContainer } from './components/SelectorContainer'

export interface ApiExplorerProps {
specs: SpecList
Expand All @@ -83,7 +89,7 @@ const ApiExplorer: FC<ApiExplorerProps> = ({
setVersionsUrl,
exampleLodeUrl = 'https://raw.githubusercontent.com/looker-open-source/sdk-codegen/main/examplesIndex.json',
declarationsLodeUrl = `${apixFilesHost}/declarationsIndex.json`,
headless = true,
headless = false,
}) => {
const [initializing, setInitializing] = useState(true)
const location = useLocation()
Expand Down Expand Up @@ -222,7 +228,7 @@ const ApiExplorer: FC<ApiExplorerProps> = ({
icon={
hasNavigation ? <FirstPage /> : <LastPage />
}
label={TOGGLE_LABEL}
label={HEADER_TOGGLE_LABEL}
onClick={() => toggleNavigation()}
/>
</Space>
Expand Down
4 changes: 2 additions & 2 deletions packages/api-explorer/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ interface HeaderProps {

export const HEADER_REM = 4

export const TOGGLE_LABEL = 'Toggle Navigation'
export const HEADER_TOGGLE_LABEL = 'Toggle Navigation'

/**
* Renders the API Explorer header
Expand All @@ -80,7 +80,7 @@ export const HeaderLayout: FC<HeaderProps> = ({
onClick={() => toggleNavigation()}
icon={<Menu />}
aria-label="nav toggle"
label={TOGGLE_LABEL}
label={HEADER_TOGGLE_LABEL}
/>

<Link to={`/${spec.key}`}>
Expand Down
2 changes: 1 addition & 1 deletion packages/api-explorer/src/components/Header/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
SOFTWARE.
*/
export { Header, HEADER_REM, TOGGLE_LABEL } from './Header'
export { Header, HEADER_REM, HEADER_TOGGLE_LABEL } from './Header'
3 changes: 2 additions & 1 deletion packages/api-explorer/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ export { DocSdkUsage } from './DocSdkUsage'
export { DocSource } from './DocSource'
export { DocStatus } from './DocStatus'
export { DocTitle } from './DocTitle'
export { Header } from './Header'
export { Header, HEADER_TOGGLE_LABEL } from './Header'
export { SideNav } from './SideNav'
export { ExploreType, ExploreProperty } from './ExploreType'
export { DocSchema } from './DocSchema'
export { DocTypeSummary } from './DocTypeSummary'
export { Link } from './Link'
export { ErrorBoundary } from './ErrorBoundary'
export { SelectorContainer } from './SelectorContainer'

0 comments on commit 299422c

Please sign in to comment.