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
70 changes: 31 additions & 39 deletions app/settingsView/settingsView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,46 +154,38 @@ const SettingsView = () => {
/>
);
return (
<>
<SafeAreaView
style={{ ...styles.container, backgroundColor: theme.Black06 }}
>
<View
style={{ ...styles.infoContainer, backgroundColor: theme.Black06 }}
>
<View style={{ ...styles.logo, backgroundColor: theme.Gray02 }}>
<Text>이미지</Text>
</View>
<View style={styles.userTextContainer}>
<Text style={fontStyles.Subtitle.S2.M_130}>
{t('views.settingsView.greeting')}
</Text>
<Text style={fontStyles.Paragraph.P1.R_100}>user</Text>
</View>
<SafeAreaView
style={{ ...styles.container, backgroundColor: theme.Black06 }}
>
<View style={{ ...styles.infoContainer, backgroundColor: theme.Black06 }}>
<View style={{ ...styles.logo, backgroundColor: theme.Gray02 }}>
<Text>이미지</Text>
</View>
<Layout style={styles.layout} level="1">
{data.map((listData, index) => (
<>
<View
style={{ ...styles.divider, backgroundColor: theme.Gray03 }}
/>
<List
data={listData}
key={index}
renderItem={({ item }) => renderItem({ item })}
/>
</>
))}
<ConfirmModal
visible={isDeleteAccountModalVisible}
onConfirm={handleDeleteAccountModalConfirm}
onCancel={handleDeleteAccountModalCancel}
titleKey="views.settingsAccountView.deleteModalTitle"
messageKey="views.settingsAccountView.deleteModalMessage"
/>
</Layout>
</SafeAreaView>
</>
<View style={styles.userTextContainer}>
<Text style={fontStyles.Subtitle.S2.M_130}>
{t('views.settingsView.greeting')}
</Text>
<Text style={fontStyles.Paragraph.P1.R_100}>user</Text>
</View>
</View>
<Layout style={styles.layout} level="1">
{data.map((listData, index) => (
<React.Fragment key={listData[0].id || index}>
<View
style={{ ...styles.divider, backgroundColor: theme.Gray03 }}
/>
<List data={listData} renderItem={renderItem} />
</React.Fragment>
))}
<ConfirmModal
visible={isDeleteAccountModalVisible}
onConfirm={handleDeleteAccountModalConfirm}
onCancel={handleDeleteAccountModalCancel}
titleKey="views.settingsAccountView.deleteModalTitle"
messageKey="views.settingsAccountView.deleteModalMessage"
/>
</Layout>
</SafeAreaView>
);
};

Expand Down
13 changes: 13 additions & 0 deletions hooks/auth/useLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,24 @@ import { useContext } from 'react';
import 'react-native-get-random-values';
import { useDeviceToken } from './useDeviceToken';
import { useStorage } from './useStorage';
import { useCategoryAddMutation } from '../api/useCategoryMutation';
import { useTranslation } from 'react-i18next';

const useLogin = () => {
const storage = useStorage();
const { deviceToken } = useDeviceToken();
const router = useRouter();
const { setIsLoggedIn, setUserId, setAccessToken } = useContext(LoginContext);
const { mutate: addCategory } = useCategoryAddMutation();
const { t } = useTranslation();

const handleAddCategory = ({ categoryName }) => {
const addCategoryData = {
title: categoryName,
color: 1,
};
addCategory({ addCategoryData });
};
const setLoginContextVariable = async (token, loginType, type) => {
const { isJwtIssued, jwtTokenData } = await issueJwtToken(
token,
Expand All @@ -33,6 +44,8 @@ const useLogin = () => {
setUserId(jwtTokenData.userId);
setIsLoggedIn(true);
if (jwtTokenData.isNew) {
handleAddCategory({ categoryName: t('veiws.categoryAddView.init') });
handleAddCategory({ categoryName: t('veiws.categoryAddView.init2') });
router.push('/funnelView/funnelView');
} else {
router.push('/(tabs)');
Expand Down
4 changes: 3 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
"placeholder": "Write a category",
"color": "Color",
"close": "Close",
"title": "Add Category"
"title": "Add Category",
"init": "To Do",
"init2": "Important Task"
},
"categoryEditView": {
"category": "category",
Expand Down
4 changes: 3 additions & 1 deletion locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
"placeholder": "카테고리를 입력해주세요",
"color": "색상",
"close": "닫기",
"title": "카테고리 생성"
"title": "카테고리 생성",
"init": "할일",
"init2": "중요한일"
},
"categoryEditView": {
"category": "카테고리",
Expand Down
Loading