hackmate-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +420 -0
- package/dist/api.d.ts +3 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +14 -0
- package/dist/api.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +172 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/ComingSoon.d.ts +7 -0
- package/dist/commands/ComingSoon.d.ts.map +1 -0
- package/dist/commands/ComingSoon.js +4 -0
- package/dist/commands/ComingSoon.js.map +1 -0
- package/dist/commands/Config.d.ts +8 -0
- package/dist/commands/Config.d.ts.map +1 -0
- package/dist/commands/Config.js +42 -0
- package/dist/commands/Config.js.map +1 -0
- package/dist/commands/DataExport.d.ts +2 -0
- package/dist/commands/DataExport.d.ts.map +1 -0
- package/dist/commands/DataExport.js +49 -0
- package/dist/commands/DataExport.js.map +1 -0
- package/dist/commands/Discover.d.ts +2 -0
- package/dist/commands/Discover.d.ts.map +1 -0
- package/dist/commands/Discover.js +93 -0
- package/dist/commands/Discover.js.map +1 -0
- package/dist/commands/MatchList.d.ts +2 -0
- package/dist/commands/MatchList.d.ts.map +1 -0
- package/dist/commands/MatchList.js +118 -0
- package/dist/commands/MatchList.js.map +1 -0
- package/dist/commands/Presence.d.ts +7 -0
- package/dist/commands/Presence.d.ts.map +1 -0
- package/dist/commands/Presence.js +52 -0
- package/dist/commands/Presence.js.map +1 -0
- package/dist/commands/Privacy.d.ts +2 -0
- package/dist/commands/Privacy.d.ts.map +1 -0
- package/dist/commands/Privacy.js +38 -0
- package/dist/commands/Privacy.js.map +1 -0
- package/dist/commands/Settings.d.ts +2 -0
- package/dist/commands/Settings.d.ts.map +1 -0
- package/dist/commands/Settings.js +38 -0
- package/dist/commands/Settings.js.map +1 -0
- package/dist/commands/Stats.d.ts +2 -0
- package/dist/commands/Stats.d.ts.map +1 -0
- package/dist/commands/Stats.js +38 -0
- package/dist/commands/Stats.js.map +1 -0
- package/dist/commands/admin/admin.logic.d.ts +12 -0
- package/dist/commands/admin/admin.logic.d.ts.map +1 -0
- package/dist/commands/admin/admin.logic.js +41 -0
- package/dist/commands/admin/admin.logic.js.map +1 -0
- package/dist/commands/admin/admin.screen.d.ts +10 -0
- package/dist/commands/admin/admin.screen.d.ts.map +1 -0
- package/dist/commands/admin/admin.screen.js +19 -0
- package/dist/commands/admin/admin.screen.js.map +1 -0
- package/dist/commands/admin/index.d.ts +8 -0
- package/dist/commands/admin/index.d.ts.map +1 -0
- package/dist/commands/admin/index.js +8 -0
- package/dist/commands/admin/index.js.map +1 -0
- package/dist/commands/auth/Logout.d.ts +2 -0
- package/dist/commands/auth/Logout.d.ts.map +1 -0
- package/dist/commands/auth/Logout.js +15 -0
- package/dist/commands/auth/Logout.js.map +1 -0
- package/dist/commands/auth/Verify.d.ts +2 -0
- package/dist/commands/auth/Verify.d.ts.map +1 -0
- package/dist/commands/auth/Verify.js +16 -0
- package/dist/commands/auth/Verify.js.map +1 -0
- package/dist/commands/auth/auth.logic.d.ts +31 -0
- package/dist/commands/auth/auth.logic.d.ts.map +1 -0
- package/dist/commands/auth/auth.logic.js +147 -0
- package/dist/commands/auth/auth.logic.js.map +1 -0
- package/dist/commands/auth/index.d.ts +3 -0
- package/dist/commands/auth/index.d.ts.map +1 -0
- package/dist/commands/auth/index.js +17 -0
- package/dist/commands/auth/index.js.map +1 -0
- package/dist/commands/auth/login.screen.d.ts +15 -0
- package/dist/commands/auth/login.screen.d.ts.map +1 -0
- package/dist/commands/auth/login.screen.js +10 -0
- package/dist/commands/auth/login.screen.js.map +1 -0
- package/dist/commands/auth/signup.screen.d.ts +23 -0
- package/dist/commands/auth/signup.screen.d.ts.map +1 -0
- package/dist/commands/auth/signup.screen.js +13 -0
- package/dist/commands/auth/signup.screen.js.map +1 -0
- package/dist/commands/auth/verify.logic.d.ts +11 -0
- package/dist/commands/auth/verify.logic.d.ts.map +1 -0
- package/dist/commands/auth/verify.logic.js +56 -0
- package/dist/commands/auth/verify.logic.js.map +1 -0
- package/dist/commands/chat/ChatList.d.ts +2 -0
- package/dist/commands/chat/ChatList.d.ts.map +1 -0
- package/dist/commands/chat/ChatList.js +63 -0
- package/dist/commands/chat/ChatList.js.map +1 -0
- package/dist/commands/chat/chat.logic.d.ts +15 -0
- package/dist/commands/chat/chat.logic.d.ts.map +1 -0
- package/dist/commands/chat/chat.logic.js +139 -0
- package/dist/commands/chat/chat.logic.js.map +1 -0
- package/dist/commands/chat/chat.screen.d.ts +12 -0
- package/dist/commands/chat/chat.screen.d.ts.map +1 -0
- package/dist/commands/chat/chat.screen.js +12 -0
- package/dist/commands/chat/chat.screen.js.map +1 -0
- package/dist/commands/chat/index.d.ts +8 -0
- package/dist/commands/chat/index.d.ts.map +1 -0
- package/dist/commands/chat/index.js +9 -0
- package/dist/commands/chat/index.js.map +1 -0
- package/dist/commands/group/group.logic.d.ts +26 -0
- package/dist/commands/group/group.logic.d.ts.map +1 -0
- package/dist/commands/group/group.logic.js +73 -0
- package/dist/commands/group/group.logic.js.map +1 -0
- package/dist/commands/group/group.screen.d.ts +19 -0
- package/dist/commands/group/group.screen.d.ts.map +1 -0
- package/dist/commands/group/group.screen.js +22 -0
- package/dist/commands/group/group.screen.js.map +1 -0
- package/dist/commands/group/index.d.ts +9 -0
- package/dist/commands/group/index.d.ts.map +1 -0
- package/dist/commands/group/index.js +8 -0
- package/dist/commands/group/index.js.map +1 -0
- package/dist/commands/network/index.d.ts +8 -0
- package/dist/commands/network/index.d.ts.map +1 -0
- package/dist/commands/network/index.js +8 -0
- package/dist/commands/network/index.js.map +1 -0
- package/dist/commands/network/network.logic.d.ts +12 -0
- package/dist/commands/network/network.logic.d.ts.map +1 -0
- package/dist/commands/network/network.logic.js +69 -0
- package/dist/commands/network/network.logic.js.map +1 -0
- package/dist/commands/network/network.screen.d.ts +10 -0
- package/dist/commands/network/network.screen.d.ts.map +1 -0
- package/dist/commands/network/network.screen.js +17 -0
- package/dist/commands/network/network.screen.js.map +1 -0
- package/dist/commands/notification/index.d.ts +7 -0
- package/dist/commands/notification/index.d.ts.map +1 -0
- package/dist/commands/notification/index.js +8 -0
- package/dist/commands/notification/index.js.map +1 -0
- package/dist/commands/notification/notification.logic.d.ts +11 -0
- package/dist/commands/notification/notification.logic.d.ts.map +1 -0
- package/dist/commands/notification/notification.logic.js +33 -0
- package/dist/commands/notification/notification.logic.js.map +1 -0
- package/dist/commands/notification/notification.screen.d.ts +10 -0
- package/dist/commands/notification/notification.screen.d.ts.map +1 -0
- package/dist/commands/notification/notification.screen.js +13 -0
- package/dist/commands/notification/notification.screen.js.map +1 -0
- package/dist/commands/profile/index.d.ts +6 -0
- package/dist/commands/profile/index.d.ts.map +1 -0
- package/dist/commands/profile/index.js +14 -0
- package/dist/commands/profile/index.js.map +1 -0
- package/dist/commands/profile/profile-edit.screen.d.ts +12 -0
- package/dist/commands/profile/profile-edit.screen.d.ts.map +1 -0
- package/dist/commands/profile/profile-edit.screen.js +66 -0
- package/dist/commands/profile/profile-edit.screen.js.map +1 -0
- package/dist/commands/profile/profile-view.screen.d.ts +10 -0
- package/dist/commands/profile/profile-view.screen.d.ts.map +1 -0
- package/dist/commands/profile/profile-view.screen.js +12 -0
- package/dist/commands/profile/profile-view.screen.js.map +1 -0
- package/dist/commands/profile/profile.logic.d.ts +42 -0
- package/dist/commands/profile/profile.logic.d.ts.map +1 -0
- package/dist/commands/profile/profile.logic.js +74 -0
- package/dist/commands/profile/profile.logic.js.map +1 -0
- package/dist/commands/project/index.d.ts +9 -0
- package/dist/commands/project/index.d.ts.map +1 -0
- package/dist/commands/project/index.js +8 -0
- package/dist/commands/project/index.js.map +1 -0
- package/dist/commands/project/project.logic.d.ts +29 -0
- package/dist/commands/project/project.logic.d.ts.map +1 -0
- package/dist/commands/project/project.logic.js +92 -0
- package/dist/commands/project/project.logic.js.map +1 -0
- package/dist/commands/project/project.screen.d.ts +22 -0
- package/dist/commands/project/project.screen.d.ts.map +1 -0
- package/dist/commands/project/project.screen.js +27 -0
- package/dist/commands/project/project.screen.js.map +1 -0
- package/dist/commands/stubs/index.d.ts +9 -0
- package/dist/commands/stubs/index.d.ts.map +1 -0
- package/dist/commands/stubs/index.js +24 -0
- package/dist/commands/stubs/index.js.map +1 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +29 -0
- package/dist/config.js.map +1 -0
- package/dist/context/AuthContext.d.ts +18 -0
- package/dist/context/AuthContext.d.ts.map +1 -0
- package/dist/context/AuthContext.js +49 -0
- package/dist/context/AuthContext.js.map +1 -0
- package/dist/context/SocketContext.d.ts +12 -0
- package/dist/context/SocketContext.d.ts.map +1 -0
- package/dist/context/SocketContext.js +44 -0
- package/dist/context/SocketContext.js.map +1 -0
- package/dist/context/index.d.ts +7 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +9 -0
- package/dist/context/index.js.map +1 -0
- package/dist/features/admin/components/admin.screen.d.ts +10 -0
- package/dist/features/admin/components/admin.screen.d.ts.map +1 -0
- package/dist/features/admin/components/admin.screen.js +19 -0
- package/dist/features/admin/components/admin.screen.js.map +1 -0
- package/dist/features/admin/components/index.d.ts +8 -0
- package/dist/features/admin/components/index.d.ts.map +1 -0
- package/dist/features/admin/components/index.js +8 -0
- package/dist/features/admin/components/index.js.map +1 -0
- package/dist/features/admin/hooks/useAdmin.d.ts +12 -0
- package/dist/features/admin/hooks/useAdmin.d.ts.map +1 -0
- package/dist/features/admin/hooks/useAdmin.js +46 -0
- package/dist/features/admin/hooks/useAdmin.js.map +1 -0
- package/dist/features/admin/index.d.ts +3 -0
- package/dist/features/admin/index.d.ts.map +1 -0
- package/dist/features/admin/index.js +3 -0
- package/dist/features/admin/index.js.map +1 -0
- package/dist/features/chat/components/ChatList.d.ts +2 -0
- package/dist/features/chat/components/ChatList.d.ts.map +1 -0
- package/dist/features/chat/components/ChatList.js +63 -0
- package/dist/features/chat/components/ChatList.js.map +1 -0
- package/dist/features/chat/components/chat.screen.d.ts +12 -0
- package/dist/features/chat/components/chat.screen.d.ts.map +1 -0
- package/dist/features/chat/components/chat.screen.js +12 -0
- package/dist/features/chat/components/chat.screen.js.map +1 -0
- package/dist/features/chat/components/index.d.ts +9 -0
- package/dist/features/chat/components/index.d.ts.map +1 -0
- package/dist/features/chat/components/index.js +9 -0
- package/dist/features/chat/components/index.js.map +1 -0
- package/dist/features/chat/hooks/useChat.d.ts +15 -0
- package/dist/features/chat/hooks/useChat.d.ts.map +1 -0
- package/dist/features/chat/hooks/useChat.js +150 -0
- package/dist/features/chat/hooks/useChat.js.map +1 -0
- package/dist/features/chat/index.d.ts +4 -0
- package/dist/features/chat/index.d.ts.map +1 -0
- package/dist/features/chat/index.js +4 -0
- package/dist/features/chat/index.js.map +1 -0
- package/dist/features/group/components/group.screen.d.ts +19 -0
- package/dist/features/group/components/group.screen.d.ts.map +1 -0
- package/dist/features/group/components/group.screen.js +22 -0
- package/dist/features/group/components/group.screen.js.map +1 -0
- package/dist/features/group/components/index.d.ts +9 -0
- package/dist/features/group/components/index.d.ts.map +1 -0
- package/dist/features/group/components/index.js +8 -0
- package/dist/features/group/components/index.js.map +1 -0
- package/dist/features/group/hooks/useGroup.d.ts +26 -0
- package/dist/features/group/hooks/useGroup.d.ts.map +1 -0
- package/dist/features/group/hooks/useGroup.js +78 -0
- package/dist/features/group/hooks/useGroup.js.map +1 -0
- package/dist/features/group/index.d.ts +3 -0
- package/dist/features/group/index.d.ts.map +1 -0
- package/dist/features/group/index.js +3 -0
- package/dist/features/group/index.js.map +1 -0
- package/dist/features/network/components/UnfriendByUsername.d.ts +7 -0
- package/dist/features/network/components/UnfriendByUsername.d.ts.map +1 -0
- package/dist/features/network/components/UnfriendByUsername.js +40 -0
- package/dist/features/network/components/UnfriendByUsername.js.map +1 -0
- package/dist/features/network/components/index.d.ts +8 -0
- package/dist/features/network/components/index.d.ts.map +1 -0
- package/dist/features/network/components/index.js +9 -0
- package/dist/features/network/components/index.js.map +1 -0
- package/dist/features/network/components/network.screen.d.ts +10 -0
- package/dist/features/network/components/network.screen.d.ts.map +1 -0
- package/dist/features/network/components/network.screen.js +17 -0
- package/dist/features/network/components/network.screen.js.map +1 -0
- package/dist/features/network/hooks/useNetwork.d.ts +12 -0
- package/dist/features/network/hooks/useNetwork.d.ts.map +1 -0
- package/dist/features/network/hooks/useNetwork.js +74 -0
- package/dist/features/network/hooks/useNetwork.js.map +1 -0
- package/dist/features/network/hooks/useUnfriend.d.ts +7 -0
- package/dist/features/network/hooks/useUnfriend.d.ts.map +1 -0
- package/dist/features/network/hooks/useUnfriend.js +24 -0
- package/dist/features/network/hooks/useUnfriend.js.map +1 -0
- package/dist/features/network/index.d.ts +4 -0
- package/dist/features/network/index.d.ts.map +1 -0
- package/dist/features/network/index.js +4 -0
- package/dist/features/network/index.js.map +1 -0
- package/dist/features/notification/components/index.d.ts +7 -0
- package/dist/features/notification/components/index.d.ts.map +1 -0
- package/dist/features/notification/components/index.js +8 -0
- package/dist/features/notification/components/index.js.map +1 -0
- package/dist/features/notification/components/notification.screen.d.ts +10 -0
- package/dist/features/notification/components/notification.screen.d.ts.map +1 -0
- package/dist/features/notification/components/notification.screen.js +13 -0
- package/dist/features/notification/components/notification.screen.js.map +1 -0
- package/dist/features/notification/hooks/useNotification.d.ts +11 -0
- package/dist/features/notification/hooks/useNotification.d.ts.map +1 -0
- package/dist/features/notification/hooks/useNotification.js +38 -0
- package/dist/features/notification/hooks/useNotification.js.map +1 -0
- package/dist/features/notification/index.d.ts +3 -0
- package/dist/features/notification/index.d.ts.map +1 -0
- package/dist/features/notification/index.js +3 -0
- package/dist/features/notification/index.js.map +1 -0
- package/dist/features/profile/components/index.d.ts +6 -0
- package/dist/features/profile/components/index.d.ts.map +1 -0
- package/dist/features/profile/components/index.js +13 -0
- package/dist/features/profile/components/index.js.map +1 -0
- package/dist/features/profile/components/profile-edit.screen.d.ts +14 -0
- package/dist/features/profile/components/profile-edit.screen.d.ts.map +1 -0
- package/dist/features/profile/components/profile-edit.screen.js +182 -0
- package/dist/features/profile/components/profile-edit.screen.js.map +1 -0
- package/dist/features/profile/components/profile-view.screen.d.ts +10 -0
- package/dist/features/profile/components/profile-view.screen.d.ts.map +1 -0
- package/dist/features/profile/components/profile-view.screen.js +13 -0
- package/dist/features/profile/components/profile-view.screen.js.map +1 -0
- package/dist/features/profile/hooks/useProfile.d.ts +17 -0
- package/dist/features/profile/hooks/useProfile.d.ts.map +1 -0
- package/dist/features/profile/hooks/useProfile.js +148 -0
- package/dist/features/profile/hooks/useProfile.js.map +1 -0
- package/dist/features/profile/index.d.ts +3 -0
- package/dist/features/profile/index.d.ts.map +1 -0
- package/dist/features/profile/index.js +3 -0
- package/dist/features/profile/index.js.map +1 -0
- package/dist/features/project/components/index.d.ts +9 -0
- package/dist/features/project/components/index.d.ts.map +1 -0
- package/dist/features/project/components/index.js +8 -0
- package/dist/features/project/components/index.js.map +1 -0
- package/dist/features/project/components/project.screen.d.ts +22 -0
- package/dist/features/project/components/project.screen.d.ts.map +1 -0
- package/dist/features/project/components/project.screen.js +27 -0
- package/dist/features/project/components/project.screen.js.map +1 -0
- package/dist/features/project/hooks/useProject.d.ts +29 -0
- package/dist/features/project/hooks/useProject.d.ts.map +1 -0
- package/dist/features/project/hooks/useProject.js +97 -0
- package/dist/features/project/hooks/useProject.js.map +1 -0
- package/dist/features/project/index.d.ts +3 -0
- package/dist/features/project/index.d.ts.map +1 -0
- package/dist/features/project/index.js +3 -0
- package/dist/features/project/index.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface UseNetworkLogicProps {
|
|
2
|
+
action?: 'list' | 'requests' | 'add' | 'accept' | 'block';
|
|
3
|
+
target?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const useNetworkLogic: ({ action, target }: UseNetworkLogicProps) => {
|
|
6
|
+
action: "list" | "requests" | "add" | "accept" | "block";
|
|
7
|
+
data: any;
|
|
8
|
+
error: string | null;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=useNetwork.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNetwork.d.ts","sourceRoot":"","sources":["../../../../src/features/network/hooks/useNetwork.ts"],"names":[],"mappings":"AAKA,UAAU,oBAAoB;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,eAAe,GAAI,oBAA6B,oBAAoB;;;;;CAiEhF,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { useApp, useInput } from 'ink';
|
|
3
|
+
import api from '../../../api.js';
|
|
4
|
+
import { useAuth } from '../../../context/index.js';
|
|
5
|
+
export const useNetworkLogic = ({ action = 'list', target }) => {
|
|
6
|
+
const { exit } = useApp();
|
|
7
|
+
const { isAuthenticated } = useAuth();
|
|
8
|
+
const [data, setData] = useState(null);
|
|
9
|
+
const [error, setError] = useState(null);
|
|
10
|
+
const [loading, setLoading] = useState(true);
|
|
11
|
+
useInput((input, key) => {
|
|
12
|
+
if (key.escape) {
|
|
13
|
+
exit();
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const run = async () => {
|
|
18
|
+
if (!isAuthenticated)
|
|
19
|
+
return;
|
|
20
|
+
try {
|
|
21
|
+
if (action === 'list') {
|
|
22
|
+
const res = await api.get('/network/friends');
|
|
23
|
+
setData(res.data);
|
|
24
|
+
}
|
|
25
|
+
else if (action === 'requests') {
|
|
26
|
+
const res = await api.get('/network/requests');
|
|
27
|
+
setData(res.data);
|
|
28
|
+
}
|
|
29
|
+
else if (action === 'add' && target) {
|
|
30
|
+
const userRes = await api.get(`/profile/${target}`);
|
|
31
|
+
const targetId = userRes.data.user.id;
|
|
32
|
+
await api.post('/network/request', { targetUserId: targetId });
|
|
33
|
+
setData({ message: `Friend request sent to ${target}` });
|
|
34
|
+
}
|
|
35
|
+
else if (action === 'accept' && target) {
|
|
36
|
+
const reqRes = await api.get('/network/requests');
|
|
37
|
+
const request = reqRes.data.find((r) => r.senderId.username === target);
|
|
38
|
+
if (!request)
|
|
39
|
+
throw new Error(`No pending request from ${target}`);
|
|
40
|
+
await api.post('/network/accept', { requestId: request._id });
|
|
41
|
+
setData({ message: `Accepted request from ${target}` });
|
|
42
|
+
}
|
|
43
|
+
else if (action === 'block' && target) {
|
|
44
|
+
const userRes = await api.get(`/profile/${target}`);
|
|
45
|
+
const targetId = userRes.data.user.id;
|
|
46
|
+
await api.post('/network/block', { targetUserId: targetId });
|
|
47
|
+
setData({ message: `Blocked ${target}` });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
setError(err.response?.data?.message || err.message || 'Operation failed');
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
setLoading(false);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
if (action !== 'add' && action !== 'accept' && action !== 'block') {
|
|
58
|
+
run();
|
|
59
|
+
}
|
|
60
|
+
else if (target) {
|
|
61
|
+
run();
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
setLoading(false);
|
|
65
|
+
}
|
|
66
|
+
}, [action, target, isAuthenticated]);
|
|
67
|
+
return {
|
|
68
|
+
action,
|
|
69
|
+
data,
|
|
70
|
+
error,
|
|
71
|
+
loading
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=useNetwork.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNetwork.js","sourceRoot":"","sources":["../../../../src/features/network/hooks/useNetwork.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,E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,CAAC;oBACtC,MAAM,GAAG,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC;oBAC7D,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,MAAM,EAAE,EAAE,CAAC,CAAC;gBAC9C,CAAC;YACL,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAChB,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,IAAI,GAAG,CAAC,OAAO,IAAI,kBAAkB,CAAC,CAAC;YAC/E,CAAC;oBAAS,CAAC;gBACP,UAAU,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;QACL,CAAC,CAAC;QAEF,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YAChE,GAAG,EAAE,CAAC;QACV,CAAC;aAAM,IAAI,MAAM,EAAE,CAAC;YAChB,GAAG,EAAE,CAAC;QACV,CAAC;aAAM,CAAC;YACJ,UAAU,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACL,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;IAEtC,OAAO;QACH,MAAM;QACN,IAAI;QACJ,KAAK;QACL,OAAO;KACV,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnfriend.d.ts","sourceRoot":"","sources":["../../../../src/features/network/hooks/useUnfriend.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW;uBAKY,MAAM;;;;CAgBzC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import api from '../../../api.js';
|
|
3
|
+
export const useUnfriend = () => {
|
|
4
|
+
const [loading, setLoading] = useState(false);
|
|
5
|
+
const [error, setError] = useState(null);
|
|
6
|
+
const [success, setSuccess] = useState(false);
|
|
7
|
+
const unfriend = async (userId) => {
|
|
8
|
+
setLoading(true);
|
|
9
|
+
setError(null);
|
|
10
|
+
setSuccess(false);
|
|
11
|
+
try {
|
|
12
|
+
await api.delete(`/network/friend/${userId}`);
|
|
13
|
+
setSuccess(true);
|
|
14
|
+
}
|
|
15
|
+
catch (err) {
|
|
16
|
+
setError(err.response?.data?.message || 'Failed to unfriend user');
|
|
17
|
+
}
|
|
18
|
+
finally {
|
|
19
|
+
setLoading(false);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return { unfriend, loading, error, success };
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=useUnfriend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnfriend.js","sourceRoot":"","sources":["../../../../src/features/network/hooks/useUnfriend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC5B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,QAAQ,GAAG,KAAK,EAAE,MAAc,EAAE,EAAE;QACtC,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,QAAQ,CAAC,IAAI,CAAC,CAAC;QACf,UAAU,CAAC,KAAK,CAAC,CAAC;QAElB,IAAI,CAAC;YACD,MAAM,GAAG,CAAC,MAAM,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;YAC9C,UAAU,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAChB,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,IAAI,yBAAyB,CAAC,CAAC;QACvE,CAAC;gBAAS,CAAC;YACP,UAAU,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AACjD,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/network/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/network/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/notification/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,iBAAiB;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAGpD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useNotificationLogic } from '../hooks/useNotification.js';
|
|
3
|
+
import { NotificationScreen } from './notification.screen.js';
|
|
4
|
+
export const Notification = (props) => {
|
|
5
|
+
const logic = useNotificationLogic(props);
|
|
6
|
+
return _jsx(NotificationScreen, { ...logic });
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/features/notification/components/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAM9D,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,KAAK,EAAE,EAAE;IAC/D,MAAM,KAAK,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC1C,OAAO,KAAC,kBAAkB,OAAK,KAAK,GAAI,CAAC;AAC7C,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface NotificationScreenProps {
|
|
3
|
+
action: string;
|
|
4
|
+
data: any;
|
|
5
|
+
error: string | null;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const NotificationScreen: React.FC<NotificationScreenProps>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=notification.screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.screen.d.ts","sourceRoot":"","sources":["../../../../src/features/notification/components/notification.screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,uBAAuB;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAyBhE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, Box } from 'ink';
|
|
3
|
+
export const NotificationScreen = ({ action, data, error, loading }) => {
|
|
4
|
+
if (loading)
|
|
5
|
+
return _jsx(Text, { children: "Loading..." });
|
|
6
|
+
if (error)
|
|
7
|
+
return _jsxs(Text, { color: "red", children: ["Error: ", error] });
|
|
8
|
+
if (action === 'list') {
|
|
9
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "yellow", children: [_jsx(Text, { bold: true, children: "\uD83D\uDD14 Notifications" }), Array.isArray(data) && data.length === 0 && _jsx(Text, { italic: true, color: "gray", children: "No notifications." }), Array.isArray(data) && data.map((n) => (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsxs(Text, { bold: !n.read, color: n.read ? 'gray' : 'white', children: [n.read ? '' : '• ', " ", n.content] }), _jsx(Text, { color: "gray", italic: true, children: new Date(n.createdAt).toLocaleString() })] }, n._id))), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Press ESC to exit" }) })] }));
|
|
10
|
+
}
|
|
11
|
+
return _jsx(Text, { children: "Notification System" });
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=notification.screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.screen.js","sourceRoot":"","sources":["../../../../src/features/notification/components/notification.screen.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAShC,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;IACtG,IAAI,OAAO;QAAE,OAAO,KAAC,IAAI,6BAAkB,CAAC;IAC5C,IAAI,KAAK;QAAE,OAAO,MAAC,IAAI,IAAC,KAAK,EAAC,KAAK,wBAAS,KAAK,IAAQ,CA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export declare const useNotificationLogic: ({ action }: UseNotificationLogicProps) => {
|
|
5
|
+
action: "list";
|
|
6
|
+
data: any;
|
|
7
|
+
error: string | null;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=useNotification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNotification.d.ts","sourceRoot":"","sources":["../../../../src/features/notification/hooks/useNotification.ts"],"names":[],"mappings":"AAIA,UAAU,yBAAyB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,oBAAoB,GAAI,YAAqB,yBAAyB;;;;;CAkClF,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { useApp, useInput } from 'ink';
|
|
3
|
+
import api from '../../../api.js';
|
|
4
|
+
export const useNotificationLogic = ({ action = 'list' }) => {
|
|
5
|
+
const { exit } = useApp();
|
|
6
|
+
const [data, setData] = useState(null);
|
|
7
|
+
const [error, setError] = useState(null);
|
|
8
|
+
const [loading, setLoading] = useState(true);
|
|
9
|
+
useInput((input, key) => {
|
|
10
|
+
if (key.escape) {
|
|
11
|
+
exit();
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const run = async () => {
|
|
16
|
+
try {
|
|
17
|
+
if (action === 'list') {
|
|
18
|
+
const res = await api.get('/notifications');
|
|
19
|
+
setData(res.data);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
setError(err.response?.data?.message || err.message || 'Error');
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
setLoading(false);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
run();
|
|
30
|
+
}, [action]);
|
|
31
|
+
return {
|
|
32
|
+
action,
|
|
33
|
+
data,
|
|
34
|
+
error,
|
|
35
|
+
loading
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=useNotification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNotification.js","sourceRoot":"","sources":["../../../../src/features/notification/hooks/useNotification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAMlC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAA6B,EAAE,EAAE;IACnF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;IAC1B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAM,IAAI,CAAC,CAAC;IAC5C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE7C,QAAQ,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACpB,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YACb,IAAI,EAAE,CAAC;QACX,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,GAAG,GAAG,KAAK,IAAI,EAAE;YACnB,IAAI,CAAC;gBACD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;oBACpB,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;oBAC5C,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACtB,CAAC;YACL,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAChB,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,IAAI,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC;YACpE,CAAC;oBAAS,CAAC;gBACP,UAAU,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;QACL,CAAC,CAAC;QACF,GAAG,EAAE,CAAC;IACV,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO;QACH,MAAM;QACN,IAAI;QACJ,KAAK;QACL,OAAO;KACV,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/notification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/notification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/profile/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAGvD,CAAC;AAEF,eAAO,MAAM,WAAW,+CAGvB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useProfileViewLogic, useProfileEditLogic } from '../hooks/useProfile.js';
|
|
3
|
+
import { ProfileViewScreen } from './profile-view.screen.js';
|
|
4
|
+
import { ProfileEditScreen } from './profile-edit.screen.js';
|
|
5
|
+
export const ProfileView = ({ username }) => {
|
|
6
|
+
const logic = useProfileViewLogic(username);
|
|
7
|
+
return _jsx(ProfileViewScreen, { ...logic });
|
|
8
|
+
};
|
|
9
|
+
export const ProfileEdit = () => {
|
|
10
|
+
const logic = useProfileEditLogic();
|
|
11
|
+
return _jsx(ProfileEditScreen, { ...logic });
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/features/profile/components/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,CAAC,MAAM,WAAW,GAAoC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACzE,MAAM,KAAK,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,KAAC,iBAAiB,OAAK,KAAK,GAAI,CAAC;AAC5C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC5B,MAAM,KAAK,GAAG,mBAAmB,EAAE,CAAC;IACpC,OAAO,KAAC,iBAAiB,OAAK,KAAK,GAAI,CAAC;AAC5C,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ProfileEditScreenProps {
|
|
3
|
+
activeField: string | null;
|
|
4
|
+
setActiveField: (field: string | null) => void;
|
|
5
|
+
profile: any;
|
|
6
|
+
setProfile: (profile: any) => void;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
handleSubmit: () => void;
|
|
9
|
+
authError?: string | null;
|
|
10
|
+
authLoading?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const ProfileEditScreen: React.FC<ProfileEditScreenProps>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=profile-edit.screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-edit.screen.d.ts","sourceRoot":"","sources":["../../../../src/features/profile/components/profile-edit.screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,UAAU,sBAAsB;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,GAAG,CAAC;IACb,UAAU,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAkCD,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAkO9D,CAAC"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Text, Box, useInput, useApp } from 'ink';
|
|
4
|
+
import TextInput from 'ink-text-input';
|
|
5
|
+
import SelectInput from 'ink-select-input';
|
|
6
|
+
const INTENT_ITEMS = [
|
|
7
|
+
{ label: 'Startup', value: 'startup' },
|
|
8
|
+
{ label: 'Collab', value: 'collab' },
|
|
9
|
+
{ label: 'Friends', value: 'friends' },
|
|
10
|
+
{ label: 'Mentorship', value: 'mentorship' },
|
|
11
|
+
{ label: 'Dating', value: 'dating' },
|
|
12
|
+
];
|
|
13
|
+
const GENDER_ITEMS = [
|
|
14
|
+
{ label: 'Male', value: 'male' },
|
|
15
|
+
{ label: 'Female', value: 'female' },
|
|
16
|
+
{ label: 'Other', value: 'other' },
|
|
17
|
+
{ label: 'Prefer not to say', value: 'prefer-not-to-say' },
|
|
18
|
+
];
|
|
19
|
+
const LOOKING_FOR_ITEMS = [
|
|
20
|
+
{ label: 'Friendship', value: 'friendship' },
|
|
21
|
+
{ label: 'Dating', value: 'dating' },
|
|
22
|
+
{ label: 'Relationship', value: 'relationship' },
|
|
23
|
+
{ label: 'Networking', value: 'networking' },
|
|
24
|
+
];
|
|
25
|
+
const ORIENTATION_ITEMS = [
|
|
26
|
+
{ label: 'Straight', value: 'straight' },
|
|
27
|
+
{ label: 'Gay', value: 'gay' },
|
|
28
|
+
{ label: 'Lesbian', value: 'lesbian' },
|
|
29
|
+
{ label: 'Bisexual', value: 'bisexual' },
|
|
30
|
+
{ label: 'Pansexual', value: 'pansexual' },
|
|
31
|
+
{ label: 'Asexual', value: 'asexual' },
|
|
32
|
+
{ label: 'Other', value: 'other' },
|
|
33
|
+
];
|
|
34
|
+
export const ProfileEditScreen = ({ activeField, setActiveField, profile, setProfile, loading, handleSubmit, authLoading, authError }) => {
|
|
35
|
+
const [activeCategory, setActiveCategory] = useState(null);
|
|
36
|
+
if (authLoading)
|
|
37
|
+
return _jsx(Text, { children: "Checking auth..." });
|
|
38
|
+
if (authError)
|
|
39
|
+
return _jsxs(Text, { color: "red", children: ["Error: ", authError] });
|
|
40
|
+
if (loading)
|
|
41
|
+
return _jsx(Text, { children: "Saving..." });
|
|
42
|
+
const { exit } = useApp();
|
|
43
|
+
useInput((input, key) => {
|
|
44
|
+
if (key.escape) {
|
|
45
|
+
if (activeField) {
|
|
46
|
+
// Exit current field edit mode
|
|
47
|
+
setActiveField(null);
|
|
48
|
+
}
|
|
49
|
+
else if (activeCategory) {
|
|
50
|
+
// Exit current category
|
|
51
|
+
setActiveCategory(null);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
// Exit app
|
|
55
|
+
exit();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const isDating = profile.intent === 'dating';
|
|
60
|
+
const categories = [
|
|
61
|
+
{ label: '📁 General (Bio, Intent)', value: 'general' },
|
|
62
|
+
{ label: '👤 Personal (Age, Gender, DOB)', value: 'personal' },
|
|
63
|
+
...(isDating ? [{ label: '❤️ Dating Preferences', value: 'dating' }] : []),
|
|
64
|
+
{ label: '💼 Professional (Job, Stack)', value: 'professional' },
|
|
65
|
+
{ label: '🎨 Interests & Hobbies', value: 'interests' },
|
|
66
|
+
{ label: '🌍 Location', value: 'location' },
|
|
67
|
+
{ label: '🔗 Socials & Contact', value: 'socials' },
|
|
68
|
+
{ label: '✅ SAVE & EXIT', value: 'save' },
|
|
69
|
+
{ label: '❌ CANCEL', value: 'cancel' },
|
|
70
|
+
];
|
|
71
|
+
const getItemsForCategory = (category) => {
|
|
72
|
+
const backItem = { label: '⬅️ Back to Categories', value: 'back' };
|
|
73
|
+
switch (category) {
|
|
74
|
+
case 'general': return [
|
|
75
|
+
{ label: 'Main Intent', value: 'intent' },
|
|
76
|
+
{ label: 'Full Name', value: 'fullName' },
|
|
77
|
+
{ label: 'Bio', value: 'bio' },
|
|
78
|
+
backItem,
|
|
79
|
+
];
|
|
80
|
+
case 'personal': return [
|
|
81
|
+
{ label: 'Age', value: 'age' },
|
|
82
|
+
{ label: 'Gender', value: 'gender' },
|
|
83
|
+
{ label: 'Date of Birth (YYYY-MM-DD)', value: 'dateOfBirth' },
|
|
84
|
+
backItem,
|
|
85
|
+
];
|
|
86
|
+
case 'dating': return [
|
|
87
|
+
{ label: 'Looking For', value: 'lookingFor' },
|
|
88
|
+
{ label: 'Orientation', value: 'orientation' },
|
|
89
|
+
{ label: 'Interested In', value: 'interestedIn' },
|
|
90
|
+
{ label: 'Age Preference (Min)', value: 'ageRangeMin' },
|
|
91
|
+
{ label: 'Age Preference (Max)', value: 'ageRangeMax' },
|
|
92
|
+
backItem,
|
|
93
|
+
];
|
|
94
|
+
case 'professional': return [
|
|
95
|
+
{ label: 'Company / College', value: 'company' },
|
|
96
|
+
{ label: 'Job Title', value: 'jobTitle' },
|
|
97
|
+
{ label: 'Experience (Years)', value: 'yearsOfExperience' },
|
|
98
|
+
{ label: 'Tech Stack', value: 'stack' },
|
|
99
|
+
backItem,
|
|
100
|
+
];
|
|
101
|
+
case 'interests': return [
|
|
102
|
+
{ label: 'Hobbies', value: 'hobbies' },
|
|
103
|
+
{ label: 'Interests', value: 'interests' },
|
|
104
|
+
backItem,
|
|
105
|
+
];
|
|
106
|
+
case 'location': return [
|
|
107
|
+
{ label: 'City', value: 'city' },
|
|
108
|
+
{ label: 'Country', value: 'country' },
|
|
109
|
+
{ label: 'Full Address / Location', value: 'location' },
|
|
110
|
+
backItem,
|
|
111
|
+
];
|
|
112
|
+
case 'socials': return [
|
|
113
|
+
{ label: 'GitHub Username', value: 'github' },
|
|
114
|
+
{ label: 'LinkedIn URL', value: 'linkedin' },
|
|
115
|
+
{ label: 'Twitter/X URL', value: 'twitter' },
|
|
116
|
+
{ label: 'Website URL', value: 'website' },
|
|
117
|
+
{ label: 'Mobile Number', value: 'mobileNumber' },
|
|
118
|
+
backItem,
|
|
119
|
+
];
|
|
120
|
+
default: return [];
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
// Category Selection View
|
|
124
|
+
if (!activeCategory && !activeField) {
|
|
125
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "yellow", children: [_jsx(Text, { color: "yellow", bold: true, underline: true, children: "Edit Profile" }), _jsx(Text, { color: "gray", children: "Select a category:" }), _jsx(SelectInput, { items: categories, onSelect: (item) => {
|
|
126
|
+
if (item.value === 'save')
|
|
127
|
+
handleSubmit();
|
|
128
|
+
else if (item.value === 'cancel')
|
|
129
|
+
process.exit(0);
|
|
130
|
+
else
|
|
131
|
+
setActiveCategory(item.value);
|
|
132
|
+
} })] }));
|
|
133
|
+
}
|
|
134
|
+
// Field Selection View (within Category)
|
|
135
|
+
if (activeCategory && !activeField) {
|
|
136
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "cyan", children: [_jsxs(Text, { color: "cyan", bold: true, underline: true, children: ["Editing: ", categories.find(c => c.value === activeCategory)?.label] }), _jsx(SelectInput, { items: getItemsForCategory(activeCategory), onSelect: (item) => {
|
|
137
|
+
if (item.value === 'back')
|
|
138
|
+
setActiveCategory(null);
|
|
139
|
+
else
|
|
140
|
+
setActiveField(item.value);
|
|
141
|
+
} })] }));
|
|
142
|
+
}
|
|
143
|
+
// Input View
|
|
144
|
+
const renderInput = () => {
|
|
145
|
+
const commonProps = {
|
|
146
|
+
onSubmit: () => setActiveField(null),
|
|
147
|
+
};
|
|
148
|
+
switch (activeField) {
|
|
149
|
+
case 'intent':
|
|
150
|
+
return (_jsx(SelectInput, { items: INTENT_ITEMS, initialIndex: INTENT_ITEMS.findIndex(i => i.value === profile.intent), onSelect: (item) => {
|
|
151
|
+
setProfile({ ...profile, intent: item.value });
|
|
152
|
+
setActiveField(null);
|
|
153
|
+
} }));
|
|
154
|
+
case 'gender':
|
|
155
|
+
return (_jsx(SelectInput, { items: GENDER_ITEMS, initialIndex: Math.max(0, GENDER_ITEMS.findIndex(i => i.value === profile.gender)), onSelect: (item) => {
|
|
156
|
+
setProfile({ ...profile, gender: item.value });
|
|
157
|
+
setActiveField(null);
|
|
158
|
+
} }));
|
|
159
|
+
case 'lookingFor':
|
|
160
|
+
return (_jsx(SelectInput, { items: LOOKING_FOR_ITEMS, initialIndex: Math.max(0, LOOKING_FOR_ITEMS.findIndex(i => i.value === profile.lookingFor)), onSelect: (item) => {
|
|
161
|
+
setProfile({ ...profile, lookingFor: item.value });
|
|
162
|
+
setActiveField(null);
|
|
163
|
+
} }));
|
|
164
|
+
case 'orientation':
|
|
165
|
+
return (_jsx(SelectInput, { items: ORIENTATION_ITEMS, initialIndex: Math.max(0, ORIENTATION_ITEMS.findIndex(i => i.value === profile.orientation)), onSelect: (item) => {
|
|
166
|
+
setProfile({ ...profile, orientation: item.value });
|
|
167
|
+
setActiveField(null);
|
|
168
|
+
} }));
|
|
169
|
+
case 'age':
|
|
170
|
+
case 'ageRangeMin':
|
|
171
|
+
case 'ageRangeMax':
|
|
172
|
+
case 'yearsOfExperience':
|
|
173
|
+
return (_jsx(TextInput, { ...commonProps, value: String(profile[activeField] || ''), onChange: (val) => setProfile({ ...profile, [activeField]: val ? parseInt(val) : undefined }), placeholder: "Enter number..." }));
|
|
174
|
+
case 'dateOfBirth':
|
|
175
|
+
return (_jsx(TextInput, { ...commonProps, value: profile.dateOfBirth || '', onChange: (val) => setProfile({ ...profile, dateOfBirth: val }), placeholder: "YYYY-MM-DD" }));
|
|
176
|
+
default:
|
|
177
|
+
return (_jsx(TextInput, { ...commonProps, value: String(profile[activeField] || ''), onChange: (val) => setProfile({ ...profile, [activeField]: val }), placeholder: `Enter ${activeField}...` }));
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "green", children: [_jsxs(Text, { bold: true, color: "green", children: ["Editing Field: ", activeField] }), _jsx(Box, { marginY: 1, children: renderInput() }), _jsx(Text, { color: "gray", children: "(Press Enter to save and return to menu)" })] }));
|
|
181
|
+
};
|
|
182
|
+
//# sourceMappingURL=profile-edit.screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-edit.screen.js","sourceRoot":"","sources":["../../../../src/features/profile/components/profile-edit.screen.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAW,QAAQ,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC3D,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAa3C,MAAM,YAAY,GAAG;IACjB,EAAE,KAAK,EAAE,SAA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loading: boolean;
|
|
5
|
+
error: string | null;
|
|
6
|
+
user: any;
|
|
7
|
+
}
|
|
8
|
+
export declare const ProfileViewScreen: React.FC<ProfileViewScreenProps>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=profile-view.screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-view.screen.d.ts","sourceRoot":"","sources":["../../../../src/features/profile/components/profile-view.screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,sBAAsB;IAC5B,OAAO,EAAE,GAAG,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,GAAG,CAAC;CACb;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA6B9D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, Box } from 'ink';
|
|
3
|
+
export const ProfileViewScreen = ({ profile, loading, error, user }) => {
|
|
4
|
+
if (loading)
|
|
5
|
+
return _jsx(Text, { children: "Loading profile..." });
|
|
6
|
+
if (error)
|
|
7
|
+
return _jsxs(Text, { color: "red", children: ["Error: ", error] });
|
|
8
|
+
if (!profile)
|
|
9
|
+
return _jsxs(Text, { children: ["No profile found for @", user?.username, ". Run \"hackmate profile edit\" to create one."] });
|
|
10
|
+
const locationDisplay = [profile.city, profile.country].filter(Boolean).join(', ') || profile.location || 'N/A';
|
|
11
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "cyan", children: [_jsxs(Text, { bold: true, color: "cyan", children: [" @", profile?.user?.username || user?.username, " "] }), _jsx(Text, { children: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" }), _jsxs(Text, { children: ["Intent: ", _jsx(Text, { color: "green", children: profile.intent })] }), _jsxs(Text, { children: ["Bio: ", profile.bio || 'N/A'] }), _jsxs(Text, { children: ["Age: ", profile.age || 'N/A', " | Gender: ", profile.gender || 'N/A'] }), _jsxs(Text, { children: ["Company/College: ", profile.company || 'N/A'] }), _jsxs(Text, { children: ["Stack: ", profile.stack?.join(', ') || 'N/A'] }), _jsxs(Text, { children: ["Interests: ", profile.interests?.join(', ') || 'N/A'] }), _jsxs(Text, { children: ["Location: ", locationDisplay] }), _jsx(Text, { children: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" }), _jsx(Text, { bold: true, children: "Socials:" }), _jsxs(Text, { children: ["GitHub: ", profile.github || 'N/A'] }), _jsxs(Text, { children: ["LinkedIn: ", profile.linkedin || 'N/A'] }), _jsxs(Text, { children: ["Twitter: ", profile.twitter || 'N/A'] }), _jsxs(Text, { children: ["Website: ", profile.website || 'N/A'] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Press ESC to exit" }) })] }));
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=profile-view.screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-view.screen.js","sourceRoot":"","sources":["../../../../src/features/profile/components/profile-view.screen.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAShC,MAAM,CAAC,MAAM,iBAAiB,GAAqC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IACrG,IAAI,OAAO;QAAE,OAAO,KAAC,IAAI,qCAA0B,CAAC;IACpD,IAAI,KAAK;QAAE,OAAO,MAAC,IAAI,IAAC,KAAK,EAAC,KAAK,wBAAS,KAAK,IAAQ,CAAC;IAC1D,IAAI,CAAC,OAAO;QAAE,OAAO,MAAC,I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Q,IAAI,KAAK,IAAQ,EAClD,MAAC,IAAI,4BAAW,OAAO,CAAC,OAAO,IAAI,KAAK,IAAQ,EAChD,MAAC,IAAI,4BAAW,OAAO,CAAC,OAAO,IAAI,KAAK,IAAQ,EAChD,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACb,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,kCAAyB,GACzC,IACJ,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const useProfileViewLogic: (targetUsername?: string) => {
|
|
2
|
+
profile: any;
|
|
3
|
+
loading: boolean;
|
|
4
|
+
error: string | null;
|
|
5
|
+
user: import("../../../context/AuthContext.js").User | null;
|
|
6
|
+
};
|
|
7
|
+
export declare const useProfileEditLogic: () => {
|
|
8
|
+
activeField: string | null;
|
|
9
|
+
setActiveField: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
10
|
+
profile: any;
|
|
11
|
+
setProfile: import("react").Dispatch<any>;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
authError: string | null;
|
|
14
|
+
handleSubmit: () => Promise<void>;
|
|
15
|
+
authLoading: boolean;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useProfile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProfile.d.ts","sourceRoot":"","sources":["../../../../src/features/profile/hooks/useProfile.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB,GAAI,iBAAiB,MAAM;;;;;CAiD1D,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;CA8F/B,CAAC"}
|