Skip to content

Commit

Permalink
Merge: Fix -> Develop
Browse files Browse the repository at this point in the history
Page layout 수정
  • Loading branch information
chominju02 authored Nov 15, 2024
2 parents 11ae642 + 398cfb7 commit 5b02329
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 30 deletions.
5 changes: 3 additions & 2 deletions src/hooks/CharacterSettingPage/useSettingCharacter.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { useState } from "react";

import { acquirePet, updatePetName } from "@/apis/pet/pet";

export const useSettingCharacter = (type: "new" | "edit") => {
const [characterName, setCharacterName] = useState<string>("character");
const [characterName, setCharacterName] = useState<string>("단이");
const [message, setMessage] = useState<string>("");

const handleCharacterName = async (name: string) => {
Expand All @@ -29,4 +30,4 @@ export const useSettingCharacter = (type: "new" | "edit") => {
};

return { characterName, message, setCharacterName, handleCharacterName };
};
};
3 changes: 2 additions & 1 deletion src/hooks/CharacterStartPage/useGetCharacterName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const useGetCharacterName = () => {
useEffect(() => {
fetchData();
}, [fetchData]);
console.log(data);

return { data };
return { data, fetchData };
};
9 changes: 6 additions & 3 deletions src/pages/CharacterSettingPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { useRef, useCallback, useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";

import { Button } from "@/components/Button";
import { Temp } from "@/components/Temp";
import { Text } from "@/components/Text";

import { useSettingCharacter } from "@/hooks/CharacterSettingPage/useSettingCharacter";

import * as Styles from "./index.style";

export const CharacterSettingPage = () => {
Expand All @@ -24,10 +27,10 @@ export const CharacterSettingPage = () => {
}
}, [message]);

const updateName = useCallback(() => {
const updateName = useCallback(async () => {
if (inputRef.current) {
const newName = inputRef.current.value;
handleCharacterName(newName); // 새 이름 설정 및 API 호출
await handleCharacterName(newName); // 새 이름 설정 및 API 호출
}
handlePopUp();
}, [handleCharacterName, handlePopUp]);
Expand Down Expand Up @@ -85,4 +88,4 @@ export const CharacterSettingPage = () => {
)}
</Styles.Container>
);
};
};
4 changes: 2 additions & 2 deletions src/pages/CheckEndPage/index.style.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import styled from "@emotion/styled";

export const Container = styled.div`
max-width: 400px;
height: 100vh;
max-width: 440px;
height: min(100vh, 956px);
margin: 0 auto;
background-color: var(--color-primary);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/CheckPage/index.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export const Container = styled.div`
align-items: center;
gap: 30px;
max-width: 400px;
height: 100%;
max-width: 440px;
height: min(100vh, 956px);
margin: 0 auto;
padding-bottom: 30px;
Expand Down
6 changes: 3 additions & 3 deletions src/pages/CheckStartPage/index.style.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import styled from "@emotion/styled";

export const Container = styled.div`
max-width: 400px;
height: 100vh;
max-width: 440px;
height: min(100vh, 956px);
margin: 0 auto;
background-color: var(--color-primary);
display: flex;
flex-direction: column;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MainPage/index.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styled from "@emotion/styled";

export const Container = styled.div`
max-width: 400px;
height: 100%;
height: 100vh;
margin: 0 auto;
display: flex;
Expand Down
12 changes: 6 additions & 6 deletions src/pages/MemoPage/index.style.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import styled from "@emotion/styled";

import { Text } from "../../components/Text";

export const ScreenContainer = styled.div`
display: flex;
flex-direction: column;
align-items: center;
max-width: 400px;
height: 100vh;
max-width: 440px;
height: min(100vh, 956px);
margin: 0 auto;
gap: 30px;
`;
Expand Down Expand Up @@ -66,8 +67,7 @@ export const DateItem = styled.div<{ isSelected: boolean; isToday: boolean }>`
cursor: pointer;
font-size: 16px;
color: ${({ isSelected }) => (isSelected ? "#ffffff" : "#333")};
background-color: ${({ isSelected, isToday }) =>
isSelected ? "#4caf50" : isToday ? "#e0e0e0" : "transparent"};
background-color: ${({ isSelected, isToday }) => (isSelected ? "#4caf50" : isToday ? "#e0e0e0" : "transparent")};
border-radius: 20px;
padding: 5px 10px;
min-width: 60px;
Expand Down Expand Up @@ -126,7 +126,7 @@ export const AddButton = styled.button`
cursor: pointer;
background-color: #4caf50;
color: #ffffff;
border-radius: 30px;
width: 70px;
height: 48px;
Expand Down Expand Up @@ -189,4 +189,4 @@ export const ButtonContainer = styled.div`
display: flex;
justify-content: space-between;
gap: 10px;
`;
`;
9 changes: 4 additions & 5 deletions src/pages/MyPage/index.style.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import styled from "@emotion/styled";

export const Container = styled.div`
max-width: 400px;
height: 100vh;
max-height: 956px;
max-width: 440px;
height: min(100vh, 956px);
margin: 0 auto;
display: flex;
flex-direction: column;
align-items: center;
Expand Down Expand Up @@ -57,7 +56,7 @@ export const EditButton = styled.button`
margin-left: 10px;
font-size: 12px;
font-weight: bold;
padding: 4px 8px;
padding: 4px 8px;
cursor: pointer;
background-color: var(--color-primary);
color: var(--color-white);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/RecordPage/index.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import leftArrow from "@/assets/leftArrow.png";
import rightArrow from "@/assets/rightArrow.png";

export const Container = styled.div`
max-width: 400px;
height: 100%;
max-width: 440px;
height: min(100vh, 956px);
margin: 0 auto;
display: flex;
Expand Down
6 changes: 3 additions & 3 deletions src/pages/ResultPage/index.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import styled from "@emotion/styled";

export const Container = styled.div`
max-width: 400px;
height: 100vh;
max-width: 440px;
height: min(100vh, 956px);
margin: 0 auto;
display: flex;
flex-direction: column;
align-items: center;
Expand Down

0 comments on commit 5b02329

Please sign in to comment.