From 8fd9e97144d5295dea03c92547d562ad19e111a7 Mon Sep 17 00:00:00 2001 From: jinhojang6 Date: Mon, 15 May 2023 02:40:49 +0900 Subject: [PATCH] resolve conflicts 2 --- src/components/ContentBlock/ImageBlock.tsx | 9 ++++----- src/components/ContentBlock/TextBlock.tsx | 2 +- src/components/RelatedContent/RelatedContent.tsx | 9 ++++++--- src/components/Tags/Tags.tsx | 4 ++-- src/pages/search.tsx | 1 - src/queries/searchBlocks.ts | 2 ++ 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/components/ContentBlock/ImageBlock.tsx b/src/components/ContentBlock/ImageBlock.tsx index 79eb85b..8ab38be 100644 --- a/src/components/ContentBlock/ImageBlock.tsx +++ b/src/components/ContentBlock/ImageBlock.tsx @@ -1,6 +1,5 @@ import Link from 'next/link' import styled from '@emotion/styled' -import Image from 'next/image' import { SearchResultItem } from '@/types/data.types' import { UnbodyImageBlock } from '@/lib/unbody/unbody.types' @@ -9,17 +8,17 @@ import { GridItem } from '../Grid/Grid' import { PostClassType } from '../Post/Post' import ContentBlockHeader from './ContentBlock.Header' import ContentBlockBody from './ContentBlock.Body' +import { ResponsiveImage } from '../ResponsiveImage/ResponsiveImage' type Props = Omit, 'score'> const ImageBlock = ({ doc }: Props) => { return ( - + {/* TODO: order not working for images */} + - - {doc.alt} - + , 'score'> const TextBlock = ({ doc }: Props) => { return ( - + {data.data.map( - (block: SearchResultItem) => { + ( + block: SearchResultItem, + idx: number, + ) => { if (!block.doc.document || !block.doc.document[0]) return null let refArticle = null @@ -28,9 +31,9 @@ export default function RelatedContent({ data }: Props) { } switch (block.doc.__typename) { case UnbodyGraphQl.UnbodyDocumentTypeNames.TextBlock: - return + return case UnbodyGraphQl.UnbodyDocumentTypeNames.ImageBlock: { - return + return } } }, diff --git a/src/components/Tags/Tags.tsx b/src/components/Tags/Tags.tsx index c5ce181..f158f9c 100644 --- a/src/components/Tags/Tags.tsx +++ b/src/components/Tags/Tags.tsx @@ -22,12 +22,12 @@ const Tags = ({ tags }: { tags: string[] }) => { return tags.length > 0 ? ( - {tags.map((tag) => ( + {tags.map((tag, idx) => ( onTagClick(e, tag)} size="small" disabled={false} - key={tag} + key={`tag-${idx}`} > {tag} diff --git a/src/pages/search.tsx b/src/pages/search.tsx index 351f4f3..871c6c0 100644 --- a/src/pages/search.tsx +++ b/src/pages/search.tsx @@ -16,7 +16,6 @@ import { ReactNode, useEffect, useRef, useState } from 'react' import { SearchLayout } from '@/layouts/SearchLayout' import { RelatedArticles } from '@/components/RelatedArticles' import { RelatedContent } from '@/components/RelatedContent' -import { Section } from '@/components/Section/Section' interface SearchPageProps { articles: SearchResultItem[] diff --git a/src/queries/searchBlocks.ts b/src/queries/searchBlocks.ts index a2985f1..1bc1b5c 100644 --- a/src/queries/searchBlocks.ts +++ b/src/queries/searchBlocks.ts @@ -16,6 +16,7 @@ export const getSearchBlocksQuery = (args: UnbodyGetFilters = defaultArgs) => text tagName classNames + order document{ ...on GoogleDoc{ title @@ -36,6 +37,7 @@ export const getSearchBlocksQuery = (args: UnbodyGetFilters = defaultArgs) => width height alt + order document{ ...on GoogleDoc{ title