hackmate-cli 1.0.10 → 1.0.11
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/dist/features/profile/components/index.d.ts.map +1 -1
- package/dist/features/profile/components/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/commands/admin/admin.logic.d.ts +0 -12
- package/dist/commands/admin/admin.logic.d.ts.map +0 -1
- package/dist/commands/admin/admin.logic.js +0 -41
- package/dist/commands/admin/admin.logic.js.map +0 -1
- package/dist/commands/admin/admin.screen.d.ts +0 -10
- package/dist/commands/admin/admin.screen.d.ts.map +0 -1
- package/dist/commands/admin/admin.screen.js +0 -19
- package/dist/commands/admin/admin.screen.js.map +0 -1
- package/dist/commands/admin/index.d.ts +0 -8
- package/dist/commands/admin/index.d.ts.map +0 -1
- package/dist/commands/admin/index.js +0 -8
- package/dist/commands/admin/index.js.map +0 -1
- package/dist/commands/chat/ChatList.d.ts +0 -2
- package/dist/commands/chat/ChatList.d.ts.map +0 -1
- package/dist/commands/chat/ChatList.js +0 -63
- package/dist/commands/chat/ChatList.js.map +0 -1
- package/dist/commands/chat/chat.logic.d.ts +0 -15
- package/dist/commands/chat/chat.logic.d.ts.map +0 -1
- package/dist/commands/chat/chat.logic.js +0 -139
- package/dist/commands/chat/chat.logic.js.map +0 -1
- package/dist/commands/chat/chat.screen.d.ts +0 -12
- package/dist/commands/chat/chat.screen.d.ts.map +0 -1
- package/dist/commands/chat/chat.screen.js +0 -12
- package/dist/commands/chat/chat.screen.js.map +0 -1
- package/dist/commands/chat/index.d.ts +0 -8
- package/dist/commands/chat/index.d.ts.map +0 -1
- package/dist/commands/chat/index.js +0 -9
- package/dist/commands/chat/index.js.map +0 -1
- package/dist/commands/group/group.logic.d.ts +0 -26
- package/dist/commands/group/group.logic.d.ts.map +0 -1
- package/dist/commands/group/group.logic.js +0 -73
- package/dist/commands/group/group.logic.js.map +0 -1
- package/dist/commands/group/group.screen.d.ts +0 -19
- package/dist/commands/group/group.screen.d.ts.map +0 -1
- package/dist/commands/group/group.screen.js +0 -22
- package/dist/commands/group/group.screen.js.map +0 -1
- package/dist/commands/group/index.d.ts +0 -9
- package/dist/commands/group/index.d.ts.map +0 -1
- package/dist/commands/group/index.js +0 -8
- package/dist/commands/group/index.js.map +0 -1
- package/dist/commands/network/index.d.ts +0 -8
- package/dist/commands/network/index.d.ts.map +0 -1
- package/dist/commands/network/index.js +0 -8
- package/dist/commands/network/index.js.map +0 -1
- package/dist/commands/network/network.logic.d.ts +0 -12
- package/dist/commands/network/network.logic.d.ts.map +0 -1
- package/dist/commands/network/network.logic.js +0 -69
- package/dist/commands/network/network.logic.js.map +0 -1
- package/dist/commands/network/network.screen.d.ts +0 -10
- package/dist/commands/network/network.screen.d.ts.map +0 -1
- package/dist/commands/network/network.screen.js +0 -17
- package/dist/commands/network/network.screen.js.map +0 -1
- package/dist/commands/notification/index.d.ts +0 -7
- package/dist/commands/notification/index.d.ts.map +0 -1
- package/dist/commands/notification/index.js +0 -8
- package/dist/commands/notification/index.js.map +0 -1
- package/dist/commands/notification/notification.logic.d.ts +0 -11
- package/dist/commands/notification/notification.logic.d.ts.map +0 -1
- package/dist/commands/notification/notification.logic.js +0 -33
- package/dist/commands/notification/notification.logic.js.map +0 -1
- package/dist/commands/notification/notification.screen.d.ts +0 -10
- package/dist/commands/notification/notification.screen.d.ts.map +0 -1
- package/dist/commands/notification/notification.screen.js +0 -13
- package/dist/commands/notification/notification.screen.js.map +0 -1
- package/dist/commands/profile/index.d.ts +0 -6
- package/dist/commands/profile/index.d.ts.map +0 -1
- package/dist/commands/profile/index.js +0 -14
- package/dist/commands/profile/index.js.map +0 -1
- package/dist/commands/profile/profile-edit.screen.d.ts +0 -12
- package/dist/commands/profile/profile-edit.screen.d.ts.map +0 -1
- package/dist/commands/profile/profile-edit.screen.js +0 -66
- package/dist/commands/profile/profile-edit.screen.js.map +0 -1
- package/dist/commands/profile/profile-view.screen.d.ts +0 -10
- package/dist/commands/profile/profile-view.screen.d.ts.map +0 -1
- package/dist/commands/profile/profile-view.screen.js +0 -12
- package/dist/commands/profile/profile-view.screen.js.map +0 -1
- package/dist/commands/profile/profile.logic.d.ts +0 -42
- package/dist/commands/profile/profile.logic.d.ts.map +0 -1
- package/dist/commands/profile/profile.logic.js +0 -74
- package/dist/commands/profile/profile.logic.js.map +0 -1
- package/dist/commands/project/index.d.ts +0 -9
- package/dist/commands/project/index.d.ts.map +0 -1
- package/dist/commands/project/index.js +0 -8
- package/dist/commands/project/index.js.map +0 -1
- package/dist/commands/project/project.logic.d.ts +0 -29
- package/dist/commands/project/project.logic.d.ts.map +0 -1
- package/dist/commands/project/project.logic.js +0 -92
- package/dist/commands/project/project.logic.js.map +0 -1
- package/dist/commands/project/project.screen.d.ts +0 -22
- package/dist/commands/project/project.screen.d.ts.map +0 -1
- package/dist/commands/project/project.screen.js +0 -27
- package/dist/commands/project/project.screen.js.map +0 -1
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Text, Box } from 'ink';
|
|
3
|
-
import TextInput from 'ink-text-input';
|
|
4
|
-
export const GroupScreen = ({ action, data, error, loading, createStep, setCreateStep, formData, setFormData, handleCreateSubmit }) => {
|
|
5
|
-
if (loading)
|
|
6
|
-
return _jsx(Text, { children: "Loading..." });
|
|
7
|
-
if (error)
|
|
8
|
-
return _jsxs(Text, { color: "red", children: ["Error: ", error] });
|
|
9
|
-
if (action === 'list') {
|
|
10
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "green", children: [_jsx(Text, { bold: true, children: "Groups" }), Array.isArray(data) && data.length === 0 && _jsx(Text, { italic: true, color: "gray", children: "No groups found." }), Array.isArray(data) && data.map((g) => (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsxs(Text, { bold: true, color: "cyan", children: [g.name, " ", _jsxs(Text, { color: "gray", children: ["(", g.isPrivate ? 'Private' : 'Public', ")"] })] }), _jsx(Text, { children: g.description }), _jsxs(Text, { color: "gray", children: ["ID: ", g._id] })] }, g._id)))] }));
|
|
11
|
-
}
|
|
12
|
-
if (action === 'view') {
|
|
13
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "cyan", children: [_jsx(Text, { bold: true, color: "green", children: data.name }), _jsx(Text, { italic: true, children: data.description }), _jsx(Box, { marginY: 1, children: _jsxs(Text, { bold: true, children: ["Members (", data.members.length, ")"] }) }), data.members.slice(0, 5).map((m) => (_jsxs(Text, { children: ["\u2022 ", m.userId.username, " [", m.role, "]"] }, m.userId._id))), data.joinRequests?.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { bold: true, color: "yellow", children: "Pending Requests:" }), data.joinRequests.map((r) => (_jsxs(Text, { children: ["\u2022 ", r.userId.username, " (ID: ", r.userId._id, ")"] }, r.userId._id)))] }))] }));
|
|
14
|
-
}
|
|
15
|
-
if (action === 'create') {
|
|
16
|
-
if (data?.message)
|
|
17
|
-
return _jsxs(Text, { color: "green", children: ["\u2705 ", data.message] });
|
|
18
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Text, { bold: true, children: "Create Group" }), createStep === 0 && (_jsxs(Box, { children: [_jsx(Text, { children: "Name: " }), _jsx(TextInput, { value: formData.name, onChange: v => setFormData({ ...formData, name: v }), onSubmit: () => setCreateStep(1) })] })), createStep === 1 && (_jsxs(Box, { children: [_jsx(Text, { children: "Description: " }), _jsx(TextInput, { value: formData.description, onChange: v => setFormData({ ...formData, description: v }), onSubmit: () => setCreateStep(2) })] })), createStep === 2 && (_jsxs(Box, { children: [_jsx(Text, { children: "Is Private (y/n): " }), _jsx(TextInput, { value: formData.isPrivate ? 'y' : 'n', onChange: v => setFormData({ ...formData, isPrivate: v === 'y' }), onSubmit: handleCreateSubmit })] }))] }));
|
|
19
|
-
}
|
|
20
|
-
return _jsxs(Text, { color: "green", children: ["\u2705 ", data?.message] });
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=group.screen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"group.screen.js","sourceRoot":"","sources":["../../../src/commands/group/group.screen.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAcvC,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EACpD,MAAM,EACN,IAAI,EACJ,KAAK,EACL,OAAO,EACP,UAAU,EACV,aAAa,EACb,QAAQ,EACR,WAAW,EACX,kBAAkB,EACrB,EAAE,EAAE;IACD,IAAI,OAAO;QAAE,OAAO,KAAC,IAAI,6BAAkB,CAAC;IAC5C,IAAI,KAAK;QAAE,OAAO,MAAC,IAAI,IAAC,KAAK,EAAC,KAAK,wBAAS,KAAK,IAAQ,CAAC;IAE1D,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,CACH,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,EAAE,WAAW,EAAC,OAAO,EAAC,WAAW,EAAC,OAAO,aAC3E,KAAC,IAAI,IAAC,IAAI,6BAAc,EACvB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,KAAC,IAAI,IAAC,MAAM,QAAC,KAAK,EAAC,MAAM,iCAAwB,EAC7F,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CACzC,MAAC,GAAG,IAAa,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,aAC9C,MAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,MAAM,aAAE,CAAC,CAAC,IAAI,OAAE,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,kBAA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CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EACrC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,GAAG,QAAQ,EAAE,SAAS,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,EACjE,QAAQ,EAAE,kBAAkB,GAC9B,IACA,CACT,IACC,CACT,CAAC;IACN,CAAC;IAED,OAAO,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,wBAAI,IAAI,EAAE,OAAO,IAAQ,CAAC;AACxD,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/group/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,UAAU;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;IACxD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAGtC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useGroupLogic } from './group.logic.js';
|
|
3
|
-
import { GroupScreen } from './group.screen.js';
|
|
4
|
-
export const Group = (props) => {
|
|
5
|
-
const logic = useGroupLogic(props);
|
|
6
|
-
return _jsx(GroupScreen, { ...logic });
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/group/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQhD,MAAM,CAAC,MAAM,KAAK,GAAyB,CAAC,KAAK,EAAE,EAAE;IACjD,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACnC,OAAO,KAAC,WAAW,OAAK,KAAK,GAAI,CAAC;AACtC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/network/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,YAAY;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAG1C,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useNetworkLogic } from './network.logic.js';
|
|
3
|
-
import { NetworkScreen } from './network.screen.js';
|
|
4
|
-
export const Network = (props) => {
|
|
5
|
-
const logic = useNetworkLogic(props);
|
|
6
|
-
return _jsx(NetworkScreen, { ...logic });
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/network/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOpD,MAAM,CAAC,MAAM,OAAO,GAA2B,CAAC,KAAK,EAAE,EAAE;IACrD,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACrC,OAAO,KAAC,aAAa,OAAK,KAAK,GAAI,CAAC;AACxC,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
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=network.logic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"network.logic.d.ts","sourceRoot":"","sources":["../../../src/commands/network/network.logic.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;;;;;CA2DhF,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
import { useApp } 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
|
-
useEffect(() => {
|
|
12
|
-
const run = async () => {
|
|
13
|
-
if (!isAuthenticated)
|
|
14
|
-
return;
|
|
15
|
-
try {
|
|
16
|
-
if (action === 'list') {
|
|
17
|
-
const res = await api.get('/network/friends');
|
|
18
|
-
setData(res.data);
|
|
19
|
-
}
|
|
20
|
-
else if (action === 'requests') {
|
|
21
|
-
const res = await api.get('/network/requests');
|
|
22
|
-
setData(res.data);
|
|
23
|
-
}
|
|
24
|
-
else if (action === 'add' && target) {
|
|
25
|
-
const userRes = await api.get(`/profile/${target}`);
|
|
26
|
-
const targetId = userRes.data.user.id;
|
|
27
|
-
await api.post('/network/request', { targetUserId: targetId });
|
|
28
|
-
setData({ message: `Friend request sent to ${target}` });
|
|
29
|
-
}
|
|
30
|
-
else if (action === 'accept' && target) {
|
|
31
|
-
const reqRes = await api.get('/network/requests');
|
|
32
|
-
const request = reqRes.data.find((r) => r.senderId.username === target);
|
|
33
|
-
if (!request)
|
|
34
|
-
throw new Error(`No pending request from ${target}`);
|
|
35
|
-
await api.post('/network/accept', { requestId: request._id });
|
|
36
|
-
setData({ message: `Accepted request from ${target}` });
|
|
37
|
-
}
|
|
38
|
-
else if (action === 'block' && target) {
|
|
39
|
-
const userRes = await api.get(`/profile/${target}`);
|
|
40
|
-
const targetId = userRes.data.user.id;
|
|
41
|
-
await api.post('/network/block', { targetUserId: targetId });
|
|
42
|
-
setData({ message: `Blocked ${target}` });
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
catch (err) {
|
|
46
|
-
setError(err.response?.data?.message || err.message || 'Operation failed');
|
|
47
|
-
}
|
|
48
|
-
finally {
|
|
49
|
-
setLoading(false);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
if (action !== 'add' && action !== 'accept' && action !== 'block') {
|
|
53
|
-
run();
|
|
54
|
-
}
|
|
55
|
-
else if (target) {
|
|
56
|
-
run();
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
setLoading(false);
|
|
60
|
-
}
|
|
61
|
-
}, [action, target, isAuthenticated]);
|
|
62
|
-
return {
|
|
63
|
-
action,
|
|
64
|
-
data,
|
|
65
|
-
error,
|
|
66
|
-
loading
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
//# sourceMappingURL=network.logic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3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E,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"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface NetworkScreenProps {
|
|
3
|
-
action: string;
|
|
4
|
-
data: any;
|
|
5
|
-
error: string | null;
|
|
6
|
-
loading: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const NetworkScreen: React.FC<NetworkScreenProps>;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=network.screen.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"network.screen.d.ts","sourceRoot":"","sources":["../../../src/commands/network/network.screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,kBAAkB;IACxB,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,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAoCtD,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Text, Box } from 'ink';
|
|
3
|
-
export const NetworkScreen = ({ action, data, error, loading }) => {
|
|
4
|
-
if (loading)
|
|
5
|
-
return _jsx(Text, { children: "Loading network..." });
|
|
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: "blue", children: [_jsxs(Text, { bold: true, children: ["My Friends (", data?.length || 0, ")"] }), data?.length === 0 && _jsx(Text, { italic: true, color: "gray", children: "No friends yet. Use 'hackmate network add' to connect!" }), Array.isArray(data) && data.map((f) => (_jsxs(Text, { children: ["\u2022 ", f.username, " (", f.email, ")"] }, f._id)))] }));
|
|
10
|
-
}
|
|
11
|
-
if (action === 'requests') {
|
|
12
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "yellow", children: [_jsxs(Text, { bold: true, children: ["Pending Requests (", data?.length || 0, ")"] }), data?.length === 0 && _jsx(Text, { italic: true, color: "gray", children: "No pending requests." }), Array.isArray(data) && data.map((r) => (_jsxs(Text, { children: ["\u2022 From: ", _jsx(Text, { bold: true, color: "yellow", children: r.senderId.username }), " (at ", new Date(r.createdAt).toLocaleDateString(), ")"] }, r._id)))] }));
|
|
13
|
-
}
|
|
14
|
-
// Success message for actions
|
|
15
|
-
return (_jsx(Box, { padding: 1, children: _jsxs(Text, { color: "green", children: ["\u2705 ", data?.message] }) }));
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=network.screen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"network.screen.js","sourceRoot":"","sources":["../../../src/commands/network/network.screen.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAShC,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;IAC5F,IAAI,OAAO;QAAE,OAAO,KAAC,IAAI,qCAA0B,CAAC;IACpD,IAAI,KAAK;QAAE,OAAO,MAAC,IAAI,IAAC,KAAK,EAAC,KAAK,wBAAS,KAAK,IAAQ,CAAC;IAE1D,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,CACH,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,EAAE,WAAW,EAAC,OAAO,EAAC,WAAW,EAAC,MAAM,aAC1E,MAAC,IAAI,IAAC,IAAI,mCAAc,IAAI,EAAE,MAAM,IAAI,CAAC,SAAS,EACjD,IAAI,EAAE,MAAM,KAAK,CAAC,IAAI,KAAC,IAAI,IAAC,MAAM,QAAC,KAAK,EAAC,MAAM,uEAA8D,EAC7G,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CACzC,MAAC,IAAI,0BAAgB,CAAC,CAAC,QAAQ,QAAI,CAAC,CAAC,KAAK,UAA/B,CAAC,CAAC,GAAG,CAAmC,CACtD,CAAC,IACA,CACT,CAAC;IACN,CAAC;IAED,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;QACxB,OAAO,CACH,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,EAAE,WAAW,EAAC,OAAO,EAAC,WAAW,EAAC,QAAQ,aAC5E,MAAC,IAAI,IAAC,IAAI,yCAAoB,IAAI,EAAE,MAAM,IAAI,CAAC,SAAS,EACvD,IAAI,EAAE,MAAM,KAAK,CAAC,IAAI,KAAC,IAAI,IAAC,MAAM,QAAC,KAAK,EAAC,MAAM,qCAA4B,EAC3E,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CACzC,MAAC,IAAI,gCACO,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,QAAQ,YAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,GAAQ,WAAM,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,EAAE,UADvG,CAAC,CAAC,GAAG,CAET,CACV,CAAC,IACA,CACT,CAAC;IACN,CAAC;IAED,8BAA8B;IAC9B,OAAO,CACH,KAAC,GAAG,IAAC,OAAO,EAAE,CAAC,YACX,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,wBAAI,IAAI,EAAE,OAAO,IAAQ,GAC1C,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/notification/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"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useNotificationLogic } from './notification.logic.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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/notification/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,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"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface UseNotificationLogicProps {
|
|
2
|
-
action?: 'list';
|
|
3
|
-
}
|
|
4
|
-
export declare const useNotificationLogic: ({ action }: UseNotificationLogicProps) => {
|
|
5
|
-
action: "list";
|
|
6
|
-
data: any;
|
|
7
|
-
error: string | null;
|
|
8
|
-
loading: boolean;
|
|
9
|
-
};
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=notification.logic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification.logic.d.ts","sourceRoot":"","sources":["../../../src/commands/notification/notification.logic.ts"],"names":[],"mappings":"AAIA,UAAU,yBAAyB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,oBAAoB,GAAI,YAAqB,yBAAyB;;;;;CA4BlF,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
import { useApp } 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
|
-
useEffect(() => {
|
|
10
|
-
const run = async () => {
|
|
11
|
-
try {
|
|
12
|
-
if (action === 'list') {
|
|
13
|
-
const res = await api.get('/notifications');
|
|
14
|
-
setData(res.data);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
catch (err) {
|
|
18
|
-
setError(err.response?.data?.message || err.message || 'Error');
|
|
19
|
-
}
|
|
20
|
-
finally {
|
|
21
|
-
setLoading(false);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
run();
|
|
25
|
-
}, [action]);
|
|
26
|
-
return {
|
|
27
|
-
action,
|
|
28
|
-
data,
|
|
29
|
-
error,
|
|
30
|
-
loading
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=notification.logic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification.logic.js","sourceRoot":"","sources":["../../../src/commands/notification/notification.logic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,GAAG,MAAM,cAAc,CAAC;AAM/B,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,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"}
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification.screen.d.ts","sourceRoot":"","sources":["../../../src/commands/notification/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,CAsBhE,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
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)))] }));
|
|
10
|
-
}
|
|
11
|
-
return _jsx(Text, { children: "Notification System" });
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=notification.screen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification.screen.js","sourceRoot":"","sources":["../../../src/commands/notification/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,CAAC;IAE1D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CAAC,EAAE,MAAM,CAAA;CAAE,CAIvD,CAAC;AAEF,eAAO,MAAM,WAAW,+CAGvB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useProfileViewLogic, useProfileEditLogic } from './profile.logic.js';
|
|
3
|
-
import { ProfileViewScreen } from './profile-view.screen.js';
|
|
4
|
-
import { ProfileEditScreen } from './profile-edit.screen.js';
|
|
5
|
-
export const ProfileView = ({ username }) => {
|
|
6
|
-
// Logic needs to be updated to accept username too, but let's pass it for now
|
|
7
|
-
const logic = useProfileViewLogic(username);
|
|
8
|
-
return _jsx(ProfileViewScreen, { ...logic });
|
|
9
|
-
};
|
|
10
|
-
export const ProfileEdit = () => {
|
|
11
|
-
const logic = useProfileEditLogic();
|
|
12
|
-
return _jsx(ProfileEditScreen, { ...logic });
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/profile/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,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,8EAA8E;IAC9E,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"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface ProfileEditScreenProps {
|
|
3
|
-
step: number;
|
|
4
|
-
setStep: (step: number) => void;
|
|
5
|
-
profile: any;
|
|
6
|
-
setProfile: (profile: any) => void;
|
|
7
|
-
loading: boolean;
|
|
8
|
-
handleSubmit: () => void;
|
|
9
|
-
}
|
|
10
|
-
export declare const ProfileEditScreen: React.FC<ProfileEditScreenProps>;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=profile-edit.screen.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile-edit.screen.d.ts","sourceRoot":"","sources":["../../../src/commands/profile/profile-edit.screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,sBAAsB;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,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;CAC5B;AASD,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAuI9D,CAAC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Text, Box } from 'ink';
|
|
3
|
-
import TextInput from 'ink-text-input';
|
|
4
|
-
import SelectInput from 'ink-select-input';
|
|
5
|
-
const INTENT_ITEMS = [
|
|
6
|
-
{ label: 'Startup', value: 'startup' },
|
|
7
|
-
{ label: 'Collab', value: 'collab' },
|
|
8
|
-
{ label: 'Friends', value: 'friends' },
|
|
9
|
-
{ label: 'Mentorship', value: 'mentorship' },
|
|
10
|
-
];
|
|
11
|
-
export const ProfileEditScreen = ({ step, setStep, profile, setProfile, loading, handleSubmit }) => {
|
|
12
|
-
if (loading)
|
|
13
|
-
return _jsx(Text, { children: "Saving..." });
|
|
14
|
-
const steps = [
|
|
15
|
-
{
|
|
16
|
-
label: 'Main Intent',
|
|
17
|
-
component: (_jsx(SelectInput, { items: INTENT_ITEMS, onSelect: (item) => {
|
|
18
|
-
setProfile({ ...profile, intent: item.value });
|
|
19
|
-
setStep(step + 1);
|
|
20
|
-
} })),
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
label: 'Bio (One liner)',
|
|
24
|
-
component: (_jsx(TextInput, { value: profile.bio, onChange: (val) => setProfile({ ...profile, bio: val }), onSubmit: () => setStep(step + 1) })),
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
label: 'Age',
|
|
28
|
-
component: (_jsx(TextInput, { value: String(profile.age || ''), onChange: (val) => setProfile({ ...profile, age: val ? parseInt(val) : undefined }), onSubmit: () => setStep(step + 1) })),
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
label: 'Gender (male/female/other)',
|
|
32
|
-
component: (_jsx(TextInput, { value: profile.gender || '', onChange: (val) => setProfile({ ...profile, gender: val }), onSubmit: () => setStep(step + 1) })),
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
label: 'Company / College',
|
|
36
|
-
component: (_jsx(TextInput, { value: profile.company || '', onChange: (val) => setProfile({ ...profile, company: val }), onSubmit: () => setStep(step + 1) })),
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
label: 'Tech Stack (comma separated)',
|
|
40
|
-
component: (_jsx(TextInput, { value: profile.stack, onChange: (val) => setProfile({ ...profile, stack: val }), onSubmit: () => setStep(step + 1) })),
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
label: 'Interests (comma separated)',
|
|
44
|
-
component: (_jsx(TextInput, { value: profile.interests || '', onChange: (val) => setProfile({ ...profile, interests: val }), onSubmit: () => setStep(step + 1) })),
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
label: 'Location',
|
|
48
|
-
component: (_jsx(TextInput, { value: profile.location, onChange: (val) => setProfile({ ...profile, location: val }), onSubmit: () => setStep(step + 1) })),
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
label: 'GitHub Username',
|
|
52
|
-
component: (_jsx(TextInput, { value: profile.github, onChange: (val) => setProfile({ ...profile, github: val }), onSubmit: () => setStep(step + 1) })),
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
label: 'LinkedIn URL',
|
|
56
|
-
component: (_jsx(TextInput, { value: profile.linkedin || '', onChange: (val) => setProfile({ ...profile, linkedin: val }), onSubmit: () => setStep(step + 1) })),
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
label: 'Twitter URL',
|
|
60
|
-
component: (_jsx(TextInput, { value: profile.twitter || '', onChange: (val) => setProfile({ ...profile, twitter: val }), onSubmit: handleSubmit })),
|
|
61
|
-
},
|
|
62
|
-
];
|
|
63
|
-
const currentStep = steps[step];
|
|
64
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Text, { color: "yellow", bold: true, children: " Edit Profile " }), _jsxs(Box, { marginY: 1, children: [_jsxs(Text, { bold: true, children: [" ", currentStep.label, ": "] }), currentStep.component] }), _jsxs(Text, { color: "gray", children: ["Step ", step + 1, " of ", steps.length] })] }));
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=profile-edit.screen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile-edit.screen.js","sourceRoot":"","sources":["../../../src/commands/profile/profile-edit.screen.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAW3C,MAAM,YAAY,GAAG;IACjB,EA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B,SAAS,EAAE,CACP,KAAC,SAAS,IACN,KAAK,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE,EAC5B,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAC3D,QAAQ,EAAE,YAAY,GACxB,CACL;SACJ;KACJ,CAAC;IAEF,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IAEhC,OAAO,CACH,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,aAClC,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,qCAAsB,EAC/C,MAAC,GAAG,IAAC,OAAO,EAAE,CAAC,aACX,MAAC,IAAI,IAAC,IAAI,wBAAG,WAAW,CAAC,KAAK,UAAU,EACvC,WAAW,CAAC,SAAS,IACpB,EACN,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,sBAAO,IAAI,GAAG,CAAC,UAAM,KAAK,CAAC,MAAM,IAAQ,IACzD,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface ProfileViewScreenProps {
|
|
3
|
-
profile: any;
|
|
4
|
-
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile-view.screen.d.ts","sourceRoot":"","sources":["../../../src/commands/profile/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,CAwB9D,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
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: ", profile.location || 'N/A'] }), _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'] })] }));
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=profile-view.screen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile-view.screen.js","sourceRoot":"","sources":["../../../src/commands/profile/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,IAAI,yCAAwB,IAAI,EAAE,QAAQ,sDAAoD,CAAC;IAErH,OAAO,CACH,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,EAAE,WAAW,EAAC,OAAO,EAAC,WAAW,EAAC,MAAM,aAC1E,MAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,MAAM,mBAAI,OAAO,EAAE,IAAI,EAAE,QAAQ,IAAI,IAAI,EAAE,QAAQ,SAAS,EAC7E,KAAC,IAAI,6GAAuB,EAC5B,MAAC,IAAI,2BAAS,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YAAE,OAAO,CAAC,MAAM,GAAQ,IAAO,EAChE,MAAC,IAAI,wBAAO,OAAO,CAAC,GAAG,IAAI,KAAK,IAAQ,EACxC,MAAC,IAAI,wBAAO,OAAO,CAAC,GAAG,IAAI,KAAK,iBAAa,OAAO,CAAC,MAAM,IAAI,KAAK,IAAQ,EAC5E,MAAC,IAAI,oCAAmB,OAAO,CAAC,OAAO,IAAI,KAAK,IAAQ,EACxD,MAAC,IAAI,0BAAS,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,IAAQ,EACxD,MAAC,IAAI,8BAAa,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,IAAQ,EAChE,MAAC,IAAI,6BAAY,OAAO,CAAC,QAAQ,IAAI,KAAK,IAAQ,EAClD,KAAC,IAAI,6GAAuB,EAC5B,KAAC,IAAI,IAAC,IAAI,+BAAgB,EAC1B,MAAC,IAAI,2BAAU,OAAO,CAAC,MAAM,IAAI,KAAK,IAAQ,EAC9C,MAAC,IAAI,6BAAY,OAAO,CAAC,QAAQ,IAAI,KAAK,IAAQ,EAClD,MAAC,IAAI,4BAAW,OAAO,CAAC,OAAO,IAAI,KAAK,IAAQ,EAChD,MAAC,IAAI,4BAAW,OAAO,CAAC,OAAO,IAAI,KAAK,IAAQ,IAC9C,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export declare const useProfileViewLogic: (targetUsername?: string) => {
|
|
2
|
-
profile: any;
|
|
3
|
-
loading: boolean;
|
|
4
|
-
error: string | null;
|
|
5
|
-
user: {
|
|
6
|
-
username: string;
|
|
7
|
-
id: string;
|
|
8
|
-
} | undefined;
|
|
9
|
-
};
|
|
10
|
-
export declare const useProfileEditLogic: () => {
|
|
11
|
-
step: number;
|
|
12
|
-
setStep: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
13
|
-
profile: {
|
|
14
|
-
bio: string;
|
|
15
|
-
intent: string;
|
|
16
|
-
stack: string;
|
|
17
|
-
location: string;
|
|
18
|
-
github: string;
|
|
19
|
-
age?: number;
|
|
20
|
-
gender?: "male" | "female" | "other";
|
|
21
|
-
company?: string;
|
|
22
|
-
interests?: string;
|
|
23
|
-
linkedin?: string;
|
|
24
|
-
twitter?: string;
|
|
25
|
-
};
|
|
26
|
-
setProfile: import("react").Dispatch<import("react").SetStateAction<{
|
|
27
|
-
bio: string;
|
|
28
|
-
intent: string;
|
|
29
|
-
stack: string;
|
|
30
|
-
location: string;
|
|
31
|
-
github: string;
|
|
32
|
-
age?: number;
|
|
33
|
-
gender?: "male" | "female" | "other";
|
|
34
|
-
company?: string;
|
|
35
|
-
interests?: string;
|
|
36
|
-
linkedin?: string;
|
|
37
|
-
twitter?: string;
|
|
38
|
-
}>>;
|
|
39
|
-
loading: boolean;
|
|
40
|
-
handleSubmit: () => Promise<void>;
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=profile.logic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.logic.d.ts","sourceRoot":"","sources":["../../../src/commands/profile/profile.logic.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB,GAAI,iBAAiB,MAAM;;;;;;;;CA+B1D,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;aAInB,MAAM;gBACH,MAAM;eACP,MAAM;kBACH,MAAM;gBACR,MAAM;cACR,MAAM;iBACH,MAAM,GAAG,QAAQ,GAAG,OAAO;kBAC1B,MAAM;oBACJ,MAAM;mBACP,MAAM;kBACP,MAAM;;;aAVX,MAAM;gBACH,MAAM;eACP,MAAM;kBACH,MAAM;gBACR,MAAM;cACR,MAAM;iBACH,MAAM,GAAG,QAAQ,GAAG,OAAO;kBAC1B,MAAM;oBACJ,MAAM;mBACP,MAAM;kBACP,MAAM;;;;CAoCvB,CAAC"}
|