refactor: remove authentication check and unused imports from CreatePost and EditPost pages
All checks were successful
CI - Build and Push / Build and Push Docker Image (push) Successful in 17s

This commit is contained in:
2025-10-26 18:33:31 +08:00
parent 1f6bb77691
commit 9c263d0f51
2 changed files with 2 additions and 14 deletions

View File

@@ -1,18 +1,16 @@
import { useState, useRef } from 'react';
import { Navigate, useNavigate } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';
import Layout from '../components/Layout';
import BlogEditor, { type BlogEditorRef } from '../blog/BlogEditor';
import { uploadImage, createBlogPost } from '../blog/api';
import { Toast } from '../components/Toast';
import { useToast } from '../hooks/useToast';
import { useAuth } from '../contexts/AuthContext';
import '../App.css';
function CreatePost() {
const navigate = useNavigate();
const editorRef = useRef<BlogEditorRef>(null);
const { toasts, removeToast, success, error } = useToast();
const { isAuthenticated } = useAuth();
const [title, setTitle] = useState('');
const [coverImage, setCoverImage] = useState<string | null>(null);
const [coverImageKey, setCoverImageKey] = useState<string>('');
@@ -101,10 +99,6 @@ function CreatePost() {
}
};
if (!isAuthenticated) {
return <Navigate to="/blog" replace />;
}
return (
<Layout currentPage="blog">
<Toast toasts={toasts} onRemove={removeToast} />