@oxyhq/services 0.0.17 → 0.0.20

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.
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface UserInfoProps {
3
+ setDisplayUserInfo: React.Dispatch<React.SetStateAction<boolean>>;
4
+ }
5
+ declare function UserInfo({ setDisplayUserInfo }: UserInfoProps): React.JSX.Element;
6
+ export default UserInfo;
7
+ //# sourceMappingURL=AccountSwitcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountSwitcher.d.ts","sourceRoot":"","sources":["../../../src/components/auth/AccountSwitcher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,aAAa;IACrB,kBAAkB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CACnE;AAED,iBAAS,QAAQ,CAAC,EAAE,kBAAkB,EAAE,EAAE,aAAa,qBA8CtD;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import Image from "next/image";
3
+ import { signOut, useSession } from "next-auth/react";
4
+ function UserInfo({ setDisplayUserInfo }) {
5
+ const { data: session } = useSession();
6
+ return (React.createElement("div", { className: "relative z-10 flex flex-col items-center justify-center\n space-y-3 rounded-2xl bg-darkC2 px-5 py-3 text-sm font-medium text-textC\n shadow-md shadow-[#b4bebb]" },
7
+ React.createElement("button", { onClick: () => setDisplayUserInfo((prev) => false), className: "absolute right-3 top-3 rounded-full bg-darkC2 p-1 hover:bg-darkC" }),
8
+ React.createElement("p", null, session?.user?.email),
9
+ React.createElement("div", { className: "h-20 w-20 rounded-full border" },
10
+ React.createElement(Image, { src: session?.user?.image, className: "h-full w-full rounded-full object-center", height: 500, width: 500, draggable: false, alt: "avatar" })),
11
+ React.createElement("h2", { className: "tablet:text-2xl text-xl font-normal" },
12
+ "Hi, ",
13
+ session?.user?.name,
14
+ "!"),
15
+ React.createElement("button", { className: "rounded-full border border-black px-7 py-2 text-textC2 hover:bg-[#d3dfee]" }, "Manage your Google Account"),
16
+ React.createElement("div", { className: "flex space-x-1" },
17
+ React.createElement("button", { className: "tablet:w-44 flex w-36 items-center space-x-2 rounded-l-full bg-white py-3 pl-3 hover:bg-darkC" },
18
+ React.createElement("span", null, "Add account")),
19
+ React.createElement("button", { onClick: () => signOut(), className: "tablet:w-44 flex w-36 items-center space-x-2 rounded-r-full bg-white py-3 pl-3 hover:bg-darkC" },
20
+ React.createElement("span", null, "Sign out"))),
21
+ React.createElement("div", { className: "flex h-10 items-center space-x-2 text-xs" },
22
+ React.createElement("span", null, "Privacy policy"),
23
+ React.createElement("span", { className: "-mt-[3px]" }, " . "),
24
+ " ",
25
+ React.createElement("span", null, "Terms of service"))));
26
+ }
27
+ export default UserInfo;
@@ -1,7 +1,8 @@
1
1
  import React from "react";
2
- export declare const SignInButton: ({ icon, text, }: {
2
+ export declare const SignInButton: ({ icon, text, callback, }: {
3
3
  icon?: React.ReactNode;
4
4
  text?: string;
5
+ callback?: string;
5
6
  }) => React.JSX.Element;
6
7
  export default SignInButton;
7
8
  //# sourceMappingURL=SignInButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignInButton.d.ts","sourceRoot":"","sources":["../../../src/components/auth/SignInButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,YAAY,oBAGtB;IACD,IAAI,CAAC,EAAE,MAAM,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,sBAeA,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"SignInButton.d.ts","sourceRoot":"","sources":["../../../src/components/auth/SignInButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,YAAY,8BAItB;IACD,IAAI,CAAC,EAAE,MAAM,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,sBAcA,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,10 +1,9 @@
1
1
  import React from "react";
2
- import styles from "./sign-in-button.module.scss";
2
+ import styles from "./sign-in-button.module.css";
3
3
  import { OxyLogo } from "../assets/oxy-logo";
4
- export const SignInButton = ({ icon = React.createElement(OxyLogo, null), text = "Sign in with Oxy", }) => {
4
+ export const SignInButton = ({ icon = React.createElement(OxyLogo, null), text = "Sign in with Oxy", callback = window.location.href, }) => {
5
5
  const onClick = () => {
6
- const currentUrl = window.location.href;
7
- const redirectUrl = `https://auth.oxy.so/?callback=${encodeURIComponent(currentUrl)}`;
6
+ const redirectUrl = `https://auth.oxy.so/?callback=${encodeURIComponent(callback)}`;
8
7
  window.location.href = redirectUrl;
9
8
  };
10
9
  return (React.createElement("button", { onClick: onClick, className: styles.container },
@@ -15,7 +15,7 @@ declare global {
15
15
  }
16
16
  }
17
17
  }
18
- export declare const NODE_ENV: "development" | "production";
18
+ export declare const NODE_ENV: "development" | "production" | "test";
19
19
  export declare const OXY_AUTH_URL: string;
20
20
  export {};
21
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,SAAS;;;;;;;;;EAGb,CAAC;AAEH,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,MAAM,CAAC;QACf,UAAU,UAAW,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC;SAAG;KAC1D;CACF;AAED,eAAO,MAAM,QAAQ,8BAAuB,CAAC;AAC7C,eAAO,MAAM,YAAY,QACoD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,SAAS;;;;;;;;;EAGb,CAAC;AAEH,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,MAAM,CAAC;QACf,UAAU,UAAW,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC;SAAG;KAC1D;CACF;AAED,eAAO,MAAM,QAAQ,uCAAuB,CAAC;AAC7C,eAAO,MAAM,YAAY,QACoD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/services",
3
- "version": "0.0.17",
3
+ "version": "0.0.20",
4
4
  "description": "",
5
5
  "homepage": "https://oxy.so/",
6
6
  "main": "./dist/index.js",
@@ -9,9 +9,10 @@
9
9
  "dist"
10
10
  ],
11
11
  "scripts": {
12
- "build:scss": "sass src:dist",
12
+ "build:scss": "sass src:temp",
13
+ "copy:css": "ncp temp dist",
13
14
  "build:ts": "tsc",
14
- "build": "npm run build:scss && npm run build:ts",
15
+ "build": "npm run build:scss && npm run build:ts && npm run copy:css",
15
16
  "test": "echo \"Error: no test specified\" && exit 1",
16
17
  "lint": "eslint src/**/*.{ts,tsx}"
17
18
  },
@@ -32,6 +33,7 @@
32
33
  "@typescript-eslint/parser": "^7.0.1",
33
34
  "autoprefixer": "^10.4.17",
34
35
  "eslint": "^8.56.0",
36
+ "ncp": "^2.0.0",
35
37
  "sass": "^1.77.2",
36
38
  "tailwindcss": "^3.4.1",
37
39
  "typescript": "^5.4.5"