@replyke/ui-core-react-native 4.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/dist/cjs/components/CustomButton.d.ts +11 -0
- package/dist/cjs/components/CustomButton.js +27 -0
- package/dist/cjs/components/CustomButton.js.map +1 -0
- package/dist/cjs/components/EmojiSuggestions.d.ts +6 -0
- package/dist/cjs/components/EmojiSuggestions.js +59 -0
- package/dist/cjs/components/EmojiSuggestions.js.map +1 -0
- package/dist/cjs/components/FromNow.d.ts +9 -0
- package/dist/cjs/components/FromNow.js +54 -0
- package/dist/cjs/components/FromNow.js.map +1 -0
- package/dist/cjs/components/GiphyContainer.d.ts +14 -0
- package/dist/cjs/components/GiphyContainer.js +232 -0
- package/dist/cjs/components/GiphyContainer.js.map +1 -0
- package/dist/cjs/components/Skeleton.d.ts +6 -0
- package/dist/cjs/components/Skeleton.js +56 -0
- package/dist/cjs/components/Skeleton.js.map +1 -0
- package/dist/cjs/components/UserAvatar.d.ts +12 -0
- package/dist/cjs/components/UserAvatar.js +41 -0
- package/dist/cjs/components/UserAvatar.js.map +1 -0
- package/dist/cjs/components/index.d.ts +6 -0
- package/dist/cjs/components/index.js +21 -0
- package/dist/cjs/components/index.js.map +1 -0
- package/dist/cjs/constants/index.d.ts +1 -0
- package/dist/cjs/constants/index.js +18 -0
- package/dist/cjs/constants/index.js.map +1 -0
- package/dist/cjs/constants/reset-styles.d.ts +9 -0
- package/dist/cjs/constants/reset-styles.js +40 -0
- package/dist/cjs/constants/reset-styles.js.map +1 -0
- package/dist/cjs/helpers/getImageComponent.d.ts +10 -0
- package/dist/cjs/helpers/getImageComponent.js +25 -0
- package/dist/cjs/helpers/getImageComponent.js.map +1 -0
- package/dist/cjs/helpers/index.d.ts +2 -0
- package/dist/cjs/helpers/index.js +8 -0
- package/dist/cjs/helpers/index.js.map +1 -0
- package/dist/cjs/helpers/parseContentWithMentions.d.ts +2 -0
- package/dist/cjs/helpers/parseContentWithMentions.js +44 -0
- package/dist/cjs/helpers/parseContentWithMentions.js.map +1 -0
- package/dist/cjs/hooks/index.d.ts +1 -0
- package/dist/cjs/hooks/index.js +9 -0
- package/dist/cjs/hooks/index.js.map +1 -0
- package/dist/cjs/hooks/useTextInputCursorIndicator.d.ts +7 -0
- package/dist/cjs/hooks/useTextInputCursorIndicator.js +24 -0
- package/dist/cjs/hooks/useTextInputCursorIndicator.js.map +1 -0
- package/dist/cjs/icons/FlagIcon.d.ts +7 -0
- package/dist/cjs/icons/FlagIcon.js +42 -0
- package/dist/cjs/icons/FlagIcon.js.map +1 -0
- package/dist/cjs/icons/HeartFullIcon.d.ts +7 -0
- package/dist/cjs/icons/HeartFullIcon.js +40 -0
- package/dist/cjs/icons/HeartFullIcon.js.map +1 -0
- package/dist/cjs/icons/HeartIcon.d.ts +7 -0
- package/dist/cjs/icons/HeartIcon.js +40 -0
- package/dist/cjs/icons/HeartIcon.js.map +1 -0
- package/dist/cjs/icons/MagnifyingGlassIcon.d.ts +8 -0
- package/dist/cjs/icons/MagnifyingGlassIcon.js +40 -0
- package/dist/cjs/icons/MagnifyingGlassIcon.js.map +1 -0
- package/dist/cjs/icons/TrashIcon.d.ts +7 -0
- package/dist/cjs/icons/TrashIcon.js +40 -0
- package/dist/cjs/icons/TrashIcon.js.map +1 -0
- package/dist/cjs/icons/index.d.ts +6 -0
- package/dist/cjs/icons/index.js +17 -0
- package/dist/cjs/icons/index.js.map +1 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +22 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/components/CustomButton.d.ts +11 -0
- package/dist/esm/components/CustomButton.js +25 -0
- package/dist/esm/components/CustomButton.js.map +1 -0
- package/dist/esm/components/EmojiSuggestions.d.ts +6 -0
- package/dist/esm/components/EmojiSuggestions.js +57 -0
- package/dist/esm/components/EmojiSuggestions.js.map +1 -0
- package/dist/esm/components/FromNow.d.ts +9 -0
- package/dist/esm/components/FromNow.js +49 -0
- package/dist/esm/components/FromNow.js.map +1 -0
- package/dist/esm/components/GiphyContainer.d.ts +14 -0
- package/dist/esm/components/GiphyContainer.js +229 -0
- package/dist/esm/components/GiphyContainer.js.map +1 -0
- package/dist/esm/components/Skeleton.d.ts +6 -0
- package/dist/esm/components/Skeleton.js +52 -0
- package/dist/esm/components/Skeleton.js.map +1 -0
- package/dist/esm/components/UserAvatar.d.ts +12 -0
- package/dist/esm/components/UserAvatar.js +39 -0
- package/dist/esm/components/UserAvatar.js.map +1 -0
- package/dist/esm/components/index.d.ts +6 -0
- package/dist/esm/components/index.js +7 -0
- package/dist/esm/components/index.js.map +1 -0
- package/dist/esm/constants/index.d.ts +1 -0
- package/dist/esm/constants/index.js +2 -0
- package/dist/esm/constants/index.js.map +1 -0
- package/dist/esm/constants/reset-styles.d.ts +9 -0
- package/dist/esm/constants/reset-styles.js +37 -0
- package/dist/esm/constants/reset-styles.js.map +1 -0
- package/dist/esm/helpers/getImageComponent.d.ts +10 -0
- package/dist/esm/helpers/getImageComponent.js +21 -0
- package/dist/esm/helpers/getImageComponent.js.map +1 -0
- package/dist/esm/helpers/index.d.ts +2 -0
- package/dist/esm/helpers/index.js +3 -0
- package/dist/esm/helpers/index.js.map +1 -0
- package/dist/esm/helpers/parseContentWithMentions.d.ts +2 -0
- package/dist/esm/helpers/parseContentWithMentions.js +40 -0
- package/dist/esm/helpers/parseContentWithMentions.js.map +1 -0
- package/dist/esm/hooks/index.d.ts +1 -0
- package/dist/esm/hooks/index.js +2 -0
- package/dist/esm/hooks/index.js.map +1 -0
- package/dist/esm/hooks/useTextInputCursorIndicator.d.ts +7 -0
- package/dist/esm/hooks/useTextInputCursorIndicator.js +21 -0
- package/dist/esm/hooks/useTextInputCursorIndicator.js.map +1 -0
- package/dist/esm/icons/FlagIcon.d.ts +7 -0
- package/dist/esm/icons/FlagIcon.js +7 -0
- package/dist/esm/icons/FlagIcon.js.map +1 -0
- package/dist/esm/icons/HeartFullIcon.d.ts +7 -0
- package/dist/esm/icons/HeartFullIcon.js +5 -0
- package/dist/esm/icons/HeartFullIcon.js.map +1 -0
- package/dist/esm/icons/HeartIcon.d.ts +7 -0
- package/dist/esm/icons/HeartIcon.js +5 -0
- package/dist/esm/icons/HeartIcon.js.map +1 -0
- package/dist/esm/icons/MagnifyingGlassIcon.d.ts +8 -0
- package/dist/esm/icons/MagnifyingGlassIcon.js +5 -0
- package/dist/esm/icons/MagnifyingGlassIcon.js.map +1 -0
- package/dist/esm/icons/TrashIcon.d.ts +7 -0
- package/dist/esm/icons/TrashIcon.js +5 -0
- package/dist/esm/icons/TrashIcon.js.map +1 -0
- package/dist/esm/icons/index.d.ts +6 -0
- package/dist/esm/icons/index.js +7 -0
- package/dist/esm/icons/index.js.map +1 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
declare const CustomButton: ({ onPress, text, activeText, error, disabled, style, submitting, }: {
|
|
3
|
+
onPress: () => void;
|
|
4
|
+
text: string;
|
|
5
|
+
activeText: string;
|
|
6
|
+
style?: StyleProp<ViewStyle>;
|
|
7
|
+
error?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
submitting?: boolean;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default CustomButton;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_native_1 = require("react-native");
|
|
5
|
+
const CustomButton = ({ onPress, text, activeText, error, disabled, style, submitting, }) => {
|
|
6
|
+
const baseStyle = {
|
|
7
|
+
backgroundColor: "#60a5fa",
|
|
8
|
+
paddingHorizontal: 16,
|
|
9
|
+
paddingVertical: 20,
|
|
10
|
+
flexDirection: "row",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
justifyContent: "center",
|
|
13
|
+
borderRadius: 12,
|
|
14
|
+
};
|
|
15
|
+
const textStyle = {
|
|
16
|
+
fontSize: 18,
|
|
17
|
+
fontWeight: "500",
|
|
18
|
+
color: "#ffffff",
|
|
19
|
+
};
|
|
20
|
+
const errorStyle = {
|
|
21
|
+
color: "#ef4444",
|
|
22
|
+
marginTop: 4,
|
|
23
|
+
};
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: style, children: [disabled ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { ...baseStyle, opacity: 0.5, pointerEvents: "none" }, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: textStyle, children: submitting ? activeText : text }) })) : ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { onPress: onPress, style: baseStyle, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: textStyle, children: submitting ? activeText : text }) })), error && (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: errorStyle, children: error })] }));
|
|
25
|
+
};
|
|
26
|
+
exports.default = CustomButton;
|
|
27
|
+
//# sourceMappingURL=CustomButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomButton.js","sourceRoot":"","sources":["../../../src/components/CustomButton.tsx"],"names":[],"mappings":";;;AAAA,+CAOsB;AAEtB,MAAM,YAAY,GAAG,CAAC,EACpB,OAAO,EACP,IAAI,EACJ,UAAU,EACV,KAAK,EACL,QAAQ,EACR,KAAK,EACL,UAAU,GASX,EAAE,EAAE;IACH,MAAM,SAAS,GAAc;QAC3B,eAAe,EAAE,SAAS;QAC1B,iBAAiB,EAAE,EAAE;QACrB,eAAe,EAAE,EAAE;QACnB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,YAAY,EAAE,EAAE;KACjB,CAAC;IAEF,MAAM,SAAS,GAAc;QAC3B,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,SAAS;KACjB,CAAC;IAEF,MAAM,UAAU,GAAc;QAC5B,KAAK,EAAE,SAAS;QAChB,SAAS,EAAE,CAAC;KACb,CAAC;IAEF,OAAO,CACL,wBAAC,mBAAI,IAAC,KAAK,EAAE,KAAK,aACf,QAAQ,CAAC,CAAC,CAAC,CACV,uBAAC,mBAAI,IAAC,KAAK,EAAE,EAAE,GAAG,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,YAChE,uBAAC,mBAAI,IAAC,KAAK,EAAE,SAAS,YAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,GAAQ,GAC1D,CACR,CAAC,CAAC,CAAC,CACF,uBAAC,+BAAgB,IAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,YAClD,uBAAC,mBAAI,IAAC,KAAK,EAAE,SAAS,YAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,GAAQ,GAC9C,CACpB,EAEA,KAAK,IAAI,uBAAC,mBAAI,IAAC,KAAK,EAAE,UAAU,YAAG,KAAK,GAAQ,IAC5C,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const emojiGroup1 = ["😂", "❤️", "🤣", "😍", "🙏"];
|
|
7
|
+
const emojiGroup2 = ["🥰", "😊", "😭", "👍", "😅"];
|
|
8
|
+
const emojiGroup3 = ["😢", "👏", "💕", "🥺", "😘"];
|
|
9
|
+
const emojiGroup4 = ["🤔", "🤗", "🙌", "😎", "✨"];
|
|
10
|
+
const EmojiSuggestions = ({ onEmojiClick, }) => {
|
|
11
|
+
const [clickedEmoji, setClickedEmoji] = (0, react_1.useState)(null);
|
|
12
|
+
const [scaleAnim] = (0, react_1.useState)(new react_native_1.Animated.Value(1));
|
|
13
|
+
const [emojiSubset, setEmojiSubset] = (0, react_1.useState)([]);
|
|
14
|
+
(0, react_1.useEffect)(() => {
|
|
15
|
+
// Pick 8 random emojis from the array
|
|
16
|
+
const combinedEmojis = [...emojiGroup1, ...emojiGroup2, ...emojiGroup3];
|
|
17
|
+
const shuffled = combinedEmojis.sort(() => 0.5 - Math.random());
|
|
18
|
+
setEmojiSubset(shuffled.slice(0, 8));
|
|
19
|
+
}, []);
|
|
20
|
+
const handleEmojiClick = (emoji) => {
|
|
21
|
+
setClickedEmoji(emoji);
|
|
22
|
+
// Shrink animation
|
|
23
|
+
react_native_1.Animated.sequence([
|
|
24
|
+
react_native_1.Animated.timing(scaleAnim, {
|
|
25
|
+
toValue: 0.8,
|
|
26
|
+
duration: 100,
|
|
27
|
+
useNativeDriver: true,
|
|
28
|
+
}),
|
|
29
|
+
react_native_1.Animated.timing(scaleAnim, {
|
|
30
|
+
toValue: 1,
|
|
31
|
+
duration: 100,
|
|
32
|
+
useNativeDriver: true,
|
|
33
|
+
}),
|
|
34
|
+
]).start(() => {
|
|
35
|
+
setClickedEmoji(null);
|
|
36
|
+
});
|
|
37
|
+
onEmojiClick(emoji);
|
|
38
|
+
};
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
|
|
40
|
+
borderBottomWidth: 0.5,
|
|
41
|
+
borderBottomColor: "#e6e6e6",
|
|
42
|
+
padding: 8,
|
|
43
|
+
flexDirection: "row",
|
|
44
|
+
justifyContent: "space-around", // Distribute emojis evenly
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
}, children: emojiSubset.map((emoji) => ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { onPress: () => handleEmojiClick(emoji), activeOpacity: 0.7, children: (0, jsx_runtime_1.jsx)(react_native_1.Animated.View, { style: {
|
|
47
|
+
transform: [
|
|
48
|
+
{
|
|
49
|
+
scale: clickedEmoji === emoji ? scaleAnim : 1,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
justifyContent: "center",
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
}, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: {
|
|
55
|
+
fontSize: 24,
|
|
56
|
+
}, children: emoji }) }) }, emoji))) }));
|
|
57
|
+
};
|
|
58
|
+
exports.default = EmojiSuggestions;
|
|
59
|
+
//# sourceMappingURL=EmojiSuggestions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmojiSuggestions.js","sourceRoot":"","sources":["../../../src/components/EmojiSuggestions.tsx"],"names":[],"mappings":";;;AAAA,iCAAmD;AACnD,+CAAsE;AAEtE,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACnD,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACnD,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACnD,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;AAMlD,MAAM,gBAAgB,GAAoC,CAAC,EACzD,YAAY,GACb,EAAE,EAAE;IACH,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAgB,IAAI,CAAC,CAAC;IACtE,MAAM,CAAC,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,uBAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,MAA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W,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC1B,uBAAC,+BAAgB,IAEf,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,EACtC,aAAa,EAAE,GAAG,YAElB,uBAAC,uBAAQ,CAAC,IAAI,IACZ,KAAK,EAAE;oBACL,SAAS,EAAE;wBACT;4BACE,KAAK,EAAE,YAAY,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;yBAC9C;qBACF;oBACD,cAAc,EAAE,QAAQ;oBACxB,UAAU,EAAE,QAAQ;iBACrB,YAED,uBAAC,mBAAI,IACH,KAAK,EAAE;wBACL,QAAQ,EAAE,EAAE;qBACb,YAEA,KAAK,GACD,GACO,IAtBX,KAAK,CAuBO,CACpB,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare function FromNow({ time, fontSize, fontWeight, color, lean, justNowText, }: {
|
|
2
|
+
time: Date | string;
|
|
3
|
+
fontSize?: number;
|
|
4
|
+
fontWeight?: number;
|
|
5
|
+
color?: string;
|
|
6
|
+
lean?: boolean;
|
|
7
|
+
justNowText?: string;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default FromNow;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const moment_1 = __importDefault(require("moment"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
function formatTime(time, justNowText) {
|
|
10
|
+
const now = new Date();
|
|
11
|
+
const then = new Date(time);
|
|
12
|
+
const seconds = Math.floor((now.getTime() - then.getTime()) / 1000);
|
|
13
|
+
let timeString = "";
|
|
14
|
+
if (seconds < 20) {
|
|
15
|
+
timeString = justNowText;
|
|
16
|
+
}
|
|
17
|
+
else if (seconds < 60) {
|
|
18
|
+
timeString = `${seconds}s`;
|
|
19
|
+
}
|
|
20
|
+
else if (seconds < 3600) {
|
|
21
|
+
timeString = `${Math.floor(seconds / 60)}m`;
|
|
22
|
+
}
|
|
23
|
+
else if (seconds < 86400) {
|
|
24
|
+
timeString = `${Math.floor(seconds / 3600)}h`;
|
|
25
|
+
}
|
|
26
|
+
else if (seconds < 2592000) {
|
|
27
|
+
// 30 days
|
|
28
|
+
timeString = `${Math.floor(seconds / 86400)}d`;
|
|
29
|
+
}
|
|
30
|
+
else if (seconds < 31536000) {
|
|
31
|
+
// 365 days
|
|
32
|
+
timeString = `${Math.floor(seconds / 2592000)}mo`;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
timeString = `${Math.floor(seconds / 31536000)}y`;
|
|
36
|
+
}
|
|
37
|
+
return timeString;
|
|
38
|
+
}
|
|
39
|
+
function FromNow({ time, fontSize = 12, fontWeight = 400, color = "#737373", lean, justNowText = "Just now", }) {
|
|
40
|
+
if (lean) {
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: {
|
|
42
|
+
fontSize,
|
|
43
|
+
fontWeight: fontWeight,
|
|
44
|
+
color,
|
|
45
|
+
}, children: formatTime(time, justNowText) }));
|
|
46
|
+
}
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: {
|
|
48
|
+
fontSize,
|
|
49
|
+
fontWeight: fontWeight,
|
|
50
|
+
color,
|
|
51
|
+
}, children: (0, moment_1.default)(new Date(time)).fromNow() }));
|
|
52
|
+
}
|
|
53
|
+
exports.default = FromNow;
|
|
54
|
+
//# sourceMappingURL=FromNow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"From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AAC,KAAK,CAAC,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC;IACpD,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,OAAO,CAAC,EACf,IAAI,EACJ,QAAQ,GAAG,EAAE,EACb,UAAU,GAAG,GAAG,EAChB,KAAK,GAAG,SAAS,EACjB,IAAI,EACJ,WAAW,GAAG,UAAU,GAQzB;IACC,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,CACL,uBAAC,mBAAI,IACH,KAAK,EAAE;gBACL,QAAQ;gBACR,UAAU,EAAE,UAAwB;gBACpC,KAAK;aACN,YAEA,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,GACzB,CACR,CAAC;IACJ,CAAC;IACD,OAAO,CACL,uBAAC,mBAAI,IACH,KAAK,EAAE;YACL,QAAQ;YACR,UAAU,EAAE,UAAwB;YACpC,KAAK;SACN,YAEA,IAAA,gBAAM,EAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,GAC5B,CACR,CAAC;AACJ,CAAC;AAED,kBAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface GiphyContainerProps {
|
|
2
|
+
onClickBack: () => void;
|
|
3
|
+
onSelectGif: (selectedGif: {
|
|
4
|
+
id: string;
|
|
5
|
+
url: string;
|
|
6
|
+
gifUrl: string;
|
|
7
|
+
gifPreviewUrl: string;
|
|
8
|
+
altText: string | undefined;
|
|
9
|
+
aspectRatio: number;
|
|
10
|
+
}) => void;
|
|
11
|
+
visible: boolean;
|
|
12
|
+
}
|
|
13
|
+
export default function GiphyContainer({ onClickBack, onSelectGif, visible, }: GiphyContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = GiphyContainer;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_native_1 = require("react-native");
|
|
7
|
+
const core_1 = require("@replyke/core");
|
|
8
|
+
const react_native_gesture_handler_1 = require("react-native-gesture-handler");
|
|
9
|
+
const icons_1 = require("../icons");
|
|
10
|
+
const getImageComponent_1 = require("../helpers/getImageComponent");
|
|
11
|
+
const MAX_ITEMS = 60; // Define the maximum number of items to load
|
|
12
|
+
const FETCH_LIMIT = 30;
|
|
13
|
+
function GiphyContainer({ onClickBack, onSelectGif, visible, }) {
|
|
14
|
+
const { project } = (0, core_1.useProject)();
|
|
15
|
+
const giphyApiKey = project?.integrations.giphy?.apiKey;
|
|
16
|
+
// Dynamically get the correct Image component and whether it is expo-image.
|
|
17
|
+
const { ImageComponent, isExpo } = (0, getImageComponent_1.getImageComponent)();
|
|
18
|
+
const [gifs, setGifs] = (0, react_1.useState)([]);
|
|
19
|
+
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
20
|
+
const [loadingMore, setLoadingMore] = (0, react_1.useState)(false);
|
|
21
|
+
const [currentOffset, setCurrentOffset] = (0, react_1.useState)(0);
|
|
22
|
+
const [totalCount, setTotalCount] = (0, react_1.useState)(0);
|
|
23
|
+
const [flatListWidth, setFlatListWidth] = (0, react_1.useState)(0); // Track the width of the FlatList
|
|
24
|
+
// Search states & debouncing
|
|
25
|
+
const [query, setQuery] = (0, react_1.useState)("");
|
|
26
|
+
const [debouncedQuery, setDebouncedQuery] = (0, react_1.useState)("");
|
|
27
|
+
// Refs to track fetching state and gifs length
|
|
28
|
+
const isFetchingRef = (0, react_1.useRef)(false);
|
|
29
|
+
const gifsLengthRef = (0, react_1.useRef)(0);
|
|
30
|
+
// Debounce effect (like in the web version)
|
|
31
|
+
(0, react_1.useEffect)(() => {
|
|
32
|
+
const handler = setTimeout(() => {
|
|
33
|
+
setDebouncedQuery(query);
|
|
34
|
+
}, 500); // 500ms debounce
|
|
35
|
+
return () => clearTimeout(handler);
|
|
36
|
+
}, [query]);
|
|
37
|
+
// Update gifsLengthRef when gifs change
|
|
38
|
+
(0, react_1.useEffect)(() => {
|
|
39
|
+
gifsLengthRef.current = gifs.length;
|
|
40
|
+
}, [gifs]);
|
|
41
|
+
// Fetch function that decides between trending or search
|
|
42
|
+
const fetchGifs = (0, react_1.useCallback)(async (offset = 0) => {
|
|
43
|
+
// Prevent multiple fetches
|
|
44
|
+
if (isFetchingRef.current) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
// Check if we've reached the maximum limit
|
|
48
|
+
if (Math.max(gifsLengthRef.current, offset) >= MAX_ITEMS) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
isFetchingRef.current = true;
|
|
52
|
+
if (offset === 0) {
|
|
53
|
+
setLoading(true);
|
|
54
|
+
setLoadingMore(false);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
setLoadingMore(true);
|
|
58
|
+
}
|
|
59
|
+
let url = "";
|
|
60
|
+
const trimmed = debouncedQuery.trim();
|
|
61
|
+
if (trimmed.length === 0) {
|
|
62
|
+
// Fetch trending if no query
|
|
63
|
+
url = `https://api.giphy.com/v1/gifs/trending?api_key=${giphyApiKey}&limit=${FETCH_LIMIT}&offset=${offset}`;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
// Fetch search results
|
|
67
|
+
url = `https://api.giphy.com/v1/gifs/search?api_key=${giphyApiKey}&q=${encodeURIComponent(trimmed)}&limit=${FETCH_LIMIT}&offset=${offset}`;
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
const res = await fetch(url);
|
|
71
|
+
const json = (await res.json());
|
|
72
|
+
if (json.meta.status !== 200) {
|
|
73
|
+
console.error("API Error:", json.meta.msg);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
setTotalCount(json.pagination.total_count);
|
|
77
|
+
setCurrentOffset(json.pagination.offset + json.pagination.count);
|
|
78
|
+
// Calculate how many items we can still fetch
|
|
79
|
+
const remainingItems = MAX_ITEMS - gifsLengthRef.current;
|
|
80
|
+
const fetchedItems = json.data.slice(0, remainingItems);
|
|
81
|
+
if (offset === 0) {
|
|
82
|
+
setGifs(fetchedItems);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
setGifs((prevGifs) => [...prevGifs, ...fetchedItems]);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
console.error("Fetch Error:", err);
|
|
90
|
+
}
|
|
91
|
+
finally {
|
|
92
|
+
if (offset === 0) {
|
|
93
|
+
setLoading(false);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
setLoadingMore(false);
|
|
97
|
+
}
|
|
98
|
+
isFetchingRef.current = false;
|
|
99
|
+
}
|
|
100
|
+
}, [debouncedQuery, giphyApiKey]);
|
|
101
|
+
// Fetch more GIFs when reaching the end
|
|
102
|
+
const fetchMoreGifs = (0, react_1.useCallback)(() => {
|
|
103
|
+
if (loading ||
|
|
104
|
+
loadingMore ||
|
|
105
|
+
gifsLengthRef.current >= totalCount ||
|
|
106
|
+
gifsLengthRef.current >= MAX_ITEMS ||
|
|
107
|
+
isFetchingRef.current) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
fetchGifs(currentOffset);
|
|
111
|
+
}, [loading, loadingMore, totalCount, currentOffset, fetchGifs]);
|
|
112
|
+
// Reset search and pagination when visibility or query changes
|
|
113
|
+
(0, react_1.useEffect)(() => {
|
|
114
|
+
if (!visible) {
|
|
115
|
+
// Reset all states when not visible
|
|
116
|
+
setQuery("");
|
|
117
|
+
setDebouncedQuery("");
|
|
118
|
+
setGifs([]);
|
|
119
|
+
setCurrentOffset(0);
|
|
120
|
+
setTotalCount(0);
|
|
121
|
+
setLoading(false);
|
|
122
|
+
setLoadingMore(false);
|
|
123
|
+
isFetchingRef.current = false;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
// When visibility changes to true, reset offset and fetch initial gifs
|
|
127
|
+
setCurrentOffset(0);
|
|
128
|
+
setTotalCount(0);
|
|
129
|
+
setGifs([]);
|
|
130
|
+
fetchGifs(0);
|
|
131
|
+
}
|
|
132
|
+
}, [visible, debouncedQuery, fetchGifs]);
|
|
133
|
+
// Handle ScrollView layout to dynamically calculate column width
|
|
134
|
+
const handleLayout = (event) => {
|
|
135
|
+
const { width } = event.nativeEvent.layout;
|
|
136
|
+
setFlatListWidth(width);
|
|
137
|
+
};
|
|
138
|
+
const renderMasonryColumns = () => {
|
|
139
|
+
if (!flatListWidth)
|
|
140
|
+
return null;
|
|
141
|
+
const padding = 16; // Total horizontal padding
|
|
142
|
+
const columnSpacing = 8; // Spacing between columns
|
|
143
|
+
const columnWidth = (flatListWidth - padding - columnSpacing) / 2; // Two columns
|
|
144
|
+
// Split data into two columns
|
|
145
|
+
const columns = [[], []];
|
|
146
|
+
gifs.forEach((gif, index) => {
|
|
147
|
+
columns[index % 2].push(gif); // Alternately add to each column
|
|
148
|
+
});
|
|
149
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
|
|
150
|
+
flexDirection: "row",
|
|
151
|
+
justifyContent: "space-between",
|
|
152
|
+
paddingHorizontal: 4,
|
|
153
|
+
}, children: columns.map((column, colIndex) => ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { flex: 1, marginHorizontal: 4 }, children: column.map((item) => {
|
|
154
|
+
const aspectRatio = parseInt(item.images.fixed_width.height) /
|
|
155
|
+
parseInt(item.images.fixed_width.width);
|
|
156
|
+
const imageStyle = {
|
|
157
|
+
width: columnWidth,
|
|
158
|
+
height: columnWidth * aspectRatio,
|
|
159
|
+
borderRadius: 4,
|
|
160
|
+
};
|
|
161
|
+
// Build the props based on which Image component is being used.
|
|
162
|
+
// For expo-image, we assume it accepts a string for its "source"
|
|
163
|
+
// and additional props like "contentFit" and "transition".
|
|
164
|
+
// For React Native's Image, we wrap the URL in an object with "uri".
|
|
165
|
+
const imageProps = isExpo
|
|
166
|
+
? {
|
|
167
|
+
source: item.images.fixed_width.webp, // expo-image accepts a string
|
|
168
|
+
style: imageStyle,
|
|
169
|
+
contentFit: "cover",
|
|
170
|
+
transition: 500,
|
|
171
|
+
}
|
|
172
|
+
: {
|
|
173
|
+
source: { uri: item.images.fixed_width.webp }, // React Native expects an object with a "uri" property
|
|
174
|
+
style: imageStyle,
|
|
175
|
+
};
|
|
176
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: { marginBottom: 8 }, onPress: () => {
|
|
177
|
+
react_native_1.Keyboard.dismiss(); // Dismiss the keyboard
|
|
178
|
+
onSelectGif({
|
|
179
|
+
id: item.id,
|
|
180
|
+
url: item.url,
|
|
181
|
+
aspectRatio,
|
|
182
|
+
gifUrl: item.images.fixed_width.webp,
|
|
183
|
+
gifPreviewUrl: item.images.preview_gif.webp,
|
|
184
|
+
altText: item.title,
|
|
185
|
+
});
|
|
186
|
+
}, children: (0, jsx_runtime_1.jsx)(ImageComponent, { ...imageProps }) }, item.id));
|
|
187
|
+
}) }, colIndex))) }));
|
|
188
|
+
};
|
|
189
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableWithoutFeedback, { onPress: react_native_1.Keyboard.dismiss, accessible: false, children: (0, jsx_runtime_1.jsxs)(react_native_1.Animated.View, { style: {
|
|
190
|
+
position: "absolute",
|
|
191
|
+
top: 0,
|
|
192
|
+
left: 0,
|
|
193
|
+
right: 0,
|
|
194
|
+
bottom: 0,
|
|
195
|
+
backgroundColor: "white",
|
|
196
|
+
zIndex: 999,
|
|
197
|
+
opacity: visible ? 1 : 0,
|
|
198
|
+
pointerEvents: visible ? "auto" : "none",
|
|
199
|
+
}, children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
|
|
200
|
+
flexDirection: "row",
|
|
201
|
+
padding: 8,
|
|
202
|
+
alignItems: "stretch",
|
|
203
|
+
gap: 8,
|
|
204
|
+
}, children: [(0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: {
|
|
205
|
+
backgroundColor: "#e5e7eb",
|
|
206
|
+
aspectRatio: 1, // Ensures width equals height
|
|
207
|
+
alignItems: "center",
|
|
208
|
+
justifyContent: "center",
|
|
209
|
+
borderRadius: 8, // Keeps it rounded
|
|
210
|
+
}, onPress: onClickBack, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: { color: "#888", fontSize: 22, lineHeight: 22 }, children: "\u2190" }) }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
|
|
211
|
+
flex: 1,
|
|
212
|
+
flexDirection: "row",
|
|
213
|
+
backgroundColor: "#e5e7eb",
|
|
214
|
+
borderRadius: 8,
|
|
215
|
+
paddingHorizontal: 16,
|
|
216
|
+
alignItems: "center",
|
|
217
|
+
gap: 12,
|
|
218
|
+
}, children: [(0, jsx_runtime_1.jsx)(icons_1.MagnifyingGlassIcon, { width: 16, color: "#888" }), (0, jsx_runtime_1.jsx)(react_native_1.TextInput, { style: {
|
|
219
|
+
flex: 1,
|
|
220
|
+
paddingVertical: 12,
|
|
221
|
+
fontSize: 15,
|
|
222
|
+
}, placeholder: "Search GIPHY", onChangeText: (value) => setQuery(value), value: query })] })] }), loading && gifs.length === 0 ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: { textAlign: "center", marginTop: 16 }, children: "Loading..." })) : ((0, jsx_runtime_1.jsxs)(react_native_gesture_handler_1.ScrollView, { onLayout: handleLayout, onScroll: ({ nativeEvent }) => {
|
|
223
|
+
const { layoutMeasurement, contentOffset, contentSize } = nativeEvent;
|
|
224
|
+
const currentScroll = contentOffset.y + layoutMeasurement.height;
|
|
225
|
+
const threshold = contentSize.height * 0.8; // 80% scroll
|
|
226
|
+
if (currentScroll >= threshold) {
|
|
227
|
+
fetchMoreGifs();
|
|
228
|
+
}
|
|
229
|
+
}, keyboardShouldPersistTaps: "handled" // Important to allow tapping through the keyboard
|
|
230
|
+
, scrollEventThrottle: 16, children: [renderMasonryColumns(), loadingMore && ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: { textAlign: "center", marginVertical: 16 }, children: "Loading more..." }))] }))] }) }));
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=GiphyContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GiphyContainer.js","sourceRoot":"","sources":["../../../src/components/GiphyContainer.tsx"],"names":[],"mappings":";;AA4DA,iCAsUC;;AAlYD,iCAAiE;AAEjE,+CASsB;AACtB,wCAA2C;AAE3C,+EAA0D;AAC1D,oCAA+C;AAC/C,oEAAiE;AAuCjE,MAAM,SAAS,GAAG,EAAE,CAAC,CAAC,6CAA6C;AACnE,MAAM,WAAW,GAAG,EAAE,CAAC;AAIvB,SAAwB,cAAc,CAAC,EACrC,WAAW,EACX,WAAW,EACX,OAAO,GACa;IACpB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,iBAAU,GAAE,CAAC;IACjC,MAAM,WAAW,GAAG,OAAO,EAAE,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC;IAExD,4EAA4E;IAC5E,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,IAAA,qCAAiB,GAAE,CAAC;IAEvD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,EAAY,EAAE,CAAC,CAAC;IAChD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IACtD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAC;IACtD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAC;IAEhD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,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AC,SAAS,CAAC,kDAAkD;sBACtF,mBAAmB,EAAE,EAAE,aAEtB,oBAAoB,EAAE,EACtB,WAAW,IAAI,CACd,uBAAC,mBAAI,IAAC,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,EAAE,gCAEjD,CACR,IAOU,CACd,IACa,GACS,CAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare function Skeleton({ style }: {
|
|
2
|
+
style?: any;
|
|
3
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function CommentSkeleton(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function UserMentionSkeleton(): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { CommentSkeleton, UserMentionSkeleton, Skeleton };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommentSkeleton = CommentSkeleton;
|
|
4
|
+
exports.UserMentionSkeleton = UserMentionSkeleton;
|
|
5
|
+
exports.Skeleton = Skeleton;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
function Skeleton({ style }) {
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Animated.View, { style: [styles.skeleton, style, { opacity: new react_native_1.Animated.Value(0.6) }] }));
|
|
10
|
+
}
|
|
11
|
+
function CommentSkeleton() {
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.commentContainer, children: [(0, jsx_runtime_1.jsx)(Skeleton, { style: styles.avatarSkeleton }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.textSkeletonContainer, children: [(0, jsx_runtime_1.jsx)(Skeleton, { style: { ...styles.textSkeleton, width: "30%" } }), (0, jsx_runtime_1.jsx)(Skeleton, { style: styles.textSkeleton }), (0, jsx_runtime_1.jsx)(Skeleton, { style: { ...styles.textSkeleton, width: "15%" } })] })] }));
|
|
13
|
+
}
|
|
14
|
+
function UserMentionSkeleton() {
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.mentionContainer, children: [(0, jsx_runtime_1.jsx)(Skeleton, { style: styles.mentionAvatarSkeleton }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: { flex: 1 }, children: (0, jsx_runtime_1.jsx)(Skeleton, { style: styles.textSkeleton }) })] }));
|
|
16
|
+
}
|
|
17
|
+
const styles = react_native_1.StyleSheet.create({
|
|
18
|
+
skeleton: {
|
|
19
|
+
backgroundColor: "#efefef",
|
|
20
|
+
borderRadius: 8,
|
|
21
|
+
width: "100%",
|
|
22
|
+
height: 16,
|
|
23
|
+
},
|
|
24
|
+
commentContainer: {
|
|
25
|
+
flexDirection: "row",
|
|
26
|
+
alignItems: "flex-start",
|
|
27
|
+
gap: 8,
|
|
28
|
+
width: "100%",
|
|
29
|
+
},
|
|
30
|
+
avatarSkeleton: {
|
|
31
|
+
height: 50,
|
|
32
|
+
width: 50,
|
|
33
|
+
borderRadius: 25,
|
|
34
|
+
},
|
|
35
|
+
textSkeletonContainer: {
|
|
36
|
+
flex: 1,
|
|
37
|
+
gap: 8,
|
|
38
|
+
},
|
|
39
|
+
textSkeleton: {
|
|
40
|
+
width: "100%",
|
|
41
|
+
height: 16,
|
|
42
|
+
borderRadius: 8,
|
|
43
|
+
},
|
|
44
|
+
mentionContainer: {
|
|
45
|
+
flexDirection: "row",
|
|
46
|
+
gap: 8,
|
|
47
|
+
width: "100%",
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
},
|
|
50
|
+
mentionAvatarSkeleton: {
|
|
51
|
+
height: 35,
|
|
52
|
+
width: 35,
|
|
53
|
+
borderRadius: 17.5,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=Skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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AED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,QAAQ,EAAE;QACR,eAAe,EAAE,SAAS;QAC1B,YAAY,EAAE,CAAC;QACf,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,EAAE;KACX;IACD,gBAAgB,EAAE;QAChB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,YAAY;QACxB,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,MAAM;KACd;IACD,cAAc,EAAE;QACd,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,YAAY,EAAE,EAAE;KACjB;IACD,qBAAqB,EAAE;QACrB,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,CAAC;KACP;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,CAAC;KAChB;IACD,gBAAgB,EAAE;QAChB,aAAa,EAAE,KAAK;QACpB,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,QAAQ;KACrB;IACD,qBAAqB,EAAE;QACrB,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,YAAY,EAAE,IAAI;KACnB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface UserProps {
|
|
2
|
+
id?: string;
|
|
3
|
+
avatar?: string | null | undefined;
|
|
4
|
+
name?: string | null | undefined;
|
|
5
|
+
username?: string | null | undefined;
|
|
6
|
+
}
|
|
7
|
+
declare const UserAvatar: ({ user, size, borderRadius, }: {
|
|
8
|
+
user: UserProps | null | undefined;
|
|
9
|
+
size?: number | undefined;
|
|
10
|
+
borderRadius?: number | undefined;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export default UserAvatar;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_native_1 = require("react-native");
|
|
5
|
+
const UserAvatar = ({ user, size = 32, borderRadius, }) => {
|
|
6
|
+
if (!user)
|
|
7
|
+
return null;
|
|
8
|
+
const userImg = user.avatar
|
|
9
|
+
? user.avatar
|
|
10
|
+
: `https://api.dicebear.com/9.x/thumbs/png?seed=${user.id}`;
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: [
|
|
12
|
+
styles.avatarContainer,
|
|
13
|
+
{
|
|
14
|
+
width: size,
|
|
15
|
+
height: size,
|
|
16
|
+
borderRadius: borderRadius || size / 2,
|
|
17
|
+
},
|
|
18
|
+
], children: (0, jsx_runtime_1.jsx)(react_native_1.Image, { source: {
|
|
19
|
+
uri: userImg,
|
|
20
|
+
}, style: [
|
|
21
|
+
styles.image,
|
|
22
|
+
{
|
|
23
|
+
borderRadius: borderRadius || size / 2,
|
|
24
|
+
},
|
|
25
|
+
] }) }));
|
|
26
|
+
};
|
|
27
|
+
const styles = react_native_1.StyleSheet.create({
|
|
28
|
+
avatarContainer: {
|
|
29
|
+
overflow: "hidden",
|
|
30
|
+
borderWidth: 1,
|
|
31
|
+
borderColor: "#E6E6E6",
|
|
32
|
+
flexShrink: 0,
|
|
33
|
+
},
|
|
34
|
+
image: {
|
|
35
|
+
width: "100%",
|
|
36
|
+
height: "100%",
|
|
37
|
+
resizeMode: "cover",
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
exports.default = UserAvatar;
|
|
41
|
+
//# sourceMappingURL=UserAvatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserAvatar.js","sourceRoot":"","sources":["../../../src/components/UserAvatar.tsx"],"names":[],"mappings":";;;AAAA,+CAAuD;AAQvD,MAAM,UAAU,GAAG,CAAC,EAClB,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,YAAY,GAKb,EAAE,EAAE;IACH,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM;QACzB,CAAC,CAAC,IAAI,CAAC,MAAM;QACb,CAAC,CAAC,gDAAgD,IAAI,CAAC,EAAE,EAAE,CAAC;IAE9D,OAAO,CACL,uBAAC,mBAAI,IACH,KAAK,EAAE;YACL,MAAM,CAAC,eAAe;YACtB;gBACE,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE,IAAI;gBACZ,YAAY,EAAE,YAAY,IAAI,IAAI,GAAG,CAAC;aACvC;SACF,YAED,uBAAC,oBAAK,IACJ,MAAM,EAAE;gBACN,GAAG,EAAE,OAAO;aACb,EACD,KAAK,EAAE;gBACL,MAAM,CAAC,KAAK;gBACZ;oBACE,YAAY,EAAE,YAAY,IAAI,IAAI,GAAG,CAAC;iBACvC;aACF,GACD,GACG,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,eAAe,EAAE;QACf,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,SAAS;QACtB,UAAU,EAAE,CAAC;KACd;IACD,KAAK,EAAE;QACL,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,OAAO;KACpB;CACF,CAAC,CAAC;AAEH,kBAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as CustomButton } from "./CustomButton";
|
|
2
|
+
export { default as EmojiSuggestions } from "./EmojiSuggestions";
|
|
3
|
+
export { default as FromNow } from "./FromNow";
|
|
4
|
+
export { default as GiphyContainer } from "./GiphyContainer";
|
|
5
|
+
export { CommentSkeleton, UserMentionSkeleton, Skeleton } from "./Skeleton";
|
|
6
|
+
export { default as UserAvatar } from "./UserAvatar";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.UserAvatar = exports.Skeleton = exports.UserMentionSkeleton = exports.CommentSkeleton = exports.GiphyContainer = exports.FromNow = exports.EmojiSuggestions = exports.CustomButton = void 0;
|
|
7
|
+
var CustomButton_1 = require("./CustomButton");
|
|
8
|
+
Object.defineProperty(exports, "CustomButton", { enumerable: true, get: function () { return __importDefault(CustomButton_1).default; } });
|
|
9
|
+
var EmojiSuggestions_1 = require("./EmojiSuggestions");
|
|
10
|
+
Object.defineProperty(exports, "EmojiSuggestions", { enumerable: true, get: function () { return __importDefault(EmojiSuggestions_1).default; } });
|
|
11
|
+
var FromNow_1 = require("./FromNow");
|
|
12
|
+
Object.defineProperty(exports, "FromNow", { enumerable: true, get: function () { return __importDefault(FromNow_1).default; } });
|
|
13
|
+
var GiphyContainer_1 = require("./GiphyContainer");
|
|
14
|
+
Object.defineProperty(exports, "GiphyContainer", { enumerable: true, get: function () { return __importDefault(GiphyContainer_1).default; } });
|
|
15
|
+
var Skeleton_1 = require("./Skeleton");
|
|
16
|
+
Object.defineProperty(exports, "CommentSkeleton", { enumerable: true, get: function () { return Skeleton_1.CommentSkeleton; } });
|
|
17
|
+
Object.defineProperty(exports, "UserMentionSkeleton", { enumerable: true, get: function () { return Skeleton_1.UserMentionSkeleton; } });
|
|
18
|
+
Object.defineProperty(exports, "Skeleton", { enumerable: true, get: function () { return Skeleton_1.Skeleton; } });
|
|
19
|
+
var UserAvatar_1 = require("./UserAvatar");
|
|
20
|
+
Object.defineProperty(exports, "UserAvatar", { enumerable: true, get: function () { return __importDefault(UserAvatar_1).default; } });
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,uDAAiE;AAAxD,qIAAA,OAAO,OAAoB;AACpC,qCAA+C;AAAtC,mHAAA,OAAO,OAAW;AAC3B,mDAA6D;AAApD,iIAAA,OAAO,OAAkB;AAElC,uCAA4E;AAAnE,2GAAA,eAAe,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AAAE,oGAAA,QAAQ,OAAA;AACvD,2CAAqD;AAA5C,yHAAA,OAAO,OAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./reset-styles";
|