Skip to content
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
12 changes: 7 additions & 5 deletions apps/native/src/features/student/home/components/ProblemSet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ interface ProblemItemProps {

interface ProblemListProps {
group: PublishGroup;
unitTitle: string;
index: number;
isExpanded: boolean;
onToggle: () => void;
Expand Down Expand Up @@ -101,7 +102,7 @@ const ProblemItem = ({ title, status = 'NONE' }: ProblemItemProps) => {
);
};

const ProblemList = ({ group, index, onToggle, onActionPress }: ProblemListProps) => {
const ProblemList = ({ group, index, onToggle, onActionPress, unitTitle }: ProblemListProps) => {
const statusMeta = groupStatusMeta[group.progress];
const handlePress = useCallback(() => {
if (!statusMeta.actionable) {
Expand All @@ -113,10 +114,10 @@ const ProblemList = ({ group, index, onToggle, onActionPress }: ProblemListProps
const childProblems = group.childProblems ?? [];
return childProblems.map((child, childIndex) => ({
key: `child-${child.id}-${childIndex}`,
title: `연습 문제 ${childIndex + 1}번`,
title: `${index + 1}-${childIndex + 1}번`,
status: child.progress ?? 'NONE',
}));
}, [group]);
}, [group, index]);

const { Icon, color, bgColor } = ProblemStatusIcon[group.problem.progress ?? 'NONE'];

Expand All @@ -127,12 +128,12 @@ const ProblemList = ({ group, index, onToggle, onActionPress }: ProblemListProps
<View className='flex-row items-center justify-between'>
<View className='flex-col'>
<View className='flex-row items-center'>
<Text className='text-16b mr-[8px] text-black'>{`실전 문제 ${index + 1}번`}</Text>
<Text className='text-16b mr-[8px] text-black'>{`문제 ${index + 1}번`}</Text>
<View className={`rounded-[4px] p-[4px] ${bgColor}`}>
<Icon color={color} size={14} strokeWidth={2.5} />
</View>
</View>
<Text className='text-13r text-gray-700'>문제 단원</Text>
<Text className='text-13r text-gray-700'>{unitTitle}</Text>
</View>
<TextButton variant={statusMeta.buttonVariant} onPress={handlePress} buttonId='start_study'>
{statusMeta.buttonLabel}
Expand Down Expand Up @@ -262,6 +263,7 @@ const ProblemSet = ({ publishDetail, selectedDate, onDateChange }: ProblemSetPro
<ProblemList
group={group}
index={index}
unitTitle={title}
isExpanded={isExpanded}
onToggle={() => handleToggleGroup(key)}
onActionPress={handleGroupAction}
Comment on lines 263 to 269
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@copilot 각 문제들은 동일한 단원 내에 문제들이기에 표시돼야하는 내용은 동일해

Expand Down
11 changes: 3 additions & 8 deletions apps/native/src/navigation/student/components/HomeHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Text, View } from 'react-native';
import { View } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { AlertBellButtonIcon } from '@components/system/icons';
Expand All @@ -8,8 +8,7 @@ import { AnimatedPressable, Container } from '@components/common';
import { useGetNotificationCount } from '@/apis/controller/student/notification';
import { useGetNoticeCount } from '@/apis/controller/student/notice';
import { Bell } from 'lucide-react-native';
import { colors } from '@theme/tokens';
import { getGrade, getName } from '@utils';


type RootNav = NativeStackNavigationProp<StudentRootStackParamList>;

Expand All @@ -23,11 +22,7 @@ const HomeHeader = () => {

return (
<View>
<Container className='flex-row items-center justify-between py-[8px]'>
<View className='flex-col'>
<Text className='text-20b text-gray-900'>안녕하세요, {getName()} 학생!</Text>
<Text className='text-16m text-gray-700'>포인터가 보낸 학습 코멘트가 도착했어요.</Text>
</View>
<Container className='flex-row items-center justify-end py-[4px]'>
<AnimatedPressable
onPress={() => navigation.navigate('Notifications')}
className='h-[48px] w-[48px] items-center justify-center gap-[10px] rounded-[8px] px-[3px] py-[9px]'>
Expand Down
Loading