Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

카테고리, 태그, 템플릿 목록 로딩 처리 개선 #784

Open
wants to merge 11 commits into
base: dev/fe
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions frontend/src/components/ScrollTopButton/ScrollTopButton.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import styled from '@emotion/styled';

import { theme } from '@/style/theme';

export const ScrollTopButton = styled.button`
cursor: pointer;

position: fixed;
right: 2rem;
bottom: 2rem;

display: flex;
align-items: center;
justify-content: center;

padding: 0.75rem;

background-color: ${theme.color.light.primary_500};
border: none;
border-radius: 100%;
`;
16 changes: 16 additions & 0 deletions frontend/src/components/ScrollTopButton/ScrollTopButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { ArrowUpIcon } from '@/assets/images';
import { scroll } from '@/utils';

import * as S from './ScrollTopButton.style';

const ScrollTopButton = () => (
<S.ScrollTopButton
onClick={() => {
scroll.top('smooth');
}}
>
<ArrowUpIcon aria-label='맨 위로' />
</S.ScrollTopButton>
);

export default ScrollTopButton;
1 change: 1 addition & 0 deletions frontend/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export { default as NewCategoryInput } from './NewCategoryInput/NewCategoryInput
export { default as NoSearchResults } from './NoSearchResults/NoSearchResults';
export { default as Textarea } from './Textarea/Textarea';
export { default as ContactUs } from './ContactUs/ContactUs';
export { default as ScrollTopButton } from './ScrollTopButton/ScrollTopButton';

// Skeleton UI
export { default as LoadingBall } from './LoadingBall/LoadingBall';
Expand Down
1 change: 1 addition & 0 deletions frontend/src/hooks/template/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { useSourceCode } from './useSourceCode';
export { useTag } from './useTag';
export { useSearchKeyword } from './useSearchKeyword';
8 changes: 8 additions & 0 deletions frontend/src/hooks/template/useSearchKeyword.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { useInput, useDebounce } from '..';

export const useSearchKeyword = () => {
const [keyword, handleKeywordChange] = useInput('');
const debouncedKeyword = useDebounce(keyword, 300);

return { keyword, debouncedKeyword, handleKeywordChange };
};
36 changes: 3 additions & 33 deletions frontend/src/pages/MyTemplatesPage/MyTemplatePage.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,6 @@ export const MainContainer = styled.main`
}
`;

export const TopBannerContainer = styled.div`
display: flex;
align-items: center;

width: 100%;
height: 10.25rem;

white-space: nowrap;
`;

export const TopBannerTextWrapper = styled.div`
display: flex;
gap: 0.5rem;
align-items: center;
margin-left: calc(12.5rem + clamp(1rem, calc(0.0888 * 100vw - 3.2618rem), 4.375rem));
`;

export const SearchInput = styled(Input)`
box-shadow: inset 1px 2px 8px #00000030;
`;
Expand All @@ -62,20 +45,7 @@ export const NewTemplateButton = styled.button`
}
`;

export const ScrollTopButton = styled.button`
cursor: pointer;

position: fixed;
right: 2rem;
bottom: 2rem;

display: flex;
align-items: center;
justify-content: center;

padding: 0.75rem;

background-color: ${theme.color.light.primary_500};
border: none;
border-radius: 100%;
export const TemplateListSectionWrapper = styled.div`
position: relative;
width: 100%;
`;
Loading