Skip to content

feat: mypage nickname 제약 처리 #82

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

Merged
merged 4 commits into from
Sep 25, 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
4 changes: 2 additions & 2 deletions packages/react-native/src/apis/queries/useHomeSpotQuery.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useQuery } from '@tanstack/react-query';
import { useSuspenseQuery } from '@tanstack/react-query';
import { ServerResponse } from '@/types/response';
import useAuthAxios from '../useAuthAxios';
import { SpotCardData } from '@/types/spot';
Expand All @@ -14,7 +14,7 @@ export default function useHomeSpotQuery() {
return result.data.result;
};

return useQuery({
return useSuspenseQuery({
queryKey: [QUERY_KEYS.HOME],
queryFn: getHomeSpot,
});
Expand Down
3 changes: 3 additions & 0 deletions packages/react-native/src/components/common/CitySelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export default function CitySelect({
selectedTextStyle={{
color: 'white',
}}
itemTextStyle={{
color: 'black',
}}
data={Object.entries(cities).map(([label, value]) => ({
label,
value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function SpotDetailBottomSheet({
const { data } = useSpotDetailQuery({ id: selectedDetailSpotId });
return (
<BottomSheet
snapPoints={['100%']}
snapPoints={['99%']}
handleClose={onClose}
isShow={Boolean(selectedDetailSpotId)}
>
Expand Down
4 changes: 3 additions & 1 deletion packages/react-native/src/pages/MyPage/EditProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ export default function EditProfile({ navigation }: EditProfileProps) {
} = useProfileImageMutation();

const [nickname, setNickname] = useState(route.params.nickname);
const isCorrect = nickname.length > 0 && nickname.length < 8;

const handleChangeProfile = async () => {
if (nickname) {
if (isCorrect) {
await patchMutate(nickname);
}
if (photoAsset?.uri) {
Expand Down Expand Up @@ -59,6 +60,7 @@ export default function EditProfile({ navigation }: EditProfileProps) {
placeholder="닉네임을 입력하세요."
value={nickname}
onChange={(newNickName) => setNickname(newNickName)}
isCorrect={isCorrect}
/>
</View>
</View>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/src/pages/Signup/Nickname.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function NickName({ navigation }: NicknameProps) {
const [nickname, setNickname] = useState('');
const { postMutate, isPostLoading } = useNicknameMutation();

const isCorrect = nickname.length > 0 && nickname.length < 7;
const isCorrect = nickname.length > 0 && nickname.length < 8;

const handleSubmit = async () => {
if (isCorrect) {
Expand Down
Loading