Skip to content

Commit

Permalink
Refactor: admin change tailwindcss and import
Browse files Browse the repository at this point in the history
  • Loading branch information
swgvenghy committed Aug 2, 2024
1 parent 755a695 commit 02d3293
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/routes/admin-routes.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { Route, Routes } from 'react-router-dom';
import Login from '../ui/pages/admin/login';
import PrivateRoute from './private-route';
import FileList from '../ui/pages/admin/file-list';
import AdminLayout from '../ui/components/molecule/admin/Layout/admin-layout';
import Login from '../ui/pages/admin/login';

const AdminRoutes: React.FC = () => {
const token = sessionStorage.getItem('Authorization');
Expand Down
10 changes: 4 additions & 6 deletions src/ui/pages/admin/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default function Login() {
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setError('');

try {
await handleLogin(email, password);
} catch (err: any) {
Expand All @@ -28,7 +27,6 @@ export default function Login() {
Sign in to your account
</h2>
</div>

<div className="mt-10 sm:mx-auto sm:w-full sm:max-w-sm">
<form className="space-y-6" onSubmit={handleSubmit}>
<div>
Expand All @@ -44,7 +42,7 @@ export default function Login() {
required
value={email}
onChange={(e) => setEmail(e.target.value)}
className="block w-full rounded-md border-0 py-1.5 px-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-lg sm:leading-6"
className="block w-full rounded-md border-0 px-2 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-lg sm:leading-6"
/>
</div>
</div>
Expand All @@ -64,7 +62,7 @@ export default function Login() {
required
value={password}
onChange={(e) => setPassword(e.target.value)}
className="block w-full rounded-md border-0 py-1.5 px-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-lg sm:leading-6"
className="block w-full rounded-md border-0 px-2 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-lg sm:leading-6"
/>
</div>
</div>
Expand All @@ -75,9 +73,9 @@ export default function Login() {
className="flex w-full justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-lg font-semibold leading-6 text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
>
{isLoading ? (
'Sign in'
) : (
<Spin indicator={<LoadingOutlined style={{ color: 'white' }} spin />} size="large" />
) : (
'Sign in'
)}
</button>
</div>
Expand Down

0 comments on commit 02d3293

Please sign in to comment.