Skip to content

Commit

Permalink
fix(search-components): update paths after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
RobsonOlv committed May 2, 2022
1 parent 5ead14b commit 7300bfc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 67 deletions.
2 changes: 1 addition & 1 deletion src/components/search-card/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Flex, Text, IconCaret } from '@vtex/brand-ui'
import { IconComponent } from 'utils/typings/types'
import type { SearchDataItemProps } from 'pages/search'
import type { SearchDataItemProps } from 'components/search-results'

import { methodStyle } from './functions'
import styles from './styles'
Expand Down
73 changes: 7 additions & 66 deletions src/components/search-results/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import { IconComponent } from 'utils/typings/types'
import APIGuidesIcon from 'components/icons/api-guides-icon'
import APIReferenceIcon from 'components/icons/api-reference-icon'
import VTEXIOIcon from 'components/icons/vtex-io-icon'
import FastStoreIcon from 'components/icons/fast-store-icon'
import WebOpsIcon from 'components/icons/webops-icon'
import ReleaseNotesIcon from 'components/icons/release-notes-icon'
import DocumentationUpdatesIcon from 'components/icons/documentation-updates-icon'
import SearchCard from 'components/search-card'
import {
DocumentationTitle,
UpdatesTitle,
MethodType,
} from 'utils/typings/unionTypes'
import { ActionType } from 'components/last-updates-card/functions'
import { useRouter } from 'next/router'
import { Box, Text } from '@vtex/brand-ui'

import { MethodType } from 'utils/typings/unionTypes'

import { getIcon } from 'utils/constants'
import SearchCard from 'components/search-card'

import { ActionType } from 'components/last-updates-card/functions'
import styles from './styles'

export interface SearchDataItemProps {
Expand All @@ -26,57 +18,6 @@ export interface SearchDataItemProps {
actionType?: ActionType
}

export interface DocDataElement {
Icon: IconComponent
title: DocumentationTitle
}

export interface UpdatesDataElement {
Icon: IconComponent
title: UpdatesTitle
}

export const docsIcons: DocDataElement[] = [
{
Icon: APIGuidesIcon,
title: 'API Guides',
},
{
Icon: APIReferenceIcon,
title: 'API Reference',
},
{
Icon: VTEXIOIcon,
title: 'VTEX IO',
},
{
Icon: FastStoreIcon,
title: 'FastStore',
},
{
Icon: WebOpsIcon,
title: 'WebOps',
},
]

export const notesIcons: UpdatesDataElement[] = [
{
Icon: ReleaseNotesIcon,
title: 'Release Notes',
},
{
Icon: DocumentationUpdatesIcon,
title: 'Documentation Updates',
},
]

const getIcon = (doc: string) => {
return (
docsIcons.find((icon) => icon.title === doc)?.Icon ||
notesIcons.find((icon) => icon.title === doc)?.Icon
)
}

const SearchResults = () => {
const router = useRouter()

Expand Down

0 comments on commit 7300bfc

Please sign in to comment.