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

[NDD-135] Interview 페이지 UI 구현 #57

Merged
merged 18 commits into from
Nov 16, 2023
Merged
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
143 changes: 0 additions & 143 deletions FE/src/components/interviewPage/InterviewCamera.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions FE/src/components/interviewPage/InterviewFooter.tsx

This file was deleted.

Copy link
Collaborator

Choose a reason for hiding this comment

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

[p-4] 구두로 논의한 내용 메모
image
위와 같은 형식의 아이콘+라벨 형태의 버튼이 다수 존재합니다.
따라서 이를 한번에 관리할 수 있는 foundation 컴포넌트가 있다면 더 깔끔해질 것 같습니다.
이 부분도 나중에 리펙터링 단계에서 적용할 내용이라 메모용으로 남겨놓겠습니다!

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { css } from '@emotion/react';
import { theme } from '@styles/theme';
import Icon from '@foundation/Icon/Icon';
import Typography from '@foundation/Typography/Typography';

type AnswerToggleButtonType = {
handleAnswerToggle: () => void;
};

const AnswerToggleButton: React.FC<AnswerToggleButtonType> = ({
handleAnswerToggle,
}) => {
return (
<div
css={css`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 0.75rem;
`}
onClick={handleAnswerToggle}
>
<Icon id="script" width="2rem" height="2rem" />
<Typography variant={'body1'} color={theme.colors.text.white}>
스크립트
</Typography>
</div>
);
};
export default AnswerToggleButton;
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { theme } from '@styles/theme';
import { css } from '@emotion/react';

import Icon from '@foundation/Icon/Icon';
import Typography from '@foundation/Typography/Typography';

type InterviewExitButtonType = {
handleInterviewExit: () => void;
};

const InterviewExitButton: React.FC<InterviewExitButtonType> = ({
handleInterviewExit,
}) => {
return (
<div
css={css`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 0.75rem;
`}
onClick={handleInterviewExit}
>
<Icon id="close-circle" width="2rem" height="2rem" />
<Typography variant={'body1'} color={theme.colors.text.white}>
나가기
</Typography>
</div>
);
};
export default InterviewExitButton;
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { css } from '@emotion/react';
import InterviewExitButton from './InterviewExitButton';
import AnswerToggleButton from './AnswerToggleButton';
import RecordControlButton from './RecordControlButton';
import NextButton from './NextButton';
import InterviewExitModal from '@components/interviewPage/InterviewModal/InterviewExitModal';
import { useState } from 'react';
import { theme } from '@styles/theme';

type InterviewFooterProps = {
isRecording: boolean;
recordedBlobs: Blob[];
handleStartRecording: () => void;
handleStopRecording: () => void;
handleScript: () => void;
handleDownload: () => void;
};

const InterviewFooter: React.FC<InterviewFooterProps> = ({
isRecording,
recordedBlobs,
handleStartRecording,
handleStopRecording,
handleScript,
handleDownload,
}) => {
const [interviewExitModalIsOpen, setInterviewExitModalIsOpen] =
useState<boolean>(false);

const handleNext = () => {
alert('다음면접을 진행합니다');
if (!isRecording && recordedBlobs.length > 0) handleDownload();
else alert('저장할 수 없습니다');
};

return (
<div
css={css`
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 6.25rem;
background-color: ${theme.colors.surface.black100};
gap: 2.5rem;
`}
>
<InterviewExitButton
handleInterviewExit={() => setInterviewExitModalIsOpen(true)}
/>
<AnswerToggleButton handleAnswerToggle={handleScript} />
<RecordControlButton
isRecording={isRecording}
handleStartRecording={handleStartRecording}
handleStopRecording={handleStopRecording}
/>
<NextButton handleNext={handleNext} />
<InterviewExitModal
isOpen={interviewExitModalIsOpen}
closeModal={() => setInterviewExitModalIsOpen((prev) => !prev)}
/>
</div>
);
};
export default InterviewFooter;
34 changes: 34 additions & 0 deletions FE/src/components/interviewPage/InterviewFooter/NextButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { theme } from '@styles/theme';
import { css } from '@emotion/react';

import Icon from '@foundation/Icon/Icon';
import Typography from '@foundation/Typography/Typography';

type NextButtonType = {
handleNext: () => void;
};

const NextButton: React.FC<NextButtonType> = ({ handleNext }) => {
return (
<div
css={css`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 0.75rem;
`}
onClick={handleNext}
>
<Icon
id="next" // symbol 옆에 작성한 id를 인자로 받습니다.
width="2rem"
height="2rem"
/>
<Typography variant={'body1'} color={theme.colors.text.white}>
다음질문
</Typography>
</div>
);
};
export default NextButton;
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { theme } from '@styles/theme';
import { css } from '@emotion/react';
import Icon from '@foundation/Icon/Icon';
import Typography from '@foundation/Typography/Typography';

type RecordControlButtonType = {
isRecording: boolean;
handleStartRecording: () => void;
handleStopRecording: () => void;
};

const RecordControlButton: React.FC<RecordControlButtonType> = ({
isRecording,
handleStartRecording,
handleStopRecording,
}) => {
return (
<div
css={css`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 0.75rem;
`}
onClick={isRecording ? handleStopRecording : handleStartRecording}
>
{isRecording ? (
<Icon id="record-stop" width="2rem" height="2rem" />
) : (
<Icon id="record-start" width="2rem" height="2rem" />
)}
<Typography variant={'body1'} color={theme.colors.text.white}>
{isRecording ? '녹화종료' : '녹화시작'}
</Typography>
</div>
);
};
export default RecordControlButton;
Loading
Loading