Skip to content

Commit

Permalink
๐Ÿ› fix: ์•Œ๋ฆผ ์ถ”๊ฐ€ ๋””์ž์ธ ์ˆ˜์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
baegyeong committed Dec 4, 2024
1 parent 1694b78 commit e697f7e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/frontend/src/pages/stock-detail/AddAlarmForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { ALARM_OPTIONS, type AlarmOptionName } from '@/constants/alarmOptions';
import { LoginContext } from '@/contexts/login';
import { useSubscribeAlarm } from '@/hooks/useSubscribeAlarm';
import { cn } from '@/utils/cn';

interface AddAlarmFormProps {
Expand All @@ -24,6 +25,7 @@ export const AddAlarmForm = ({ className }: AddAlarmFormProps) => {
const { stockId = '' } = useParams();
const { mutate } = usePostCreateAlarm();
const { isLoggedIn } = useContext(LoginContext);
const { subscribeAlarm } = useSubscribeAlarm();

const [alarmInfo, setAlarmInfo] = useState<AlarmInfo>({
option: ALARM_OPTIONS[0].name,
Expand All @@ -44,6 +46,7 @@ export const AddAlarmForm = ({ className }: AddAlarmFormProps) => {
return;
}

subscribeAlarm();
const { option, value, endDate } = alarmInfo;

const requestData: PostCreateAlarmRequest = {
Expand Down Expand Up @@ -71,10 +74,10 @@ export const AddAlarmForm = ({ className }: AddAlarmFormProps) => {
<h2 className="display-bold20 text-center font-bold">์•Œ๋ฆผ ์ถ”๊ฐ€</h2>
<form
onSubmit={handleSubmit}
className="text-dark-gray flex flex-col items-center gap-16"
className="text-dark-gray flex h-full flex-col items-center justify-between gap-16"
>
<div className="flex flex-col gap-16">
<article className="flex flex-col gap-2">
<article className="flex flex-col gap-3">
<p className="display-bold16">์–ธ์ œ ์•Œ๋ฆผ์„ ๋ณด๋‚ผ๊นŒ์š”?</p>
<section className="flex gap-5">
<select
Expand Down Expand Up @@ -104,15 +107,15 @@ export const AddAlarmForm = ({ className }: AddAlarmFormProps) => {
/>
</section>
</article>
<article className="flex flex-col gap-2">
<article className="flex flex-col gap-3">
<p className="display-bold16">์–ธ์ œ๊นŒ์ง€ ์•Œ๋ฆผ์„ ๋ณด๋‚ผ๊นŒ์š”?</p>
<Input
type="date"
value={alarmInfo.endDate}
onChange={(e) =>
setAlarmInfo((prev) => ({ ...prev, endDate: e.target.value }))
}
className="display-medium14"
className="display-medium14 w-full"
/>
</article>
</div>
Expand Down

0 comments on commit e697f7e

Please sign in to comment.