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

[FE][Fix][Refactor] #416 : Confirm 모달 창 UI 중심 맞춤 및 코드 리팩토링 #426

Closed
wants to merge 4 commits into from
Closed
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
42 changes: 20 additions & 22 deletions frontend/src/component/confirm/Confirm.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
interface IConfirmButtonProps {
onClick: () => void;
text: string;
}

const ConfirmButton = (props: IConfirmButtonProps) => (
<button
className="bg-blueGray-800 w-full cursor-pointer rounded-md border-none px-2.5 py-2.5 text-sm font-medium text-white"
onClick={props.onClick}
type="button"
>
{props.text}
</button>
);

interface IConfirmProps {
message: string;
onConfirm: () => void;
Expand All @@ -9,34 +24,17 @@ interface IConfirmProps {

export const Confirm = (props: IConfirmProps) => {
return (
<div className="fixed inset-0 z-[5000] flex items-center justify-center bg-black bg-opacity-70">
<div className="absolute left-1/2 top-1/2 z-[6000] mx-auto flex w-[22rem] max-w-md -translate-x-1/2 flex-col items-center justify-center gap-6 rounded-md bg-gray-50 p-6 text-white shadow-lg">
<div className="fixed inset-0 z-[8000] flex items-center justify-center bg-black bg-opacity-70">
<div className="absolute left-1/2 z-[8100] mx-auto my-0 flex w-[22rem] max-w-md -translate-x-1/2 flex-col items-center justify-center gap-6 rounded-md bg-gray-50 p-6 text-white shadow-lg">
<div className="text-blueGray-800 whitespace-pre py-2 text-center text-lg font-medium">
{props.message}
</div>
{props.type === 'alert' ? (
<div className="flex w-full items-center justify-between gap-4">
<button
className="bg-blueGray-800 w-full cursor-pointer rounded-md border-none px-2.5 py-2.5 text-sm font-medium text-white"
onClick={props.onConfirm}
>
{props.confirmText || '확인'}
</button>
</div>
<ConfirmButton onClick={props.onConfirm} text={props.confirmText || '확인'} />
) : (
<div className="flex w-full items-center justify-between gap-4">
<button
className="bg-blueGray-800 w-full cursor-pointer rounded-md border-none px-2.5 py-2.5 text-sm font-medium text-white"
onClick={props.onConfirm}
>
{props.confirmText || '확인'}
</button>
<button
className="w-full cursor-pointer rounded-md border-none bg-gray-400 px-2.5 py-2.5 text-sm font-medium text-white"
onClick={props.onCancel}
>
{props.cancelText || '취소'}
</button>
<ConfirmButton onClick={props.onConfirm} text={props.confirmText || '확인'} />
<ConfirmButton onClick={props.onCancel} text={props.cancelText || '취소'} />
</div>
)}
</div>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/constants/commonConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export const AppConfig = {
/**
* API SERVER
*/
API_SERVER: 'https://ddara.kro.kr/api',
// API_SERVER: 'http://localhost:3001/api',
// API_SERVER: 'https://ddara.kro.kr/api',
API_SERVER: 'http://localhost:3001/api',
SOCKET_SERVER: 'wss://ddara.kro.kr/ws',
// SOCKET_SERVER: 'ws://localhost:3001',

Expand Down
Loading