Skip to content
3 changes: 3 additions & 0 deletions public/svg/ic_pencil.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/assets/svg/IcPencil.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { SVGProps } from 'react';
const SvgIcPencil = (props: SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 40 40" {...props}>
<path
stroke="#E3E4E5"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="m25.387 8.72 5.892 5.893M27.888 6.22a4.167 4.167 0 1 1 5.892 5.893L10.833 35.059H5v-5.952z"
/>
</svg>
);
export default SvgIcPencil;
5 changes: 3 additions & 2 deletions src/assets/svg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ export { default as IcCheckboxDefault } from './IcCheckboxDefault';
export { default as IcDropdown } from './IcDropdown';
export { default as IcLock } from './IcLock';
export { default as IcModalDelete } from './IcModalDelete';
export { default as IcSmallTextdelete } from './IcSmallTextdelete';
export { default as IcTextdelete } from './IcTextdelete';
export { default as IcPencil } from './IcPencil';
export { default as IcRadioChecked } from './IcRadioChecked';
export { default as IcRadioDefault } from './IcRadioDefault';
export { default as IcSmallTextdelete } from './IcSmallTextdelete';
export { default as IcTextdelete } from './IcTextdelete';
export { default as IcTooltipDelete } from './IcTooltipDelete';
export { default as IcTriangle } from './IcTriangle';
export { default as Vite } from './Vite';
Empty file.
5 changes: 5 additions & 0 deletions src/page/edit/Edit.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Edit = () => {
return <div>수정하기 뷰</div>;
};

export default Edit;
1 change: 1 addition & 0 deletions src/page/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export { default as Home } from './home/Home';
export { default as Todo } from './todo/Todo';
export { default as Mandal } from './mandal/Mandal';
export { default as History } from './history/History';
export { default as Edit } from './edit/Edit';
60 changes: 60 additions & 0 deletions src/page/mandal/component/EditBtn/EditBtn.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { style } from '@vanilla-extract/css';

import { colors } from '@/style/token';
import { fonts } from '@/style/token/typography.css';

export const editBtnWrapper = style({
position: 'relative',
display: 'flex',
width: '17.5rem',
height: '6.4rem',
padding: '0',
justifyContent: 'flex-end',
alignItems: 'center',
gap: '1rem',
Comment on lines +12 to +14
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

p4) gap 속성 실제로는 justifyContent: 'flex-end'로 인해 사용되지 않는 거 아닌가요 ? 아닐 수도 있는데 그냥 궁금해서 물어봅니다 💭

flexShrink: 0,
borderRadius: '50px',
backgroundColor: colors.grey3,
cursor: 'pointer',
clipPath: 'circle(3.2rem at 14.3rem 3.2rem)',
transition: 'clip-path 0.3s ease',
':hover': {
backgroundImage: colors.gradient05,
clipPath: 'circle(100% at center)',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

p5) 신기하당

},
});

export const iconSvg = style({
width: '4rem',
height: '4rem',
});

export const editIcon = style({
position: 'absolute',
right: 0,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
width: '6.4rem',
height: '6.4rem',
borderRadius: '50%',
backgroundColor: colors.grey3,
color: colors.white01,
zIndex: 1,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

p2) zIndex 는 토큰화해서 분리해놨는데 그 파일에 추가하시면 더 좋을 것 같습니다 😊

Copy link
Copy Markdown
Contributor Author

@Leeyoonji23 Leeyoonji23 Jul 11, 2025

Choose a reason for hiding this comment

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

이 부분을 고민해봤는데… 새봄님이 작성해주신 zIndex 토큰화는 주로 헤더, 모달, 툴팁 등 전역적으로 우선순위가 중요한 컴포넌트에 사용되는 패턴이라, 지금처럼 저만 사용하는 (...?) 수정하기 버튼의 z-index: 1은 굳이 토큰화하지 않고 인라인으로 두는 게 더 적절하다고 판단했습니다!

다른 분들의 의견은 어떠신지 궁금해욥

});

export const editText = style([
fonts.subtitle05,
{
position: 'absolute',
left: '2.4rem',
visibility: 'hidden',
color: colors.white01,
whiteSpace: 'nowrap',
selectors: {
[`${editBtnWrapper}:hover &`]: {
visibility: 'visible',
},
},
},
]);
40 changes: 40 additions & 0 deletions src/page/mandal/component/EditBtn/EditBtn.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { BrowserRouter } from 'react-router-dom';
import type { Meta, StoryObj } from '@storybook/react-vite';

import EditBtn from './EditBtn';

const meta = {
title: 'Mandal/EditBtn',
component: EditBtn,
parameters: {
layout: 'centered',
backgrounds: {
default: 'dark',
},
},
decorators: [
(Story) => (
<BrowserRouter>
<Story />
</BrowserRouter>
),
],
tags: ['autodocs'],
argTypes: {
onClick: { action: 'clicked' },
},
} satisfies Meta<typeof EditBtn>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {
name: '기본',
};

export const Hover: Story = {
name: '호버 시',
parameters: {
pseudo: { hover: true },
},
};
30 changes: 30 additions & 0 deletions src/page/mandal/component/EditBtn/EditBtn.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { useNavigate } from 'react-router-dom';

import * as styles from './EditBtn.css';

import { IcPencil } from '@/assets/svg';
import { PATH } from '@/route/path';

interface EditBtnProps {
onClick?: () => void;
}

const EditBtn = ({ onClick }: EditBtnProps) => {
const navigate = useNavigate();

const handleClick = () => {
onClick?.();
navigate(PATH.EDIT);
};

return (
<button type="button" className={styles.editBtnWrapper} onClick={handleClick}>
<span className={styles.editText}>수정하기</span>
<div className={styles.editIcon}>
<IcPencil className={styles.iconSvg} />
</div>
</button>
);
Comment on lines +20 to +27
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

p4) 접근성을 위해 aria-label이나 title 속성을 추가하는 건 어떤가요 ??

};

export default EditBtn;
6 changes: 5 additions & 1 deletion src/route/MainRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { RouteObject } from 'react-router-dom';

import { PATH } from './path';

import { Home, Todo, Mandal, History } from '@/page';
import { Home, Todo, Mandal, History, Edit } from '@/page';
import { UpperGoal, LowerGoal } from '@/page/todo';
import { Layout } from '@/shared/component/Layout';

Expand Down Expand Up @@ -34,6 +34,10 @@ export const mainRoutes: RouteObject[] = [
path: PATH.HISTORY,
element: <History />,
},
{
path: PATH.EDIT,
element: <Edit />,
},
],
},
];
Loading