fix: Typescript check (#21)
* fix: typescript check error * fix: typescript check error * fix: typescript check error * fix: typescript check error * fix: typescript check error
This commit is contained in:
@@ -7,7 +7,7 @@ import { Pencil, Trash } from 'lucide-react';
|
||||
import { SettingsMessages } from '@/types/settings';
|
||||
import { TokenContext } from '@/utils/TokenProvider';
|
||||
import { deleteProject, fetchProject, updateProject } from '@/utils/projectsControl';
|
||||
import { ProjectType } from '@/types/project';
|
||||
import { ProjectDialogMessages, ProjectType } from '@/types/project';
|
||||
import DeleteConfirmDialog from '@/components/DeleteConfirmDialog';
|
||||
import { useRouter } from '@/src/navigation';
|
||||
import ProjectDialog from '@/components/ProjectDialog';
|
||||
@@ -17,10 +17,11 @@ import { findUser } from '@/utils/usersControl';
|
||||
type Props = {
|
||||
projectId: string;
|
||||
messages: SettingsMessages;
|
||||
projectDialogMessages: ProjectDialogMessages;
|
||||
locale: string;
|
||||
};
|
||||
|
||||
export default function SettingsPage({ projectId, messages, locale }: Props) {
|
||||
export default function SettingsPage({ projectId, messages, projectDialogMessages, locale }: Props) {
|
||||
const context = useContext(TokenContext);
|
||||
const router = useRouter();
|
||||
const [project, setProject] = useState<ProjectType>({
|
||||
@@ -152,7 +153,7 @@ export default function SettingsPage({ projectId, messages, locale }: Props) {
|
||||
editingProject={project}
|
||||
onCancel={() => setIsProjectDialogOpen(false)}
|
||||
onSubmit={onSubmit}
|
||||
messages={messages}
|
||||
projectDialogMessages={projectDialogMessages}
|
||||
/>
|
||||
|
||||
<DeleteConfirmDialog
|
||||
|
||||
@@ -1,29 +1,46 @@
|
||||
import { ProjectDialogMessages } from '@/types/project';
|
||||
import SettingsPage from './SettingsPage';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { SettingsMessages } from '@/types/settings';
|
||||
|
||||
export default function Page({ params }: { params: { projectId: string; locale: string } }) {
|
||||
const t = useTranslations('Settings');
|
||||
const messages = {
|
||||
const messages: SettingsMessages = {
|
||||
projectManagement: t('project_management'),
|
||||
projectName: t('project_name'),
|
||||
projectDetail: t('project_detail'),
|
||||
projectOwner: t('project_owner'),
|
||||
editProject: t('edit_project'),
|
||||
project: t('project'),
|
||||
ifYouMakePublic: t('if_you_make_public'),
|
||||
public: t('public'),
|
||||
publicity: t('publicity'),
|
||||
private: t('private'),
|
||||
update: t('update'),
|
||||
deleteProject: t('delete_project'),
|
||||
delete: t('delete'),
|
||||
close: t('close'),
|
||||
areYouSure: t('are_you_sure'),
|
||||
};
|
||||
|
||||
const projectDialogMessages: ProjectDialogMessages = {
|
||||
project: t('project'),
|
||||
projectName: t('project_name'),
|
||||
projectDetail: t('project_detail'),
|
||||
public: t('public'),
|
||||
private: t('private'),
|
||||
ifYouMakePublic: t('if_you_make_public'),
|
||||
close: t('close'),
|
||||
create: t('create'),
|
||||
update: t('update'),
|
||||
pleaseEnter: t('please_enter'),
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<SettingsPage projectId={params.projectId} messages={messages} locale={params.locale} />
|
||||
<SettingsPage
|
||||
projectId={params.projectId}
|
||||
messages={messages}
|
||||
projectDialogMessages={projectDialogMessages}
|
||||
locale={params.locale}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user