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

feat: 서브 타이틀 반영 #212

Merged
merged 3 commits into from
Sep 13, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ export type QuestionType = {
meetingQuestionId: number;
questionType: 'MULTIPLE_DESCRIPTIVE_CHOICE' | 'MULTIPLE_SHORT_CHOICE' | 'SINGLE_CHOICE';
content: {
questionTitle?: {
subTitle: string;
mainTitle: string;
fullTitle: string;
};
questionId: number;
questionImageFileUrl: string;
title: string;
Expand All @@ -12,19 +17,3 @@ export type QuestionType = {
};

export type QuestionResponseType = QuestionType | undefined;

// {
// "meetingQuestionId": 0,
// "questionType": "SINGLE_CHOICE",
// "content": {
// "questionId": 1,
// "questionImageFileUrl": "https://example.com",
// "title": "갖고 싶은 초능력은?",
// "answers": [
// {
// "answerId": 1,
// "content": "분신술"
// }
// ]
// }
// }
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import { colors } from '@sambad/sds/theme';
import { ReactNode } from 'react';

interface AnswerQuestionProps {
qustionSubTitle: string;
questionTitle: string;
answers: ReactNode;
}

export const AnswerQuestion = ({ questionTitle, answers }: AnswerQuestionProps) => {
export const AnswerQuestion = ({ qustionSubTitle, questionTitle, answers }: AnswerQuestionProps) => {
return (
<>
<div css={{ padding: '20px' }}>
Expand All @@ -20,7 +21,7 @@ export const AnswerQuestion = ({ questionTitle, answers }: AnswerQuestionProps)
css={{ fontWeight: `${fontWeightVariants.regular} !important` }}
color={colors.black}
>
우리 모임원들은
{qustionSubTitle}
</Txt>
<Txt as="p" typography="heading1" color={colors.black}>
{questionTitle}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const buttonBaseStyle = css({

const buttonStyles: Record<'selected' | 'default', Interpolation<Theme>> = {
selected: {
width: '100%',
borderRadius: '24px',
height: '90px',
backgroundColor: colors.primary500,
Expand All @@ -75,6 +76,7 @@ const buttonStyles: Record<'selected' | 'default', Interpolation<Theme>> = {
color: colors.white,
},
default: {
width: '100%',
borderRadius: '24px',
height: '90px',
backgroundColor: colors.grey400,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ interface MultipleDescriptiveAnswerQuestionProps {

const buttonStyles: Record<'selected' | 'default', Attributes['css']> = {
selected: {
width: '100%',
border: 'none',
borderRadius: borderRadiusVariants.large,
height: '64px',
backgroundColor: colors.primary500,
color: colors.white,
},
default: {
width: '100%',
border: 'none',
borderRadius: borderRadiusVariants.large,
height: '64px',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ interface MultipleShortAnswerQuestionProps {

const buttonStyles: Record<'selected' | 'default', Attributes['css']> = {
selected: {
width: '100%',
border: 'none',
borderRadius: borderRadiusVariants.large,
height: '64px',
backgroundColor: colors.primary500,
},
default: {
width: '100%',
border: 'none',
borderRadius: borderRadiusVariants.large,
height: '64px',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import { useAnswerQuestionService } from '../services/useAnswerQuestionService';
export const AnswerQuestionContainer = () => {
const { question, questionType, isNotAnswerd, moveToCommentPage, handleAnswerList } = useAnswerQuestionService();

const subTitle = question?.questionTitle?.subTitle ?? '우리 모임원들은';
const mainTitle = question?.questionTitle?.mainTitle;
const answers = question?.answers;

return (
<section
css={{
Expand All @@ -16,11 +20,12 @@ export const AnswerQuestionContainer = () => {
}}
>
<AnswerQuestion
questionTitle={question?.title ?? ''}
qustionSubTitle={subTitle}
questionTitle={mainTitle ?? ''}
answers={
<AnswerOptions
questionType={questionType}
answerOptionList={question?.answers ?? []}
answerOptionList={answers ?? []}
onChangeAnswer={handleAnswerList}
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const Modal = ({ isOpen, onClose, children, footer, ...rest }: PropsWithC

return createPortal(
<div
css={{ width: '100%', height: '100%', background: '#00000066', position: 'fixed', top: 0 }}
css={{ width: '100%', height: '100%', background: '#00000066', position: 'fixed', top: 0, zIndex: 100 }}
onClick={handleClose}
>
<div
Expand All @@ -55,6 +55,7 @@ export const Modal = ({ isOpen, onClose, children, footer, ...rest }: PropsWithC
transform: 'translate(-50%, -50%)',
backgroundColor: colors.white,
borderRadius: borderRadiusVariants.medium,
zIndex: 1000,
}}
{...rest}
>
Expand Down