@oxyhq/services 0.0.77 → 0.0.79
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/components/auth/AccountSwitcherModal.d.ts.map +1 -1
- package/dist/components/auth/AccountSwitcherModal.js +13 -4
- package/dist/components/auth/SessionOwnerButton.d.ts.map +1 -1
- package/dist/components/auth/SignInButton.d.ts.map +1 -1
- package/dist/components/auth/SignInButton.js +4 -1
- package/dist/components/auth/styles/account-switcher-modal.module.css +35 -0
- package/dist/components/auth/styles/account-switcher-modal.module.css.map +1 -0
- package/dist/components/auth/styles/oavatar.module.css +34 -0
- package/dist/components/auth/styles/oavatar.module.css.map +1 -0
- package/dist/components/auth/styles/session-owner-modal.module.css +35 -0
- package/dist/components/auth/styles/session-owner-modal.module.css.map +1 -0
- package/dist/components/auth/styles/sign-in-button.module.css +30 -0
- package/dist/components/auth/styles/sign-in-button.module.css.map +1 -0
- package/dist/components/elements/button/components/styles/button.module.css +25 -0
- package/dist/components/elements/button/components/styles/button.module.css.map +1 -0
- package/dist/components/elements/ellipsis-wrapper/components/ellipsis-wrapper.d.ts +5 -0
- package/dist/components/elements/ellipsis-wrapper/components/ellipsis-wrapper.d.ts.map +1 -0
- package/dist/components/elements/ellipsis-wrapper/components/ellipsis-wrapper.js +4 -0
- package/dist/components/elements/ellipsis-wrapper/components/styles/ellipses-wrapper.module.css +11 -0
- package/dist/components/elements/ellipsis-wrapper/components/styles/ellipses-wrapper.module.css.map +1 -0
- package/dist/components/elements/ellipsis-wrapper/index.d.ts +1 -1
- package/dist/components/elements/ellipsis-wrapper/index.d.ts.map +1 -1
- package/dist/components/elements/ellipsis-wrapper/index.js +1 -1
- package/dist/components/elements/modal/components/confirmation-modal.js +1 -1
- package/dist/components/elements/modal/components/modal.js +1 -1
- package/dist/components/elements/modal/components/styles/confirmation-modal.module.css +105 -0
- package/dist/components/elements/modal/components/styles/confirmation-modal.module.css.map +1 -0
- package/dist/components/elements/modal/components/styles/modal.module.css +10 -0
- package/dist/components/elements/modal/components/styles/modal.module.css.map +1 -0
- package/dist/features/profile/components/styles/avatar.module.css +15 -0
- package/dist/features/profile/components/styles/avatar.module.css.map +1 -0
- package/dist/features/profile/components/styles/user-name.module.css +18 -0
- package/dist/features/profile/components/styles/user-name.module.css.map +1 -0
- package/dist/features/profile/components/styles/user-username.module.css +6 -0
- package/dist/features/profile/components/styles/user-username.module.css.map +1 -0
- package/dist/features/profile/components/user-name.js +1 -1
- package/dist/features/profile/components/user-username.js +1 -1
- package/dist/hooks/useCrossDomainStorage.d.ts +6 -0
- package/dist/hooks/useCrossDomainStorage.d.ts.map +1 -0
- package/dist/hooks/useCrossDomainStorage.js +24 -0
- package/dist/hooks/useOxySession.d.ts.map +1 -1
- package/dist/hooks/useOxySession.js +5 -3
- package/dist/index.css +5 -0
- package/dist/index.css.map +1 -0
- package/package.json +5 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountSwitcherModal.d.ts","sourceRoot":"","sources":["../../../src/components/auth/AccountSwitcherModal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AccountSwitcherModal.d.ts","sourceRoot":"","sources":["../../../src/components/auth/AccountSwitcherModal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA0B/B,UAAU,yBAAyB;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,oBAAoB,kGAiH/B,CAAC"}
|
|
@@ -9,17 +9,25 @@ import { PiSignOutBold } from "react-icons/pi";
|
|
|
9
9
|
import { AiOutlineClose } from "react-icons/ai";
|
|
10
10
|
import { Avatar } from "../../features/profile";
|
|
11
11
|
import getUserById from "../../hooks/getUserById";
|
|
12
|
-
import
|
|
12
|
+
import useCrossDomainStorage from "../../hooks/useCrossDomainStorage";
|
|
13
|
+
import styles from "./styles/account-switcher-modal.module.css";
|
|
13
14
|
export const AccountSwitcherModal = forwardRef((props, ref) => {
|
|
14
15
|
const { onClose } = props;
|
|
15
16
|
const { session } = useOxySession();
|
|
17
|
+
const { get, set } = useCrossDomainStorage();
|
|
16
18
|
const [user, setUser] = useState(null);
|
|
17
19
|
const [error, setError] = useState(null);
|
|
18
20
|
useEffect(() => {
|
|
19
21
|
const fetchUser = async () => {
|
|
20
22
|
try {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
+
const clientKey = get("clientKey");
|
|
24
|
+
if (clientKey) {
|
|
25
|
+
const fetchedUser = await getUserById(clientKey);
|
|
26
|
+
setUser(fetchedUser);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
setError("Client key is missing");
|
|
30
|
+
}
|
|
23
31
|
}
|
|
24
32
|
catch (error) {
|
|
25
33
|
if (error instanceof Error) {
|
|
@@ -33,12 +41,13 @@ export const AccountSwitcherModal = forwardRef((props, ref) => {
|
|
|
33
41
|
if (session) {
|
|
34
42
|
fetchUser();
|
|
35
43
|
}
|
|
36
|
-
}, [session]);
|
|
44
|
+
}, [session, get]);
|
|
37
45
|
if (!session)
|
|
38
46
|
return null;
|
|
39
47
|
const handleBackdropClick = (e) => {
|
|
40
48
|
e.stopPropagation();
|
|
41
49
|
if (e.currentTarget === e.target) {
|
|
50
|
+
set("clientKey", "");
|
|
42
51
|
onClose();
|
|
43
52
|
}
|
|
44
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionOwnerButton.d.ts","sourceRoot":"","sources":["../../../src/components/auth/SessionOwnerButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SessionOwnerButton.d.ts","sourceRoot":"","sources":["../../../src/components/auth/SessionOwnerButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,eAAO,MAAM,kBAAkB,yBAoD9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignInButton.d.ts","sourceRoot":"","sources":["../../../src/components/auth/SignInButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SignInButton.d.ts","sourceRoot":"","sources":["../../../src/components/auth/SignInButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,YAAY,8BAItB;IACD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,sBAmBA,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import styles from "./styles/sign-in-button.module.
|
|
2
|
+
import styles from "./styles/sign-in-button.module.css";
|
|
3
3
|
import { OxyLogo } from "../assets/oxy-logo";
|
|
4
|
+
import useCrossDomainStorage from "../../hooks/useCrossDomainStorage";
|
|
4
5
|
export const SignInButton = ({ icon = React.createElement(OxyLogo, null), text = "Sign in with Oxy", callback = typeof window !== "undefined" ? window.location.href : "", }) => {
|
|
6
|
+
const { set } = useCrossDomainStorage();
|
|
5
7
|
const onClick = () => {
|
|
6
8
|
if (typeof window !== "undefined") {
|
|
7
9
|
const redirectUrl = `https://auth.oxy.so/?callback=${encodeURIComponent(callback)}`;
|
|
10
|
+
set("clientKey", ""); // Clear the clientKey before redirecting
|
|
8
11
|
window.location.href = redirectUrl;
|
|
9
12
|
}
|
|
10
13
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
width: 300px;
|
|
3
|
+
background-color: var(--clr-background);
|
|
4
|
+
box-shadow: 0 0rem 10px -2px var(--clr-tertiary);
|
|
5
|
+
border-radius: 1rem;
|
|
6
|
+
padding: 0.8em 0;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
position: fixed;
|
|
9
|
+
top: 0;
|
|
10
|
+
bottom: 0;
|
|
11
|
+
left: 0;
|
|
12
|
+
right: 0;
|
|
13
|
+
margin: auto;
|
|
14
|
+
a {
|
|
15
|
+
font-size: var(--fs-milli);
|
|
16
|
+
font-weight: var(--fw-700);
|
|
17
|
+
display: block;
|
|
18
|
+
padding: 0.8em 1em;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
transition: background-color 0.1s ease-in-out;
|
|
21
|
+
&:hover {
|
|
22
|
+
background-color: var(--clr-trends-hover);
|
|
23
|
+
}
|
|
24
|
+
&:active {
|
|
25
|
+
background-color: var(--clr-trends-active);
|
|
26
|
+
}
|
|
27
|
+
&:focus-visible {
|
|
28
|
+
background-color: var(--clr-trends-hover);
|
|
29
|
+
outline: 2px solid var(--clr-primary-disabled);
|
|
30
|
+
outline-offset: -2px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/*# sourceMappingURL=account-switcher-modal.module.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../src/components/auth/styles/account-switcher-modal.module.css"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;IACE;IACA;IACA;IACA;IACA;IACA;IAEA;MACE;;IAGF;MACE;;IAGF;MACE;MACA;MACA","file":"account-switcher-modal.module.css"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.oavatar {
|
|
2
|
+
width: 2rem;
|
|
3
|
+
height: 2rem;
|
|
4
|
+
padding: 0.7em;
|
|
5
|
+
border-radius: 100vmax;
|
|
6
|
+
font-size: var(--fs-milli);
|
|
7
|
+
font-weight: var(--fw-700);
|
|
8
|
+
color: var(--clr-dark);
|
|
9
|
+
background-color: var(--clr-light);
|
|
10
|
+
border: 1px solid var(--clr-auth-border);
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
align-items: center;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
transition: background 0.2s ease-in-out;
|
|
16
|
+
}
|
|
17
|
+
.oavatar:hover {
|
|
18
|
+
background-color: var(--clr-auth-button-hover);
|
|
19
|
+
}
|
|
20
|
+
.oavatar:active {
|
|
21
|
+
background-color: var(--clr-auth-button-active);
|
|
22
|
+
}
|
|
23
|
+
.oavatar:focus-visible {
|
|
24
|
+
outline: 2px solid var(--clr-light);
|
|
25
|
+
background-color: var(--clr-auth-button-hover);
|
|
26
|
+
}
|
|
27
|
+
.oavatar svg {
|
|
28
|
+
width: var(--fs-h2);
|
|
29
|
+
height: var(--fs-h2);
|
|
30
|
+
fill: var(--clr-dark);
|
|
31
|
+
margin-right: 0.5em;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/*# sourceMappingURL=oavatar.module.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../src/components/auth/styles/oavatar.module.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA","file":"oavatar.module.css"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
width: 300px;
|
|
3
|
+
background-color: var(--clr-background);
|
|
4
|
+
box-shadow: 0 0rem 10px -2px var(--clr-tertiary);
|
|
5
|
+
border-radius: 1rem;
|
|
6
|
+
padding: 0.8em 0;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
position: fixed;
|
|
9
|
+
top: 0;
|
|
10
|
+
bottom: 0;
|
|
11
|
+
left: 0;
|
|
12
|
+
right: 0;
|
|
13
|
+
margin: auto;
|
|
14
|
+
}
|
|
15
|
+
.container a {
|
|
16
|
+
font-size: var(--fs-milli);
|
|
17
|
+
font-weight: var(--fw-700);
|
|
18
|
+
display: block;
|
|
19
|
+
padding: 0.8em 1em;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
transition: background-color 0.1s ease-in-out;
|
|
22
|
+
}
|
|
23
|
+
.container a:hover {
|
|
24
|
+
background-color: var(--clr-trends-hover);
|
|
25
|
+
}
|
|
26
|
+
.container a:active {
|
|
27
|
+
background-color: var(--clr-trends-active);
|
|
28
|
+
}
|
|
29
|
+
.container a:focus-visible {
|
|
30
|
+
background-color: var(--clr-trends-hover);
|
|
31
|
+
outline: 2px solid var(--clr-primary-disabled);
|
|
32
|
+
outline-offset: -2px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/*# sourceMappingURL=session-owner-modal.module.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../src/components/auth/styles/session-owner-modal.module.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA","file":"session-owner-modal.module.css"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
padding: 0.7em;
|
|
4
|
+
border-radius: 100vmax;
|
|
5
|
+
background-color: var(--clr-light);
|
|
6
|
+
border: 1px solid var(--clr-auth-border);
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
align-items: center;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
transition: background 0.2s ease-in-out;
|
|
12
|
+
}
|
|
13
|
+
.container:hover {
|
|
14
|
+
background-color: var(--clr-auth-button-hover);
|
|
15
|
+
}
|
|
16
|
+
.container:active {
|
|
17
|
+
background-color: var(--clr-auth-button-active);
|
|
18
|
+
}
|
|
19
|
+
.container:focus-visible {
|
|
20
|
+
outline: 2px solid var(--clr-light);
|
|
21
|
+
background-color: var(--clr-auth-button-hover);
|
|
22
|
+
}
|
|
23
|
+
.container svg {
|
|
24
|
+
width: var(--fs-h2);
|
|
25
|
+
height: var(--fs-h2);
|
|
26
|
+
fill: var(--clr-dark);
|
|
27
|
+
margin-right: 0.5em;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/*# sourceMappingURL=sign-in-button.module.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../src/components/auth/styles/sign-in-button.module.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA","file":"sign-in-button.module.css"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
cursor: pointer;
|
|
3
|
+
display: grid;
|
|
4
|
+
place-items: center;
|
|
5
|
+
padding: 0.5em;
|
|
6
|
+
border-radius: 100vmax;
|
|
7
|
+
transition: background-color 0.15s ease-in-out;
|
|
8
|
+
}
|
|
9
|
+
.container svg {
|
|
10
|
+
width: var(--fs-h2);
|
|
11
|
+
height: var(--fs-h2);
|
|
12
|
+
fill: var(--clr-secondary);
|
|
13
|
+
}
|
|
14
|
+
.container:hover {
|
|
15
|
+
background-color: var(--clr-nav-hover);
|
|
16
|
+
}
|
|
17
|
+
.container:active {
|
|
18
|
+
background-color: var(--clr-nav-active);
|
|
19
|
+
}
|
|
20
|
+
.container:focus-visible {
|
|
21
|
+
outline: 2px solid var(--clr-secondary);
|
|
22
|
+
background-color: var(--clr-nav-hover);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/*# sourceMappingURL=button.module.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../../../src/components/elements/button/components/styles/button.module.scss"],"names":[],"mappings":"AAAA;EACI;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;;AAGJ;EACI;;AAGJ;EACI;;AAGJ;EACI;EACA","file":"button.module.css"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ellipsis-wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/components/elements/ellipsis-wrapper/components/ellipsis-wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,eAAe,kBAEzB;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,sBAUA,CAAC"}
|
package/dist/components/elements/ellipsis-wrapper/components/styles/ellipses-wrapper.module.css.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../../../src/components/elements/ellipsis-wrapper/components/styles/ellipses-wrapper.module.scss"],"names":[],"mappings":"AAAA;EACE;EACA;;AAEA;EACE;EACA;EACA","file":"ellipses-wrapper.module.css"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./components/
|
|
1
|
+
export * from "./components/ellipsis-wrapper";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/elements/ellipsis-wrapper/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/elements/ellipsis-wrapper/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./components/
|
|
1
|
+
export * from "./components/ellipsis-wrapper";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect } from "react";
|
|
2
2
|
import { motion } from "framer-motion";
|
|
3
|
-
import styles from "./styles/confirmation-modal.module.
|
|
3
|
+
import styles from "./styles/confirmation-modal.module.css";
|
|
4
4
|
export const ConfirmationModal = ({ heading, paragraph, confirmButtonText, confirmButtonClick, confirmButtonStyle = "delete", cancelButtonText, cancelButtonClick, logo, }) => {
|
|
5
5
|
useEffect(() => {
|
|
6
6
|
document.body.style.overflow = "hidden";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { motion } from "framer-motion";
|
|
6
6
|
import React, { useCallback, useLayoutEffect, useRef } from "react";
|
|
7
7
|
import { createPortal } from "react-dom";
|
|
8
|
-
import styles from "./styles/modal.module.
|
|
8
|
+
import styles from "./styles/modal.module.css";
|
|
9
9
|
export const Modal = ({ children, onClose, closeOnBackdropClick = true, background, minViewportWidth = null, maxViewportWidth = null, disableScroll = false, focusOnElement = null, focusAfterClose = null, }) => {
|
|
10
10
|
const modalRef = useRef(null);
|
|
11
11
|
const previouslyFocusedElementRef = useRef(null);
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
right: 0;
|
|
7
|
+
width: fit-content;
|
|
8
|
+
max-width: 320px;
|
|
9
|
+
height: fit-content;
|
|
10
|
+
margin: auto;
|
|
11
|
+
background-color: var(--clr-background);
|
|
12
|
+
padding: 2em;
|
|
13
|
+
border-radius: 1rem;
|
|
14
|
+
}
|
|
15
|
+
.container .logo {
|
|
16
|
+
display: grid;
|
|
17
|
+
place-items: center;
|
|
18
|
+
margin-bottom: 1em;
|
|
19
|
+
}
|
|
20
|
+
.container .logo svg {
|
|
21
|
+
width: var(--fs-kilo);
|
|
22
|
+
height: var(--fs-kilo);
|
|
23
|
+
fill: var(--clr-primary);
|
|
24
|
+
}
|
|
25
|
+
.container h1 {
|
|
26
|
+
font-size: var(--fs-h2);
|
|
27
|
+
font-weight: var(--fw-700);
|
|
28
|
+
margin-bottom: 0.5em;
|
|
29
|
+
}
|
|
30
|
+
.container p {
|
|
31
|
+
font-size: var(--fs-milli);
|
|
32
|
+
color: var(--clr-tertiary);
|
|
33
|
+
margin-bottom: 2rem;
|
|
34
|
+
line-height: 1.4;
|
|
35
|
+
}
|
|
36
|
+
.container .buttons {
|
|
37
|
+
display: grid;
|
|
38
|
+
gap: 0.8rem;
|
|
39
|
+
}
|
|
40
|
+
.container .buttons button {
|
|
41
|
+
display: grid;
|
|
42
|
+
place-items: center;
|
|
43
|
+
padding: 0.9em;
|
|
44
|
+
border-radius: 100vmax;
|
|
45
|
+
font-size: var(--fs-milli);
|
|
46
|
+
font-weight: var(--fw-700);
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
transition: background-color 0.2s ease;
|
|
49
|
+
}
|
|
50
|
+
.container .buttons .delete {
|
|
51
|
+
background-color: var(--clr-red);
|
|
52
|
+
}
|
|
53
|
+
.container .buttons .delete:hover {
|
|
54
|
+
background-color: var(--clr-red-hover);
|
|
55
|
+
}
|
|
56
|
+
.container .buttons .delete:active {
|
|
57
|
+
background-color: var(--clr-red-active);
|
|
58
|
+
}
|
|
59
|
+
.container .buttons .delete:focus-visible {
|
|
60
|
+
outline: 2px solid var(--clr-secondary);
|
|
61
|
+
background-color: var(--clr-red-hover);
|
|
62
|
+
}
|
|
63
|
+
.container .buttons .unfollow {
|
|
64
|
+
background-color: var(--clr-secondary);
|
|
65
|
+
color: var(--clr-background);
|
|
66
|
+
}
|
|
67
|
+
.container .buttons .unfollow:hover {
|
|
68
|
+
background-color: var(--clr-secondary-hover);
|
|
69
|
+
}
|
|
70
|
+
.container .buttons .unfollow:active {
|
|
71
|
+
background-color: var(--clr-secondary-active);
|
|
72
|
+
}
|
|
73
|
+
.container .buttons .unfollow:focus-visible {
|
|
74
|
+
outline: 2px solid var(--clr-secondary);
|
|
75
|
+
}
|
|
76
|
+
.container .buttons .signout {
|
|
77
|
+
background-color: var(--clr-secondary);
|
|
78
|
+
color: var(--clr-background);
|
|
79
|
+
}
|
|
80
|
+
.container .buttons .signout:hover {
|
|
81
|
+
background-color: var(--clr-signout-logout-hover);
|
|
82
|
+
}
|
|
83
|
+
.container .buttons .signout:active {
|
|
84
|
+
background-color: var(--clr-signout-logout-active);
|
|
85
|
+
}
|
|
86
|
+
.container .buttons .signout:focus-visible {
|
|
87
|
+
outline: 2px solid var(--clr-secondary);
|
|
88
|
+
background-color: var(--clr-signout-logout-hover);
|
|
89
|
+
}
|
|
90
|
+
.container .buttons .cancel {
|
|
91
|
+
color: var(--clr-secondary);
|
|
92
|
+
border: 1px solid var(--clr-tertiary);
|
|
93
|
+
}
|
|
94
|
+
.container .buttons .cancel:hover {
|
|
95
|
+
background-color: var(--clr-trends-hover);
|
|
96
|
+
}
|
|
97
|
+
.container .buttons .cancel:active {
|
|
98
|
+
background-color: var(--clr-trends-active);
|
|
99
|
+
}
|
|
100
|
+
.container .buttons .cancel:focus-visible {
|
|
101
|
+
outline: 2px solid var(--clr-secondary);
|
|
102
|
+
background-color: var(--clr-trends-hover);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/*# sourceMappingURL=confirmation-modal.module.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../../../src/components/elements/modal/components/styles/confirmation-modal.module.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAIJ;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA;;AAIJ;EACE;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;;AAIJ;EACE;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA;;AAIJ;EACE;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA","file":"confirmation-modal.module.css"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../../../src/components/elements/modal/components/styles/modal.module.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA","file":"modal.module.css"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: var(--avatar-width);
|
|
4
|
+
border-radius: 50%;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
aspect-ratio: 1/1;
|
|
7
|
+
}
|
|
8
|
+
.container img {
|
|
9
|
+
display: block;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
object-fit: cover;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/*# sourceMappingURL=avatar.module.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../../src/features/profile/components/styles/avatar.module.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA","file":"avatar.module.css"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
font-size: var(--fs-milli);
|
|
3
|
+
font-weight: var(--fw-500);
|
|
4
|
+
color: var(--clr-secondary);
|
|
5
|
+
display: grid;
|
|
6
|
+
grid-auto-flow: column;
|
|
7
|
+
}
|
|
8
|
+
.container span {
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
text-overflow: ellipsis;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.hover:hover {
|
|
15
|
+
text-decoration: underline;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/*# sourceMappingURL=user-name.module.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../../src/features/profile/components/styles/user-name.module.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;;AAKF;EACE","file":"user-name.module.css"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../../src/features/profile/components/styles/user-username.module.scss"],"names":[],"mappings":"AAAA;EACE;EACA","file":"user-username.module.css"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { VerifiedIcon } from "../../../assets/verified-icon";
|
|
3
|
-
import styles from "./styles/user-name.module.
|
|
3
|
+
import styles from "./styles/user-name.module.css";
|
|
4
4
|
export const UserName = ({ name, isVerified = false, hover = false, }) => {
|
|
5
5
|
return (React.createElement("div", { className: `${styles.container} ${hover ? styles.hover : ""}` },
|
|
6
6
|
name && React.createElement("span", null, name),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import styles from "./styles/user-username.module.
|
|
2
|
+
import styles from "./styles/user-username.module.css";
|
|
3
3
|
export const UserUsername = ({ username, }) => {
|
|
4
4
|
return React.createElement("span", { className: styles.container },
|
|
5
5
|
"@",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCrossDomainStorage.d.ts","sourceRoot":"","sources":["../../src/hooks/useCrossDomainStorage.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,qBAAqB;eACP,MAAM,SAAS,MAAM;eAKrB,MAAM;CAmBzB,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
const useCrossDomainStorage = () => {
|
|
3
|
+
const set = (key, value) => {
|
|
4
|
+
localStorage.setItem(key, value);
|
|
5
|
+
window.postMessage({ key, value }, "*");
|
|
6
|
+
};
|
|
7
|
+
const get = (key) => {
|
|
8
|
+
return localStorage.getItem(key);
|
|
9
|
+
};
|
|
10
|
+
const handlePostMessage = (event) => {
|
|
11
|
+
if (event.origin !== window.location.origin) {
|
|
12
|
+
const { key, value } = event.data;
|
|
13
|
+
localStorage.setItem(key, value);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
window.addEventListener("message", handlePostMessage);
|
|
18
|
+
return () => {
|
|
19
|
+
window.removeEventListener("message", handlePostMessage);
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
22
|
+
return { set, get };
|
|
23
|
+
};
|
|
24
|
+
export default useCrossDomainStorage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOxySession.d.ts","sourceRoot":"","sources":["../../src/hooks/useOxySession.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useOxySession.d.ts","sourceRoot":"","sources":["../../src/hooks/useOxySession.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGpC,UAAU,YAAY;IACpB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,OAAO,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,QAAQ,CAAC;QACf,OAAO,EAAE,OAAO,CAAC;QACjB,kBAAkB,EAAE,OAAO,CAAC;KAC7B,CAAC;CACH;AAED,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;IACX,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,eAAe,2EA8D1B,CAAC;AAEH,iBAAS,aAAa;;;;EAQrB;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
2
|
import axios from "axios";
|
|
3
3
|
import { create } from "zustand";
|
|
4
|
-
import localforage from "localforage";
|
|
5
4
|
import { OXY_AUTH_URL } from "../config";
|
|
5
|
+
import useCrossDomainStorage from "./useCrossDomainStorage";
|
|
6
6
|
export const useSessionStore = create((set) => {
|
|
7
7
|
let isFirstFetch = true;
|
|
8
8
|
return {
|
|
@@ -20,11 +20,13 @@ export const useSessionStore = create((set) => {
|
|
|
20
20
|
let clientKey = urlParams.get("clientKey");
|
|
21
21
|
// If the session ID was not found in the URL parameters, get it from local storage
|
|
22
22
|
if (!clientKey) {
|
|
23
|
-
|
|
23
|
+
const { get } = useCrossDomainStorage();
|
|
24
|
+
clientKey = get("clientKey");
|
|
24
25
|
}
|
|
25
26
|
else {
|
|
26
27
|
// If the session ID was found in the URL parameters, set it in local storage
|
|
27
|
-
|
|
28
|
+
const { set } = useCrossDomainStorage();
|
|
29
|
+
set("clientKey", clientKey);
|
|
28
30
|
}
|
|
29
31
|
const response = await axios.get(OXY_AUTH_URL + "/api/session/" + clientKey);
|
|
30
32
|
if (response.status !== 200) {
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../src/index.css"],"names":[],"mappings":"AAAA;AACA;AACA","file":"index.css"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/services",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.79",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://oxy.so/",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,11 +9,10 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build:scss": "sass src:
|
|
12
|
+
"build:scss": "sass src:temp",
|
|
13
|
+
"copy:css": "ncp temp dist",
|
|
13
14
|
"build:ts": "tsc",
|
|
14
|
-
"
|
|
15
|
-
"copy:scss": "cpx 'src/**/*.scss' dist",
|
|
16
|
-
"build": "npm run clean && npm run build:ts && npm run copy:scss",
|
|
15
|
+
"build": "npm run build:scss && npm run build:ts && npm run copy:css",
|
|
17
16
|
"test": "jest",
|
|
18
17
|
"lint": "eslint src/**/*.{ts,tsx}"
|
|
19
18
|
},
|
|
@@ -39,8 +38,7 @@
|
|
|
39
38
|
"ncp": "^2.0.0",
|
|
40
39
|
"sass": "^1.77.2",
|
|
41
40
|
"tailwindcss": "^3.4.3",
|
|
42
|
-
"typescript": "^5.4.5"
|
|
43
|
-
"cpx": "^1.5.0"
|
|
41
|
+
"typescript": "^5.4.5"
|
|
44
42
|
},
|
|
45
43
|
"dependencies": {
|
|
46
44
|
"@tanstack/react-query": "^5.40.0",
|