Skip to content

Commit 884dd5d

Browse files
committed
fix build and tutorial
1 parent a390e4f commit 884dd5d

File tree

8 files changed

+15
-22
lines changed

8 files changed

+15
-22
lines changed

src/components/modal/NewAppModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export function NewAppModal({ onClose, show }: Props) {
6161
state: { from: location.pathname + location.search },
6262
});
6363
localStorage.removeItem('newUser');
64+
localStorage.setItem('firstAdd', true.toString());
6465

6566
onClose();
6667
}, 1500);

src/components/modal/PreviewAppModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export function PreviewAppModal({ onClose, show }: Props) {
6666
state: { from: location.pathname + location.search },
6767
});
6868
localStorage.removeItem('newUser');
69+
localStorage.setItem('firstAdd', true.toString());
6970

7071
onClose();
7172
}, 1500);

src/components/modal/SettingsTutorialModal/SettingTutorialModal.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const SettingTutorialModal: FC<SettingTutorialModalProps> = ({
2424
}): ReactElement => {
2525
const [step, setStep] = useState<Step>('Start');
2626
const [questionStep, setQuestionStep] = useState('default');
27-
const [selectedQuestionId, setSelectedQuestionId] = useState<string | undefined>();
27+
const [selectedQuestionId] = useState<string | undefined>();
2828
const [animate, setAnimate] = useState(false);
2929
const { appId } = useParams();
3030
const questionsChat = getQuestionsChat(appId);
@@ -46,12 +46,6 @@ export const SettingTutorialModal: FC<SettingTutorialModalProps> = ({
4646
}, 200);
4747
};
4848

49-
const handleSelectQuestion = (questionId: string, category: 'Chat' | 'AI') => {
50-
setSelectedQuestionId(questionId);
51-
const nextStep: Step = category === 'Chat' ? 'ChatQuestion' : 'AIQuestion';
52-
handleChangeStep(nextStep);
53-
};
54-
5549
const goBack = () => {
5650
if (step === 'ChatList' || step === 'AIList') {
5751
handleChangeStep('Start');

src/components/modal/SettingsTutorialModal/components/AnswerStep.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ export const AnswerStep = ({
2727
<div className="btn flex items-start gap-3 text-left p-4 w-full rounded-lg border bg-gray-100 hover:bg-white transition">
2828
<div className="flex flex-col">
2929
<span className="font-medium text-sm">
30-
{filteredAnswer.question.map((part, i) => (
31-
<span key={i}>{part}</span>
32-
))}
30+
{filteredAnswer.question.title}
3331
</span>
3432
</div>
3533
</div>

src/components/modal/SettingsTutorialModal/components/DemoComponentForm.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import classNames from "classnames"
22
import { useForm, SubmitHandler } from "react-hook-form"
33
import { StepLayout } from "./StepLayout"
4-
import CustomInput from "../../../../components/input/Input"
54
import { Box } from "@mui/material"
6-
import CustomButton from "../../../../pages/AuthPage/Button"
75
import { HubspotForm } from "./HubspotForm"
86

97
type FormInputs = {
@@ -22,13 +20,10 @@ export const DemoComponentForm = ({
2220
animate: boolean;
2321
}) => {
2422
const {
25-
register,
2623
handleSubmit,
27-
formState: { errors },
2824
} = useForm<FormInputs>()
2925

30-
const onSubmit: SubmitHandler<FormInputs> = (data) => {
31-
console.log('Form submitted:', data)
26+
const onSubmit: SubmitHandler<FormInputs> = () => {
3227
onClose()
3328
}
3429

src/components/modal/SettingsTutorialModal/components/QuestionsStepDefault.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ export const QuestionsStepDefault = ({
3030
>
3131
<div className="flex flex-col">
3232
<span className="font-medium text-sm">
33-
{question.map((part, i) => (
34-
<span key={i}>{part}</span>
35-
))}
33+
<span>{question.title}</span>
3634
</span>
3735
</div>
3836
</button>

src/components/modal/SettingsTutorialModal/components/StepChooseTutorial.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Rating } from '@mui/material';
21
import clsx from 'clsx';
32
import { ReactElement, useState } from 'react';
43
import { StepLayout } from '.';

src/pages/AppSettings/AppSettings.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { actionUpdateApp } from '../../actions';
1515
import { IconExternalLink } from '../../components/Icons/IconExternalLink';
1616
import { Loading } from '../../components/Loading';
1717
import DeleteAppModal from '../../components/modal/DeleteAppModal';
18-
import InfoAppModal from '../../components/modal/InfoAppModal';
1918
import TabApp from '../../components/TabApp';
2019
import {
2120
deleteApp,
@@ -74,7 +73,7 @@ export default function AppSettings() {
7473

7574
const apps = useAppStore((s) => s.apps);
7675
const currentUser = useAppStore((s) => s.currentUser);
77-
const [isInfo, setIsInfo] = useState(true);
76+
const [isInfo, setIsInfo] = useState(false);
7877
const [app, setApp] = useState<ModelApp | undefined>(undefined);
7978

8079
const [searchParams, setSearchParams] = useSearchParams();
@@ -86,6 +85,14 @@ export default function AppSettings() {
8685
: 0;
8786
const [selectedIndex, setSelectedIndex] = useState(initialTabIndex);
8887

88+
const firstAdd = localStorage.getItem('firstAdd') === 'true';
89+
90+
useEffect(() => {
91+
if (firstAdd) {
92+
setIsInfo(true);
93+
}
94+
}, [firstAdd]);
95+
8996
useEffect(() => {
9097
if (
9198
tabs.includes(tabFromUrl ?? '') &&

0 commit comments

Comments
 (0)