Skip to content

Commit

Permalink
feat: Default show uncategory image
Browse files Browse the repository at this point in the history
  • Loading branch information
ybgbob committed Feb 20, 2024
1 parent 44a9b90 commit 4dbac36
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/components/resource/RelatedImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import styled from '@emotion/styled';
interface IProps {
title: string;
categoryId: number;
allUrl: string;
}

export const RelatedImage = ({ title, categoryId, allUrl }: IProps) => {
export const RelatedImage = ({ title, categoryId }: IProps) => {
const { data: categoryRelatedList } = useGetItemList({
filter: {
address: '',
Expand All @@ -22,6 +21,8 @@ export const RelatedImage = ({ title, categoryId, allUrl }: IProps) => {
sort: 'CREATION_DESC',
});

const allUrl = `/search?c=${categoryId || 100}`;

return (
<>
<Flex alignItems="center" justifyContent="space-between">
Expand Down
6 changes: 1 addition & 5 deletions src/pages/Resource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,7 @@ const Resource = () => {
</ResourceInfo>

<Box mt="40px">
<RelatedImage
title="Related images"
categoryId={category?.id || 100}
allUrl={`/search?c=${category?.id}`}
/>
<RelatedImage title="Related images" categoryId={category?.id || 100} />
</Box>
</Container>
);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const Search = () => {
const c = (p.get('c') as string) || '-1';
const category = useGetCategory(Number(c));

console.log('category', category);

// console.log('category', category);

const {
Expand Down Expand Up @@ -68,7 +70,6 @@ const Search = () => {
<RelatedImage
title="Images you might be interested in"
categoryId={category?.id || 100}
allUrl={`/search?c=${category?.id}`}
/>
</Box>
</Container>
Expand All @@ -95,7 +96,6 @@ const Search = () => {
<RelatedImage
title="Images you might be interested in"
categoryId={category?.id || 100}
allUrl={`/search?c=${category?.id}`}
/>
</Box>
)}
Expand Down

0 comments on commit 4dbac36

Please sign in to comment.