Skip to content
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
5 changes: 3 additions & 2 deletions shared/src/core/apis/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ const DEFAULT_ERROR_MESSAGES: Record<number, string> = {
};

type JsonBody = Record<string, unknown> | unknown[];
type Query = Record<string, string | number | boolean | undefined | string[]>;

type FetcherOptions<TRequest extends JsonBody> = {
path: string;
baseUrl?: string;
query?: Record<string, string | number | undefined | string[]>;
query?: Query;
body?: TRequest;
headers?: HeadersInit;
};
Expand Down Expand Up @@ -69,7 +70,7 @@ type RequestOptions<TRequest> = {
path: string;
baseUrl?: string;
method: FetchMethod;
query?: Record<string, string | number | undefined | string[]>;
query?: Query;
body?: TRequest;
headers?: HeadersInit;
};
Expand Down
3 changes: 3 additions & 0 deletions web/src/apis/articles/articles.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export type GetArticlesWithSearchParams =
components['schemas']['ArticleSearchOptionsRequest'] &
components['schemas']['Pageable'];

export type GetStorageArticlesParams = GetArticlesParams &
Pick<components['schemas']['ArticleSearchOptionsRequest'], 'keyword'>;

export const getArticlesWithSearch = async (
params: GetArticlesWithSearchParams,
) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import styled from '@emotion/styled';
import { useState } from 'react';
import { createPortal } from 'react-dom';
import { useClickOutsideRef } from '@/hooks/useClickOutsideRef';
import type { ReactNode } from 'react';

Expand All @@ -22,11 +23,12 @@ const FloatingActionButton = ({
setIsOpen(false);
});

return (
return createPortal(
<div ref={floatingRef}>
<FloatingButton onClick={toggleMenu}>{icon}</FloatingButton>
{isOpen && <FloatingMenu>{children}</FloatingMenu>}
</div>
</div>,
document.body,
);
};

Expand Down
19 changes: 12 additions & 7 deletions web/src/components/ProgressBar/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,35 @@ const ProgressBar = ({
variant = 'rounded',
...props
}: ProgressBarProps) => {
const hasCaption = Boolean(caption);

return (
<Container {...props}>
<ProgressOverlay variant={variant}>
<Container hasCaption={hasCaption} {...props}>
<ProgressOverlay variant={variant} hasCaption={hasCaption}>
<ProgressGauge
rate={rate}
transitionDuration={transition === true ? 0.5 : transition}
variant={variant}
/>
</ProgressOverlay>
<ProgressCaption>{caption}</ProgressCaption>
{caption && <ProgressCaption>{caption}</ProgressCaption>}
</Container>
);
};

export default ProgressBar;

export const Container = styled.div`
export const Container = styled.div<{ hasCaption: boolean }>`
width: 100%;
height: 10px;
height: ${({ hasCaption }) => (hasCaption ? 'auto' : '10px')};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ProgressBar 높이가 10px로 고정되어 있어서 수정했어요.
의도된 코드라면 알려주세요!

`;

const ProgressOverlay = styled.div<{ variant: 'rounded' | 'rectangular' }>`
const ProgressOverlay = styled.div<{
variant: 'rounded' | 'rectangular';
hasCaption: boolean;
}>`
width: 100%;
height: 100%;
height: ${({ hasCaption }) => (hasCaption ? '10px' : '100%')};
border-radius: ${({ variant }) => (variant === 'rounded' ? '10px' : '0')};
background-color: ${({ theme }) => theme.colors.primaryLight};
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/ProgressBar/ProgressBarSkeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ interface ProgressBarSkeletonProps {

const ProgressBarSkeleton = ({ hasCaption }: ProgressBarSkeletonProps) => {
return (
<Container>
<Container hasCaption={Boolean(hasCaption)}>
<SkeletonBox
width="100%"
height="100%"
height={hasCaption ? '10px' : '100%'}
borderRadius="10px"
as={ProgressGauge}
/>
Expand Down
Loading
Loading