Skip to content

Commit

Permalink
fix: misplaced component
Browse files Browse the repository at this point in the history
Signed-off-by: Azanul <azanulhaque@gmail.com>
  • Loading branch information
Azanul committed Jun 5, 2024
1 parent 83f6528 commit e16622e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import {
createBrowserRouter,
RouterProvider,
} from "react-router-dom";
import WuphfForm from './components/WuphfForm';
import Wuphf from './features/wuphf/Wuphf';
import AuthForm from './components/AuthForm';
import ProtectedRoute from './components/ProtectedRoute';

const router = createBrowserRouter([
{
path: "/",
element: <ProtectedRoute exact path="/" component={WuphfForm} />,
element: <ProtectedRoute exact path="/" component={Wuphf} />,
},
{
path: "/login",
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/components/WuphfForm.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import React, { useState } from 'react';
import { useDispatch } from 'react-redux';
import { sendWuphf } from '../features/wuphf/wuphfSlice';

const WuphfForm: React.FC = () => {
const dispatch = useDispatch();
const [message, setMessage] = useState('');
const [status, setStatus] = useState('');

Expand All @@ -18,6 +21,7 @@ const WuphfForm: React.FC = () => {
if (response.ok) {
setStatus('Message sent successfully');
setMessage('');
dispatch(sendWuphf(message));
} else {
setStatus('Failed to send message');
}
Expand Down

0 comments on commit e16622e

Please sign in to comment.