이어서 SetupProfile이라는 컴포넌트를 만들어서 사용자가 프로필 사진과 닉네임을 입력할 수 있게 할 겁니다. 프로필 사진은 나중에 구현하고, 우선 사용자 닉네임 부분을 구현하겠습니다.
components/SetupProfile.js
import {useNavigation, useRoute} from '@react-navigation/native'; import React, {useState} from 'react'; import {StyleSheet, View} from 'react-native'; import {signOut} from '../lib/auth'; import {createUser} from '../lib/users'; import BorderedInput from './BorderedInput'; import CustomButton from './CustomButton'; function () { const [displayName, setDisplayName] (''); const navigation (); const {params} (); const {uid} params {}; const () => { ({ id: uid, displayName, photoURL: null, }); }; const () => { (); navigation. (); }; return ( <View style={styles.block}> <View style={styles.circle} /> <View style={styles.form}> <BorderedInput placeholder="닉네임" value={displayName} onChangeText={setDisplayName} onSubmitEditing={onSubmit} returnKeyType="next" /> <View style={styles.buttons}> <CustomButton title="다음" onPress={onSubmit} hasMarginBottom /> <CustomButton title="취소" onPress={onCancel} theme="secondary" /> </View> </View> </View> ); } const styles StyleSheet. ({ block: { alignItems: 'center', marginTop: 24, paddingHorizontal: 16, width: '100%', }, circle: { backgroundColor: '#cdcdcd', borderRadius: 64, width: 128, height: 128, }, form: { marginTop: 16, width: '100%', }, buttons: { marginTop: 48, }, }); export default SetupProfile;