Skip to content

Commit

Permalink
[이슈 해결] 홈화면 다크모드시 배경색 이슈, 포켓런 결과란 입력값 넘칠 경우 스크롤 처리, 로그인 없이 포켓런시 토스트 (#59
Browse files Browse the repository at this point in the history
)

* fix: 다크모드시 홈 화면 배경색 바뀌는 이슈 해결

* fix: 포켓런 결과창 입력값 넘칠 경우 스크롤 처리

* fix: 로그인하지 않고 포켓런시 토스트 띄우도록 수정
  • Loading branch information
hailey-hy authored Dec 2, 2024
1 parent 9037ca9 commit db9f69c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ export default function HomePage() {
const HomeWrapper = styled.div`
${({ theme }) => theme.mixins.flexBox()}
gap: 40px;
margin-top: 92px;
padding-top: 92px;
align-items: start;
width: 100vw;
background-color: white;
`;

const HomeContentWrapper = styled.div`
Expand Down
9 changes: 9 additions & 0 deletions src/pages/prompt/components/ExecuteSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import Button from "@/components/common/Button/Button";
import Input from "@/components/common/Input/Input";
import Text from "@/components/common/Text/Text";
import usePocketRun from "@/hooks/mutations/pocketRun/usePocketRun";
import useToast from "@/hooks/useToast";
import { useUser } from "@/hooks/useUser";
import Icon from "@/pages/home/components/common/Icon";
import PocketRunDropdown from "@/pages/prompt/components/PocketRunDropdown";
import PromptTemplateModal from "@/pages/prompt/components/PromptTemplateModal";
Expand Down Expand Up @@ -42,6 +44,9 @@ export const ExecuteSection: React.FC<ExecuteSectionProps> = ({
const prevFormValues = useRef<Record<string, string>>({});
const formValues = watch();

const { userData } = useUser();
const showToast = useToast();

const { mutate: pocketRun, isPending } = usePocketRun({
onSuccess: (res) => {
console.log("Success:", res);
Expand Down Expand Up @@ -74,6 +79,10 @@ export const ExecuteSection: React.FC<ExecuteSectionProps> = ({
alert("클립보드 복사에 실패했습니다.");
});
} else {
if (!userData.isLogin) {
showToast("로그인 후 이용 가능합니다.", "");
return;
}
pocketRun({
promptId: promptId ?? "",
context: values,
Expand Down
7 changes: 6 additions & 1 deletion src/pages/prompt/components/ResultSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ export const ResultSection: React.FC = () => {
</Text>
</ModelChip>
{Object.entries(res.context).map(([key, value]) => (
<Chip key={key}>
<Chip
key={key}
style={{
overflow: "scroll",
}}
>
<Text font="b3_14_reg" color="G_500">
<span>{key}: </span>
{value}
Expand Down

0 comments on commit db9f69c

Please sign in to comment.