structuring

This commit is contained in:
2025-02-19 20:23:34 +01:00
parent 4af62033c6
commit 4fa5d97ae9
10 changed files with 38 additions and 79 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ import {
import { PlusCircle, Trash } from 'lucide-react';
import { format, parse } from 'date-fns';
import PostDialog, { today } from '@/components/postDialog';
import PostDialog, { today } from './postDialog';
import axios from 'axios';
import Cookies from 'js-cookie';
import { Schedule } from '@/utils';
@@ -18,11 +18,11 @@ import { Button } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import { format } from 'date-fns';
import { CalendarIcon } from 'lucide-react';
import { Calendar } from './ui/calendar';
import { Calendar } from '@/components/ui/calendar';
import TimeSelect from './timeSelect';
import { CalendarEventExternal } from '@schedule-x/calendar';
import { Textarea } from './ui/textarea';
import { Label } from './ui/label';
import { Textarea } from '@/components/ui/textarea';
import { Label } from '@/components/ui/label';
import { useState } from 'react';
import axios from 'axios';
import { Schedule } from '@/utils';
@@ -1,8 +1,8 @@
'use client';
import { PlatformKind } from '@/utils';
import { Card, CardContent, CardHeader, CardTitle } from './ui/card';
import { PlatformIcon } from './icons';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { PlatformIcon } from '@/components/icons';
export default function AccountStatus({
accounts,
@@ -1,7 +1,7 @@
'use client';
import { Checkbox } from './ui/checkbox';
import { Card, CardContent, CardHeader, CardTitle } from './ui/card';
import { Checkbox } from '@/components/ui/checkbox';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
export default function Ideas({
ideas,
+5 -5
View File
@@ -1,7 +1,7 @@
import AccountStatus from '@/components/accountStatus';
import Engagement from '@/components/engagement';
import Ideas from '@/components/ideas';
import RecentPosts from '@/components/recentPosts';
import AccountStatus from './accountStatus';
import Engagement from './engagement';
import Ideas from './ideas';
import RecentPosts from './recentPosts';
import App from '@/components/app';
import { Calendar } from '@/components/ui/calendar';
import { cookies } from 'next/headers';
@@ -12,7 +12,7 @@ async function getSession(sessionId: string) {
try {
return (
await axios.get(`http:/localhost:3000/api/session/?id=${sessionId}`)
).data;
).data.dashboard;
} catch {
redirect('/login');
}
@@ -1,6 +1,6 @@
import { PlatformKind } from '@/utils';
import { Card, CardContent, CardHeader, CardTitle } from './ui/card';
import { PlatformIcon } from './icons';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { PlatformIcon } from '@/components/icons';
import { format } from 'date-fns';
export default function RecentPosts({
+6 -5
View File
@@ -16,8 +16,7 @@ export default function Login() {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const handleLogin = () => {
async () => {
const handleLogin = async () => {
try {
const { sessionId } = (
await axios.post('/api/session/', {
@@ -38,8 +37,6 @@ export default function Login() {
});
}
};
};
return (
<div className="bg-white dark:bg-black w-full h-screen flex justify-center items-center">
<div className="text-center">
@@ -60,7 +57,11 @@ export default function Login() {
type="password"
placeholder="Your password"
onChange={(event) => setPassword(event.target.value)}
onClick={handleLogin}
onKeyDown={async (e) => {
if (e.key === 'Enter') {
await handleLogin();
}
}}
/>
<Button className="mt-5 w-80 mx-auto" onClick={handleLogin}>
-42
View File
@@ -1,47 +1,5 @@
import { PlatformKind } from '@/utils';
export function XMark() {
return (
<svg
aria-hidden="true"
focusable="false"
data-prefix="fas"
data-icon="xmark"
className="svg-inline--fa fa-xmark text-red-500 mr-2"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 384 512"
width="14"
>
<path
fill="currentColor"
d="M377 105c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L192 177.9 63.4 48.5c-9.4-9.4-24.6-9.4-33.9 0L6.9 71.1c-9.4 9.4-9.4 24.6 0 33.9L135.3 256 6.9 377c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0L192 334.1 320.6 463.5c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9L248.7 256 377 105z"
></path>
</svg>
);
}
export function Check() {
return (
<svg
aria-hidden="true"
focusable="false"
data-prefix="fas"
data-icon="check"
className="svg-inline--fa fa-check text-green-500 mr-2"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 448 512"
width="14"
>
<path
fill="currentColor"
d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"
></path>
</svg>
);
}
interface PlatformProps extends React.SVGProps<SVGSVGElement> {
platform: PlatformKind;
}