Skip to content
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

[이슈 해결] 홈화면 다크모드시 배경색 이슈, 포켓런 결과란 입력값 넘칠 경우 스크롤 처리, 로그인 없이 포켓런시 토스트 #59

Merged
merged 3 commits into from
Dec 2, 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
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