Skip to content

Commit

Permalink
feat: 배포 환경 데모 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
guesung committed Jul 9, 2024
1 parent d729eb6 commit 6a0697b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useSearchParams } from 'next/navigation';
import { ElementType, KeyboardEventHandler } from 'react';

import { useJoinContext } from '../../../components/JoinContext';
Expand All @@ -15,6 +16,7 @@ import { Spacing } from '@/components/Spacing';
import { TextFieldController } from '@/components/TextField';
import { DEMO_ID } from '@/constants';
import { regexr } from '@/constants/regexr';
import { useDidMount } from '@/hooks/common/useDidMount';
import useToast from '@/hooks/useModal/useToast';

interface NumberSectionProps {
Expand All @@ -30,6 +32,13 @@ export default function NumberForm({ inputStatus, setInputStatus }: NumberSectio
const { start: timerStart, status: timerStatus } = useTimerContext();
const { openToast } = useToast();
const { mutate: mutateLogin } = useLoginMutation();
const searchParams = useSearchParams();

useDidMount(() => {
if (searchParams.get('demo')) {
setValue('phoneNumber', '010-8969-5610', { shouldValidate: true });
}
});

const handleInputChange = (
e: React.ChangeEvent<HTMLInputElement> | React.KeyboardEvent<HTMLInputElement>
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export const DAY_OF_WEEK = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];
export const GOOGLE_API_KEY = process.env.NEXT_PUBLIC_GOOGLE_MAP_API_KEY;
export const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN || '';
export const GA_TRACKING_ID = process.env.NEXT_PUBLIC_GOOGLE_ID;
export const DEMO_ID = process.env.NEXT_PUBLIC_DEMO_ID;
export const DEMO_ID = process.env.NEXT_PUBLIC_DEMO_ID ?? '';

0 comments on commit 6a0697b

Please sign in to comment.