@renown/sdk 4.1.0-dev.75 → 4.1.0-dev.77
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/src/components/RenownLoginAvatar.d.ts +3 -3
- package/dist/src/components/RenownLoginAvatar.d.ts.map +1 -1
- package/dist/src/components/RenownLoginAvatar.js +29 -29
- package/dist/src/components/RenownLoginAvatar.js.map +1 -1
- package/dist/src/components/index.d.ts +3 -3
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +1 -1
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/components/types.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import type { LoginAvatarProps } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { LoginAvatarProps } from "./types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Headless Renown Login Avatar component
|
|
5
5
|
* Provides login button when not authenticated, and user avatar when authenticated
|
|
@@ -25,7 +25,7 @@ export interface RenownLoginAvatarProps extends LoginAvatarProps {
|
|
|
25
25
|
* Custom render function for the avatar when logged in
|
|
26
26
|
*/
|
|
27
27
|
renderAvatar?: (props: {
|
|
28
|
-
user: NonNullable<LoginAvatarProps[
|
|
28
|
+
user: NonNullable<LoginAvatarProps["user"]>;
|
|
29
29
|
onClick: () => void;
|
|
30
30
|
}) => React.ReactNode;
|
|
31
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenownLoginAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/RenownLoginAvatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"RenownLoginAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/RenownLoginAvatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE;QACrB,IAAI,EAAE,WAAW,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;QAC5C,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,KAAK,KAAK,CAAC,SAAS,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC;IAEnE;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,IAAI,EACJ,YAAY,EACZ,cAA4C,EAC5C,YAAY,EACZ,YAAY,GACb,EAAE,sBAAsB,2CA+ExB"}
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from
|
|
3
|
-
export function RenownLoginAvatar({ isLoggedIn, user, onLoginClick, profileBaseUrl =
|
|
2
|
+
import React from "react";
|
|
3
|
+
export function RenownLoginAvatar({ isLoggedIn, user, onLoginClick, profileBaseUrl = "https://renown.io/profile", renderAvatar, renderButton, }) {
|
|
4
4
|
if (isLoggedIn && user) {
|
|
5
5
|
const handleProfileClick = () => {
|
|
6
6
|
const identifier = user.ethAddress || user.username;
|
|
7
|
-
window.open(`${profileBaseUrl}/${identifier}`,
|
|
7
|
+
window.open(`${profileBaseUrl}/${identifier}`, "_blank");
|
|
8
8
|
};
|
|
9
9
|
if (renderAvatar) {
|
|
10
10
|
return _jsx(_Fragment, { children: renderAvatar({ user, onClick: handleProfileClick }) });
|
|
11
11
|
}
|
|
12
12
|
// Default avatar rendering
|
|
13
13
|
return (_jsxs("div", { onClick: handleProfileClick, style: {
|
|
14
|
-
display:
|
|
15
|
-
alignItems:
|
|
16
|
-
gap:
|
|
17
|
-
cursor:
|
|
14
|
+
display: "inline-flex",
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
gap: "0.5rem",
|
|
17
|
+
cursor: "pointer",
|
|
18
18
|
}, children: [user.avatar ? (_jsx("img", { src: user.avatar, alt: user.username, style: {
|
|
19
|
-
width:
|
|
20
|
-
height:
|
|
21
|
-
borderRadius:
|
|
22
|
-
objectFit:
|
|
19
|
+
width: "2.5rem",
|
|
20
|
+
height: "2.5rem",
|
|
21
|
+
borderRadius: "50%",
|
|
22
|
+
objectFit: "cover",
|
|
23
23
|
} })) : (_jsx("div", { style: {
|
|
24
|
-
width:
|
|
25
|
-
height:
|
|
26
|
-
borderRadius:
|
|
27
|
-
backgroundColor:
|
|
28
|
-
color:
|
|
29
|
-
display:
|
|
30
|
-
alignItems:
|
|
31
|
-
justifyContent:
|
|
32
|
-
fontWeight:
|
|
33
|
-
fontSize:
|
|
34
|
-
}, children: user.username.substring(0, 2).toUpperCase() })), _jsx("span", { style: { fontSize:
|
|
24
|
+
width: "2.5rem",
|
|
25
|
+
height: "2.5rem",
|
|
26
|
+
borderRadius: "50%",
|
|
27
|
+
backgroundColor: "#9333ea",
|
|
28
|
+
color: "white",
|
|
29
|
+
display: "flex",
|
|
30
|
+
alignItems: "center",
|
|
31
|
+
justifyContent: "center",
|
|
32
|
+
fontWeight: "bold",
|
|
33
|
+
fontSize: "0.875rem",
|
|
34
|
+
}, children: user.username.substring(0, 2).toUpperCase() })), _jsx("span", { style: { fontSize: "0.875rem", fontWeight: "500" }, children: user.username })] }));
|
|
35
35
|
}
|
|
36
36
|
if (renderButton) {
|
|
37
37
|
return _jsx(_Fragment, { children: renderButton({ onClick: onLoginClick || (() => { }) }) });
|
|
38
38
|
}
|
|
39
39
|
// Default button rendering
|
|
40
40
|
return (_jsx("button", { onClick: onLoginClick, style: {
|
|
41
|
-
padding:
|
|
42
|
-
border:
|
|
43
|
-
borderRadius:
|
|
44
|
-
backgroundColor:
|
|
45
|
-
cursor:
|
|
46
|
-
fontSize:
|
|
47
|
-
fontWeight:
|
|
41
|
+
padding: "0.5rem 1rem",
|
|
42
|
+
border: "1px solid #d1d5db",
|
|
43
|
+
borderRadius: "0.375rem",
|
|
44
|
+
backgroundColor: "white",
|
|
45
|
+
cursor: "pointer",
|
|
46
|
+
fontSize: "0.875rem",
|
|
47
|
+
fontWeight: "500",
|
|
48
48
|
}, children: "Log in" }));
|
|
49
49
|
}
|
|
50
50
|
//# sourceMappingURL=RenownLoginAvatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenownLoginAvatar.js","sourceRoot":"","sources":["../../../src/components/RenownLoginAvatar.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"RenownLoginAvatar.js","sourceRoot":"","sources":["../../../src/components/RenownLoginAvatar.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA4C1B,MAAM,UAAU,iBAAiB,CAAC,EAChC,UAAU,EACV,IAAI,EACJ,YAAY,EACZ,cAAc,GAAG,2BAA2B,EAC5C,YAAY,EACZ,YAAY,GACW;IACvB,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,kBAAkB,GAAG,GAAG,EAAE;YAC9B,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,CAAC;YACpD,MAAM,CAAC,IAAI,CAAC,GAAG,cAAc,IAAI,UAAU,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC3D,CAAC,CAAC;QAEF,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,4BAAG,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC,GAAI,CAAC;QACpE,CAAC;QAED,2B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AM,EAAE,mBAAmB;YAC3B,YAAY,EAAE,UAAU;YACxB,eAAe,EAAE,OAAO;YACxB,MAAM,EAAE,SAAS;YACjB,QAAQ,EAAE,UAAU;YACpB,UAAU,EAAE,KAAK;SAClB,uBAGM,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { RenownLoginAvatar } from
|
|
2
|
-
export type { RenownLoginAvatarProps } from
|
|
3
|
-
export type { RenownUser, LoginAvatarProps } from
|
|
1
|
+
export { RenownLoginAvatar } from "./RenownLoginAvatar.js";
|
|
2
|
+
export type { RenownLoginAvatarProps } from "./RenownLoginAvatar.js";
|
|
3
|
+
export type { RenownUser, LoginAvatarProps } from "./types.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { RenownLoginAvatar } from
|
|
1
|
+
export { RenownLoginAvatar } from "./RenownLoginAvatar.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
|