@oxyhq/services 0.0.74 → 0.0.76

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.
Files changed (42) hide show
  1. package/dist/assets/dot-icon.tsx +11 -0
  2. package/dist/assets/verified-icon.tsx +19 -0
  3. package/dist/components/assets/oxy-logo.tsx +97 -0
  4. package/dist/components/auth/AccountSwitcherModal.tsx +139 -0
  5. package/dist/components/auth/SessionOwnerButton.tsx +67 -0
  6. package/dist/components/auth/SignInButton.tsx +31 -0
  7. package/dist/components/auth/styles/oavatar.module.scss +36 -0
  8. package/dist/components/auth/styles/sign-in-button.module.scss +32 -0
  9. package/dist/components/elements/button/components/button.tsx +35 -0
  10. package/dist/components/elements/button/components/styles/button.module.scss +27 -0
  11. package/dist/components/elements/button/index.ts +1 -0
  12. package/dist/components/elements/ellipsis-wrapper/components/EllipsisWrapper.tsx +18 -0
  13. package/dist/components/elements/ellipsis-wrapper/components/styles/ellipses-wrapper.module.scss +10 -0
  14. package/dist/components/elements/ellipsis-wrapper/index.ts +1 -0
  15. package/dist/components/elements/modal/components/confirmation-modal.tsx +62 -0
  16. package/dist/components/elements/modal/components/modal.tsx +182 -0
  17. package/dist/components/elements/modal/components/styles/confirmation-modal.module.scss +125 -0
  18. package/dist/components/elements/modal/components/styles/modal.module.scss +8 -0
  19. package/dist/components/elements/modal/hooks/use-track-position.ts +49 -0
  20. package/dist/components/elements/modal/index.ts +3 -0
  21. package/dist/config/index.ts +17 -0
  22. package/dist/features/profile/components/avatar.tsx +30 -0
  23. package/dist/features/profile/components/styles/avatar.module.scss +14 -0
  24. package/dist/features/profile/components/styles/user-name.module.scss +19 -0
  25. package/dist/features/profile/components/styles/user-username.module.scss +4 -0
  26. package/dist/features/profile/components/user-name.tsx +21 -0
  27. package/dist/features/profile/components/user-username.tsx +10 -0
  28. package/dist/features/profile/index.ts +3 -0
  29. package/dist/hooks/get-user.ts +30 -0
  30. package/dist/hooks/getUserById.ts +43 -0
  31. package/dist/hooks/use-user.ts +25 -0
  32. package/dist/hooks/useOxySession.ts +104 -0
  33. package/dist/index.css +0 -2
  34. package/dist/index.ts +13 -0
  35. package/dist/interfaces/index.tsx +22 -0
  36. package/dist/types/index.ts +1 -0
  37. package/dist/utils/cn.ts +6 -0
  38. package/package.json +6 -5
  39. package/dist/components/auth/styles/account-switcher-modal.module.css +0 -35
  40. package/dist/components/auth/styles/account-switcher-modal.module.css.map +0 -1
  41. package/dist/components/auth/styles/session-owner-modal.module.css +0 -35
  42. package/dist/components/auth/styles/session-owner-modal.module.css.map +0 -1
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+
3
+ export const DotIcon = () => {
4
+ return (
5
+ <svg viewBox="0 0 24 24" aria-hidden="true">
6
+ <g>
7
+ <path d="M3 12c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2zm9 2c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm7 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"></path>
8
+ </g>
9
+ </svg>
10
+ );
11
+ };
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ export const VerifiedIcon = () => {
3
+ return (
4
+ <svg
5
+ style={{
6
+ fill: "var(--clr-primary)",
7
+ height: "var(--verified-icon-width)",
8
+ marginLeft: "2px",
9
+ }}
10
+ viewBox="0 0 24 24"
11
+ aria-label="Verified account"
12
+ role="img"
13
+ >
14
+ <g>
15
+ <path d="M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.33 2.19c-1.4-.46-2.91-.2-3.92.81s-1.26 2.52-.8 3.91c-1.31.67-2.2 1.91-2.2 3.34s.89 2.67 2.2 3.34c-.46 1.39-.21 2.9.8 3.91s2.52 1.26 3.91.81c.67 1.31 1.91 2.19 3.34 2.19s2.68-.88 3.34-2.19c1.39.45 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z"></path>
16
+ </g>
17
+ </svg>
18
+ );
19
+ };
@@ -0,0 +1,97 @@
1
+ import React from "react";
2
+
3
+ export const OxyLogo = () => {
4
+ return (
5
+ <svg
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ width="116"
8
+ zoomAndPan="magnify"
9
+ viewBox="0 0 87 52.499999"
10
+ height="70"
11
+ preserveAspectRatio="xMidYMid meet"
12
+ version="1.0"
13
+ >
14
+ <defs>
15
+ <g />
16
+ <clipPath id="de9525902a">
17
+ <path
18
+ d="M 0.410156 0 L 80 0 L 80 52.003906 L 0.410156 52.003906 Z M 0.410156 0 "
19
+ clipRule="nonzero"
20
+ />
21
+ </clipPath>
22
+ <clipPath id="0f15cfe728">
23
+ <path
24
+ d="M 0.410156 0 L 86.589844 0 L 86.589844 52.003906 L 0.410156 52.003906 Z M 0.410156 0 "
25
+ clipRule="nonzero"
26
+ />
27
+ </clipPath>
28
+ <clipPath id="01558d3ec9">
29
+ <path
30
+ d="M 8 0 L 86.589844 0 L 86.589844 52.003906 L 8 52.003906 Z M 8 0 "
31
+ clipRule="nonzero"
32
+ />
33
+ </clipPath>
34
+ </defs>
35
+ <g clipPath="url(#de9525902a)">
36
+ <path
37
+ strokeLinecap="butt"
38
+ transform="matrix(0.438038, -0.0312198, 0.0312198, 0.438038, 2.178459, -2.944772)"
39
+ fill="none"
40
+ strokeLinejoin="miter"
41
+ d="M 29.606248 112.776429 C 24.960256 112.775252 20.923113 111.613591 17.495452 109.282574 C 14.058285 106.959796 11.222418 103.832702 8.978346 99.90953 C 6.725402 95.985726 5.052237 91.434423 3.941739 86.245484 C 2.839481 81.06605 2.282836 75.613386 2.288917 69.89763 C 2.285551 64.564658 2.875994 59.158079 4.060877 53.66902 C 5.236888 48.179329 7.052432 43.225688 9.489764 38.806831 C 11.927729 34.379101 15.012241 30.764367 18.753438 27.945516 C 22.485763 25.126032 26.947115 23.713985 32.128621 23.708741 C 37.15803 23.710492 41.368849 25.062884 44.760446 27.774788 C 48.152676 30.47782 50.85488 33.978846 52.8753 38.28737 C 54.89572 42.595894 56.344581 47.416574 57.221882 52.74941 C 58.098552 58.091118 58.539202 63.419586 58.533063 68.760798 C 58.537791 74.700265 57.941044 80.320417 56.760568 85.62252 C 55.580724 90.91575 53.794288 95.586103 51.39302 99.624073 C 48.991752 103.662043 45.981323 106.862929 42.361734 109.226732 C 38.733273 111.589902 34.484191 112.776303 29.606248 112.776429 Z M 30.978507 48.979542 C 29.534199 48.974697 28.298484 49.546528 27.262488 50.694404 C 26.235997 51.834039 25.379408 53.342488 24.693352 55.210878 C 24.007296 57.079268 23.510132 59.175143 23.210732 61.499137 C 22.90246 63.822497 22.753261 66.166113 22.754263 68.529352 C 22.75151 71.195522 22.917967 73.864834 23.26314 76.529048 C 23.607681 79.202135 24.12329 81.602051 24.809336 83.737668 C 25.496014 85.864413 26.354374 87.584266 27.376808 88.878849 C 28.408115 90.174065 29.645922 90.824096 31.099735 90.820701 C 32.775994 90.824242 34.111165 89.983053 35.095745 88.305374 C 36.089198 86.628327 36.866489 84.605923 37.444732 82.248297 C 38.014734 79.881167 38.393335 77.44689 38.581799 74.92772 C 38.778503 72.418056 38.874505 70.320341 38.869174 68.64345 C 38.873289 66.583775 38.733527 64.415752 38.468898 62.1229 C 38.203636 59.838921 37.766021 57.72101 37.155421 55.77804 C 36.544821 53.83507 35.741613 52.217242 34.754669 50.925187 C 33.768358 49.62426 32.5033 48.981205 30.978507 48.979542 Z M 30.978507 48.979542 "
42
+ stroke="#d269e6"
43
+ strokeWidth="19.756237"
44
+ strokeOpacity="1"
45
+ strokeMiterlimit="4"
46
+ />
47
+ </g>
48
+ <g clipPath="url(#0f15cfe728)">
49
+ <path
50
+ strokeLinecap="butt"
51
+ transform="matrix(0.439138, 0.00310788, -0.00310788, 0.439138, 31.545233, -4.895718)"
52
+ fill="none"
53
+ strokeLinejoin="miter"
54
+ d="M 59.564528 28.633108 C 59.567468 30.305398 59.259907 32.095524 58.650741 34.003424 C 58.041574 35.911323 57.281259 37.829187 56.361025 39.774869 C 55.449687 41.720488 54.475644 43.604284 53.447854 45.435088 C 52.420064 47.265893 51.488733 48.900319 50.645027 50.347324 C 48.889165 53.624315 47.142387 56.927928 45.386776 60.240499 C 43.631166 63.553069 41.768691 66.848605 39.781564 70.127233 C 40.771955 71.810326 42.051262 74.096252 43.619483 76.985012 C 45.178873 79.882729 46.703754 82.931911 48.18523 86.132619 C 49.675602 89.333264 50.969784 92.464136 52.076545 95.507381 C 53.183368 98.559521 53.734873 101.07298 53.731121 103.056652 C 53.732991 104.57773 53.316175 106.012819 52.471651 107.344191 C 51.636022 108.6755 50.342036 109.342908 48.589692 109.346415 C 46.534862 109.343167 44.456198 108.486141 42.353638 106.766444 C 40.260037 105.055578 38.279739 103.014785 36.412807 100.652961 C 34.545875 98.291136 32.829778 95.874872 31.264452 93.395274 C 29.708021 90.915613 28.466308 88.91407 27.548208 87.390581 C 26.252504 89.072062 24.938695 90.709195 23.606844 92.310874 C 22.274994 93.912554 20.961185 95.549686 19.665417 97.222273 C 18.827963 98.295632 17.813997 99.565937 16.63254 101.050913 C 15.451146 102.544784 14.153867 104.003895 12.749788 105.454866 C 11.336814 106.9059 9.886624 108.12592 8.399218 109.114926 C 6.920706 110.10387 5.492102 110.603221 4.113341 110.604083 C 3.125952 110.602176 2.306117 110.394491 1.653773 109.972135 C 1.010324 109.549716 0.472732 109.002014 0.0586596 108.311113 C -0.364244 107.62917 -0.663187 106.866293 -0.855896 106.031501 C -1.048668 105.187814 -1.143533 104.35233 -1.140556 103.516154 C -1.139511 101.150004 -0.747157 98.77219 0.0541702 96.364795 C 0.85556 93.966296 1.791569 91.735854 2.862259 89.682364 C 6.595492 81.748046 10.516145 73.901355 14.632988 66.124438 C 13.793368 64.378012 12.744257 61.939237 11.485655 58.808114 C 10.23601 55.685822 8.99419 52.412256 7.777921 48.978393 C 6.552758 45.544594 5.506246 42.216274 4.629366 38.975706 C 3.752486 35.735137 3.315922 33.123017 3.319736 31.14824 C 3.312956 28.933365 3.850586 26.972601 4.914774 25.257177 C 5.978961 23.541754 7.734156 22.684281 10.171464 22.684822 C 11.550225 22.683959 12.824829 23.04854 14.004108 23.769606 C 15.183387 24.490673 16.275103 25.408055 17.261403 26.512983 C 18.256597 27.617849 19.127831 28.803649 19.89283 30.061364 C 20.657829 31.319078 21.262029 32.480083 21.723219 33.544251 C 23.014694 36.292645 24.314875 39.014292 25.606035 41.718212 C 26.90609 44.422069 28.126784 47.224336 29.268117 50.125012 C 29.874306 49.053289 30.718011 47.606284 31.78138 45.775228 C 32.853644 43.944109 34.06747 42.005244 35.440584 39.949614 C 36.813635 37.885089 38.30213 35.793061 39.897048 33.655803 C 41.500924 31.527378 43.141827 29.603281 44.819758 27.883514 C 46.488856 26.172705 48.18678 24.76413 49.904633 23.657854 C 51.622486 22.551578 53.237505 21.997537 54.758583 21.995667 C 56.439831 22.001559 57.654941 22.757953 58.421829 24.282512 C 59.179821 25.807134 59.563665 27.254347 59.564528 28.633108 Z M 59.564528 28.633108 "
55
+ stroke="#d269e6"
56
+ strokeWidth="19.756237"
57
+ strokeOpacity="1"
58
+ strokeMiterlimit="4"
59
+ />
60
+ </g>
61
+ <g clipPath="url(#01558d3ec9)">
62
+ <path
63
+ strokeLinecap="butt"
64
+ transform="matrix(0.437806, 0.034319, -0.034319, 0.437806, 58.344594, -4.587528)"
65
+ fill="none"
66
+ strokeLinejoin="miter"
67
+ d="M 54.99197 30.347237 C 54.986612 33.693533 54.554019 37.394524 53.675064 41.433863 C 52.79611 45.473203 51.679114 49.549048 50.306341 53.662787 C 48.934263 57.785393 47.445344 61.783324 45.840973 65.674315 C 44.244776 69.555742 42.756402 72.991523 41.38333 75.963227 C 40.622365 77.63782 39.690807 79.754059 38.58796 82.303075 C 37.47694 84.861653 36.24472 87.581413 34.866087 90.482173 C 33.495626 93.373371 32.029009 96.289951 30.465541 99.223045 C 28.902073 102.156139 27.288366 104.789812 25.605991 107.116586 C 23.932483 109.442665 22.216741 111.343782 20.468327 112.828111 C 18.711046 114.313135 16.958143 115.057262 15.209618 115.060491 C 12.764535 115.055867 11.035175 114.165361 10.002411 112.372627 C 8.978515 110.579198 8.455747 108.576962 8.461404 106.372702 C 8.463755 104.240079 8.821346 101.972541 9.543045 99.569394 C 10.273611 97.165551 11.184315 94.783277 12.292892 92.421181 C 13.392601 90.059781 14.613849 87.769154 15.948462 85.558864 C 17.283075 83.348574 18.519784 81.369017 19.667458 79.619498 C 18.138733 79.239682 16.657315 78.552798 15.205469 77.560236 C 13.753624 76.567675 12.688319 75.384211 12.001382 74.019408 C 10.783822 71.348926 9.530284 68.333294 8.232595 64.982074 C 6.934907 61.630854 5.775628 58.224173 4.745195 54.753857 C 3.714763 51.283541 2.85421 47.817754 2.171709 44.346931 C 1.489209 40.876109 1.142107 37.700199 1.146751 34.800075 C 1.146114 33.426086 1.296061 31.924301 1.604765 30.285159 C 1.904602 28.646713 2.418826 27.125296 3.146742 25.71204 C 3.86579 24.29948 4.817131 23.118535 6.000764 22.169208 C 7.184397 21.21988 8.654562 20.73882 10.403782 20.744458 C 12.384261 20.74089 14.13797 21.486731 15.664215 22.973111 C 17.190459 24.459491 18.542635 26.343177 19.721435 28.633036 C 20.899541 30.914027 21.911581 33.466784 22.748687 36.292001 C 23.585099 39.108351 24.31162 41.888703 24.919384 44.633752 C 25.536015 47.378107 26.027464 49.891371 26.412161 52.181022 C 26.787294 54.462501 27.133063 56.255553 27.439904 57.552006 C 27.743197 56.41294 28.258473 54.677304 28.97756 52.354662 C 29.70482 50.022457 30.58319 47.455349 31.611281 44.635601 C 32.639372 41.815853 33.822218 38.921517 35.159124 35.943727 C 36.487857 32.975499 37.899519 30.268441 39.385938 27.832115 C 40.871662 25.386921 42.454912 23.389121 44.126127 21.830543 C 45.805514 20.262402 47.520166 19.485584 49.277558 19.48166 C 50.419594 19.48136 51.371215 19.897492 52.133116 20.738924 C 52.895017 21.580355 53.489988 22.568707 53.900989 23.714238 C 54.320857 24.859073 54.609794 26.04094 54.75893 27.260531 C 54.916934 28.479428 54.988702 29.508793 54.99197 30.347237 Z M 54.99197 30.347237 "
68
+ stroke="#d269e6"
69
+ strokeWidth="19.756237"
70
+ strokeOpacity="1"
71
+ strokeMiterlimit="4"
72
+ />
73
+ </g>
74
+ <g fill="#ffffff" fillOpacity="1">
75
+ <g transform="translate(5.581418, 44.801333)">
76
+ <g>
77
+ <path d="M 13.09375 0.734375 C 11.050781 0.878906 9.242188 0.492188 7.671875 -0.421875 C 6.097656 -1.335938 4.753906 -2.617188 3.640625 -4.265625 C 2.535156 -5.910156 1.660156 -7.851562 1.015625 -10.09375 C 0.367188 -12.332031 -0.0390625 -14.703125 -0.21875 -17.203125 C -0.382812 -19.546875 -0.296875 -21.929688 0.046875 -24.359375 C 0.398438 -26.796875 1.039062 -29.019531 1.96875 -31.03125 C 2.894531 -33.050781 4.128906 -34.738281 5.671875 -36.09375 C 7.222656 -37.445312 9.140625 -38.203125 11.421875 -38.359375 C 13.617188 -38.515625 15.5 -38.054688 17.0625 -36.984375 C 18.632812 -35.910156 19.929688 -34.457031 20.953125 -32.625 C 21.972656 -30.800781 22.757812 -28.734375 23.3125 -26.421875 C 23.863281 -24.117188 24.222656 -21.796875 24.390625 -19.453125 C 24.566406 -16.847656 24.476562 -14.367188 24.125 -12.015625 C 23.769531 -9.660156 23.128906 -7.554688 22.203125 -5.703125 C 21.285156 -3.859375 20.070312 -2.363281 18.5625 -1.21875 C 17.050781 -0.0703125 15.226562 0.578125 13.09375 0.734375 Z M 11.703125 -27.265625 C 11.066406 -27.222656 10.539062 -26.929688 10.125 -26.390625 C 9.707031 -25.847656 9.375 -25.15625 9.125 -24.3125 C 8.882812 -23.476562 8.734375 -22.546875 8.671875 -21.515625 C 8.609375 -20.492188 8.613281 -19.460938 8.6875 -18.421875 C 8.769531 -17.253906 8.925781 -16.09375 9.15625 -14.9375 C 9.394531 -13.78125 9.695312 -12.742188 10.0625 -11.828125 C 10.4375 -10.921875 10.867188 -10.203125 11.359375 -9.671875 C 11.859375 -9.140625 12.425781 -8.894531 13.0625 -8.9375 C 13.800781 -8.988281 14.359375 -9.394531 14.734375 -10.15625 C 15.109375 -10.914062 15.382812 -11.820312 15.5625 -12.875 C 15.738281 -13.925781 15.828125 -15.003906 15.828125 -16.109375 C 15.828125 -17.222656 15.800781 -18.148438 15.75 -18.890625 C 15.6875 -19.796875 15.5625 -20.742188 15.375 -21.734375 C 15.1875 -22.722656 14.925781 -23.632812 14.59375 -24.46875 C 14.269531 -25.300781 13.875 -25.984375 13.40625 -26.515625 C 12.9375 -27.054688 12.367188 -27.304688 11.703125 -27.265625 Z M 11.703125 -27.265625 " />
78
+ </g>
79
+ </g>
80
+ </g>
81
+ <g fill="#ffffff" fillOpacity="1">
82
+ <g transform="translate(31.206474, 42.970303)">
83
+ <g>
84
+ <path d="M 26.40625 -35.109375 C 26.394531 -34.367188 26.253906 -33.582031 25.984375 -32.75 C 25.710938 -31.914062 25.367188 -31.070312 24.953125 -30.21875 C 24.546875 -29.363281 24.113281 -28.535156 23.65625 -27.734375 C 23.207031 -26.941406 22.796875 -26.226562 22.421875 -25.59375 C 21.640625 -24.15625 20.859375 -22.710938 20.078125 -21.265625 C 19.304688 -19.828125 18.476562 -18.382812 17.59375 -16.9375 C 18.019531 -16.207031 18.570312 -15.203125 19.25 -13.921875 C 19.925781 -12.648438 20.585938 -11.304688 21.234375 -9.890625 C 21.878906 -8.484375 22.4375 -7.109375 22.90625 -5.765625 C 23.382812 -4.421875 23.617188 -3.3125 23.609375 -2.4375 C 23.609375 -1.769531 23.421875 -1.144531 23.046875 -0.5625 C 22.671875 0.0195312 22.097656 0.3125 21.328125 0.3125 C 20.429688 0.300781 19.523438 -0.0820312 18.609375 -0.84375 C 17.691406 -1.601562 16.828125 -2.503906 16.015625 -3.546875 C 15.203125 -4.585938 14.457031 -5.65625 13.78125 -6.75 C 13.101562 -7.84375 12.5625 -8.726562 12.15625 -9.40625 C 11.59375 -8.675781 11.015625 -7.960938 10.421875 -7.265625 C 9.828125 -6.566406 9.242188 -5.847656 8.671875 -5.109375 C 8.296875 -4.640625 7.847656 -4.082031 7.328125 -3.4375 C 6.804688 -2.789062 6.234375 -2.148438 5.609375 -1.515625 C 4.984375 -0.890625 4.34375 -0.363281 3.6875 0.0625 C 3.03125 0.5 2.40625 0.71875 1.8125 0.71875 C 1.375 0.71875 1.007812 0.625 0.71875 0.4375 C 0.4375 0.25 0.203125 0.00390625 0.015625 -0.296875 C -0.160156 -0.597656 -0.285156 -0.929688 -0.359375 -1.296875 C -0.441406 -1.671875 -0.484375 -2.039062 -0.484375 -2.40625 C -0.472656 -3.445312 -0.289062 -4.492188 0.0625 -5.546875 C 0.414062 -6.597656 0.832031 -7.570312 1.3125 -8.46875 C 2.976562 -11.9375 4.726562 -15.375 6.5625 -18.78125 C 6.195312 -19.550781 5.742188 -20.625 5.203125 -22 C 4.660156 -23.375 4.125 -24.816406 3.59375 -26.328125 C 3.070312 -27.835938 2.625 -29.300781 2.25 -30.71875 C 1.875 -32.144531 1.6875 -33.296875 1.6875 -34.171875 C 1.695312 -35.140625 1.9375 -36 2.40625 -36.75 C 2.882812 -37.507812 3.660156 -37.882812 4.734375 -37.875 C 5.335938 -37.875 5.894531 -37.710938 6.40625 -37.390625 C 6.925781 -37.066406 7.398438 -36.660156 7.828125 -36.171875 C 8.265625 -35.679688 8.644531 -35.15625 8.96875 -34.59375 C 9.300781 -34.039062 9.566406 -33.535156 9.765625 -33.078125 C 10.328125 -31.859375 10.890625 -30.65625 11.453125 -29.46875 C 12.015625 -28.28125 12.546875 -27.046875 13.046875 -25.765625 C 13.304688 -26.234375 13.671875 -26.863281 14.140625 -27.65625 C 14.617188 -28.457031 15.160156 -29.304688 15.765625 -30.203125 C 16.378906 -31.109375 17.039062 -32.023438 17.75 -32.953125 C 18.46875 -33.890625 19.195312 -34.734375 19.9375 -35.484375 C 20.675781 -36.234375 21.421875 -36.847656 22.171875 -37.328125 C 22.929688 -37.804688 23.644531 -38.039062 24.3125 -38.03125 C 25.050781 -38.03125 25.582031 -37.691406 25.90625 -37.015625 C 26.238281 -36.335938 26.40625 -35.703125 26.40625 -35.109375 Z M 26.40625 -35.109375 " />
85
+ </g>
86
+ </g>
87
+ </g>
88
+ <g fill="#ffffff" fillOpacity="1">
89
+ <g transform="translate(54.60382, 43.133297)">
90
+ <g>
91
+ <path d="M 26.765625 -32.53125 C 26.648438 -31.070312 26.332031 -29.472656 25.8125 -27.734375 C 25.289062 -26.003906 24.660156 -24.257812 23.921875 -22.5 C 23.179688 -20.75 22.390625 -19.050781 21.546875 -17.40625 C 20.710938 -15.757812 19.945312 -14.304688 19.25 -13.046875 C 18.863281 -12.335938 18.382812 -11.441406 17.8125 -10.359375 C 17.238281 -9.285156 16.597656 -8.132812 15.890625 -6.90625 C 15.191406 -5.6875 14.453125 -4.460938 13.671875 -3.234375 C 12.890625 -2.003906 12.085938 -0.910156 11.265625 0.046875 C 10.453125 1.015625 9.632812 1.789062 8.8125 2.375 C 8 2.957031 7.210938 3.21875 6.453125 3.15625 C 5.390625 3.070312 4.660156 2.625 4.265625 1.8125 C 3.878906 1 3.722656 0.109375 3.796875 -0.859375 C 3.867188 -1.785156 4.101562 -2.765625 4.5 -3.796875 C 4.90625 -4.828125 5.390625 -5.835938 5.953125 -6.828125 C 6.515625 -7.816406 7.125 -8.773438 7.78125 -9.703125 C 8.4375 -10.640625 9.050781 -11.46875 9.625 -12.1875 C 8.96875 -12.40625 8.335938 -12.753906 7.734375 -13.234375 C 7.128906 -13.710938 6.703125 -14.269531 6.453125 -14.90625 C 6.015625 -16.125 5.566406 -17.484375 5.109375 -18.984375 C 4.660156 -20.492188 4.269531 -22.023438 3.9375 -23.578125 C 3.613281 -25.140625 3.359375 -26.6875 3.171875 -28.21875 C 2.984375 -29.757812 2.941406 -31.164062 3.046875 -32.4375 C 3.085938 -33.03125 3.203125 -33.679688 3.390625 -34.390625 C 3.585938 -35.097656 3.867188 -35.75 4.234375 -36.34375 C 4.609375 -36.945312 5.066406 -37.429688 5.609375 -37.796875 C 6.148438 -38.171875 6.804688 -38.328125 7.578125 -38.265625 C 8.453125 -38.203125 9.191406 -37.820312 9.796875 -37.125 C 10.410156 -36.425781 10.9375 -35.550781 11.375 -34.5 C 11.820312 -33.457031 12.179688 -32.304688 12.453125 -31.046875 C 12.722656 -29.785156 12.941406 -28.539062 13.109375 -27.3125 C 13.285156 -26.09375 13.414062 -24.972656 13.5 -23.953125 C 13.59375 -22.941406 13.6875 -22.15625 13.78125 -21.59375 C 13.957031 -22.070312 14.238281 -22.804688 14.625 -23.796875 C 15.019531 -24.796875 15.492188 -25.894531 16.046875 -27.09375 C 16.597656 -28.289062 17.210938 -29.515625 17.890625 -30.765625 C 18.578125 -32.015625 19.285156 -33.148438 20.015625 -34.171875 C 20.742188 -35.203125 21.503906 -36.03125 22.296875 -36.65625 C 23.097656 -37.28125 23.882812 -37.5625 24.65625 -37.5 C 25.15625 -37.457031 25.550781 -37.238281 25.84375 -36.84375 C 26.144531 -36.457031 26.367188 -36.003906 26.515625 -35.484375 C 26.671875 -34.972656 26.757812 -34.445312 26.78125 -33.90625 C 26.800781 -33.363281 26.796875 -32.90625 26.765625 -32.53125 Z M 26.765625 -32.53125 " />
92
+ </g>
93
+ </g>
94
+ </g>
95
+ </svg>
96
+ );
97
+ };
@@ -0,0 +1,139 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ import { useEffect, useState } from "react";
4
+ import { motion } from "framer-motion";
5
+ import Link from "next/link";
6
+ import useOxySession from "../../hooks/useOxySession";
7
+ import { forwardRef } from "react";
8
+ import Image from "next/image";
9
+ import { HiOutlinePlus } from "react-icons/hi";
10
+ import { PiSignOutBold } from "react-icons/pi";
11
+ import { AiOutlineClose } from "react-icons/ai";
12
+ import { Avatar } from "../../features/profile";
13
+
14
+ import getUserById from "../../hooks/getUserById";
15
+
16
+ import styles from "./styles/account-switcher-modal.module.scss";
17
+
18
+ interface User {
19
+ id: string;
20
+ username: string;
21
+ name: string;
22
+ email: string;
23
+ role: string;
24
+ avatar: string;
25
+ }
26
+
27
+ interface AccountSwitcherModalProps {
28
+ onClose: () => void;
29
+ }
30
+
31
+ export const AccountSwitcherModal = forwardRef<
32
+ HTMLDivElement,
33
+ AccountSwitcherModalProps
34
+ >((props, ref) => {
35
+ const { onClose } = props;
36
+ const { session } = useOxySession();
37
+ const [user, setUser] = useState<User | null>(null);
38
+ const [error, setError] = useState<string | null>(null);
39
+
40
+ useEffect(() => {
41
+ const fetchUser = async () => {
42
+ try {
43
+ const fetchedUser = await getUserById(session?.user?.id);
44
+ setUser(fetchedUser);
45
+ } catch (error) {
46
+ if (error instanceof Error) {
47
+ setError(error.message);
48
+ } else {
49
+ setError("An unknown error occurred");
50
+ }
51
+ }
52
+ };
53
+
54
+ if (session) {
55
+ fetchUser();
56
+ }
57
+ }, [session]);
58
+
59
+ if (!session) return null;
60
+
61
+ const handleBackdropClick = (e: React.MouseEvent<HTMLDivElement>) => {
62
+ e.stopPropagation();
63
+ if (e.currentTarget === e.target) {
64
+ onClose();
65
+ }
66
+ };
67
+
68
+ return (
69
+ <motion.div
70
+ initial={{ opacity: 0, y: "100%" }}
71
+ animate={{ opacity: 1, y: 0 }}
72
+ exit={{ opacity: 0, y: "100%" }}
73
+ transition={{
74
+ ease: "easeInOut",
75
+ duration: 0.2,
76
+ }}
77
+ className={styles.container}
78
+ role="group"
79
+ onClick={handleBackdropClick}
80
+ ref={ref}
81
+ >
82
+ <button
83
+ className="absolute right-3 top-3 rounded-full bg-indigo-50 p-1 hover:bg-zinc-200"
84
+ onClick={onClose}
85
+ >
86
+ <AiOutlineClose className="h-5 w-5 rounded-full stroke-2 text-zinc-700" />
87
+ </button>
88
+ <p>{session?.user?.email}</p>
89
+ <div className="h-20 w-20 rounded-full border">
90
+ <Avatar
91
+ userImage={session?.user?.avatar as string}
92
+ className="h-full w-full rounded-full object-center"
93
+ draggable={false}
94
+ alt="avatar"
95
+ />
96
+ </div>
97
+ <h2 className="md:text-2xl text-xl font-normal">
98
+ Hi, {session?.user?.name}!
99
+ </h2>
100
+ <a
101
+ href="https://accounts.oxy.so"
102
+ target="_blank"
103
+ rel="noopener noreferrer"
104
+ className="rounded-full border border-black px-7 py-2 text-blue-500 hover:bg-[#d3dfee]"
105
+ >
106
+ Manage your Oxy Account
107
+ </a>
108
+ <div className="flex space-x-1">
109
+ <button className="md:w-44 flex w-36 items-center space-x-2 rounded-l-full bg-white py-3 pl-3 hover:bg-zinc-200">
110
+ <HiOutlinePlus className="h-7 w-7 rounded-full bg-indigo-50 p-1 text-blue-500" />
111
+ <span>Add account</span>
112
+ </button>
113
+ <button className="md:w-44 flex w-36 items-center space-x-2 rounded-r-full bg-white py-3 pl-3 hover:bg-zinc-200">
114
+ <PiSignOutBold className="h-6 w-6" />
115
+ <span>Sign out</span>
116
+ </button>
117
+ </div>
118
+ <div className="flex h-10 items-center space-x-2 text-xs">
119
+ <a
120
+ href="https://oxy.so/company/transparency/policies/privacy"
121
+ target="_blank"
122
+ rel="noopener noreferrer"
123
+ >
124
+ Privacy policy
125
+ </a>
126
+ <span className="-mt-[3px]"> . </span>
127
+ <a
128
+ href="https://oxy.so/company/transparency/policies/terms-of-service"
129
+ target="_blank"
130
+ rel="noopener noreferrer"
131
+ >
132
+ Terms of service
133
+ </a>
134
+ </div>
135
+ </motion.div>
136
+ );
137
+ });
138
+
139
+ AccountSwitcherModal.displayName = "AccountSwitcherModal";
@@ -0,0 +1,67 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ import { AnimatePresence } from "framer-motion";
4
+ import useOxySession from "../../hooks/useOxySession";
5
+ import { useRef, useState } from "react";
6
+
7
+ import { DotIcon } from "../../assets/dot-icon";
8
+ import { Button } from "../../components/elements/button";
9
+ import { EllipsisWrapper } from "../../components/elements/ellipsis-wrapper";
10
+ import { Modal } from "../../components/elements/modal";
11
+ import { Avatar, UserName, UserUsername } from "../../features/profile";
12
+
13
+ import { AccountSwitcherModal } from "./AccountSwitcherModal";
14
+
15
+ export const SessionOwnerButton = () => {
16
+ const { session, error } = useOxySession();
17
+ const [isModalOpen, setIsModalOpen] = useState(false);
18
+ const buttonRef = useRef<HTMLButtonElement>(null);
19
+
20
+ const openModal = React.useCallback(() => {
21
+ setIsModalOpen(true);
22
+ }, []);
23
+
24
+ if (error) {
25
+ return <div>Error: {error}</div>;
26
+ }
27
+
28
+ return (
29
+ <>
30
+ <Button
31
+ aria-label="Account menu"
32
+ onClick={openModal}
33
+ ref={buttonRef}
34
+ aria-haspopup="menu"
35
+ aria-expanded={isModalOpen}
36
+ className="p-[0.75em] hover:bg-neutral-500 focus-visible:bg-neutral-500 focus-visible:outline-secondary-100 active:bg-neutral-600 xxl:flex xxl:w-full xxl:gap-3"
37
+ >
38
+ <Avatar userImage={session?.user?.avatar as string} />
39
+ <div className="hidden flex-1 flex-col xxl:flex">
40
+ <UserName
41
+ name={session?.user?.name}
42
+ isVerified={session?.user?.verified}
43
+ />
44
+
45
+ <EllipsisWrapper>
46
+ <UserUsername username={session?.user?.username} />
47
+ </EllipsisWrapper>
48
+ </div>
49
+ <div className="hidden fill-secondary-100 xxl:inline [&>svg]:size-h2">
50
+ <DotIcon />
51
+ </div>
52
+ </Button>
53
+
54
+ <AnimatePresence>
55
+ {isModalOpen && (
56
+ <Modal
57
+ onClose={() => setIsModalOpen(false)}
58
+ background="none"
59
+ minViewportWidth={500}
60
+ >
61
+ <AccountSwitcherModal onClose={() => setIsModalOpen(false)} />
62
+ </Modal>
63
+ )}
64
+ </AnimatePresence>
65
+ </>
66
+ );
67
+ };
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ import styles from "./styles/sign-in-button.module.scss";
3
+ import { OxyLogo } from "../assets/oxy-logo";
4
+
5
+ export const SignInButton = ({
6
+ icon = <OxyLogo />,
7
+ text = "Sign in with Oxy",
8
+ callback = typeof window !== "undefined" ? window.location.href : "",
9
+ }: {
10
+ icon?: React.ReactNode;
11
+ text?: string;
12
+ callback?: string;
13
+ }) => {
14
+ const onClick = () => {
15
+ if (typeof window !== "undefined") {
16
+ const redirectUrl = `https://auth.oxy.so/?callback=${encodeURIComponent(
17
+ callback
18
+ )}`;
19
+ window.location.href = redirectUrl;
20
+ }
21
+ };
22
+
23
+ return (
24
+ <button onClick={onClick} className={styles.container}>
25
+ {icon && icon}
26
+ {text}
27
+ </button>
28
+ );
29
+ };
30
+
31
+ export default SignInButton;
@@ -0,0 +1,36 @@
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
+ &:hover {
18
+ background-color: var(--clr-auth-button-hover);
19
+ }
20
+
21
+ &:active {
22
+ background-color: var(--clr-auth-button-active);
23
+ }
24
+
25
+ &:focus-visible {
26
+ outline: 2px solid var(--clr-light);
27
+ background-color: var(--clr-auth-button-hover);
28
+ }
29
+
30
+ svg {
31
+ width: var(--fs-h2);
32
+ height: var(--fs-h2);
33
+ fill: var(--clr-dark);
34
+ margin-right: 0.5em;
35
+ }
36
+ }
@@ -0,0 +1,32 @@
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
+ &:hover {
14
+ background-color: var(--clr-auth-button-hover);
15
+ }
16
+
17
+ &:active {
18
+ background-color: var(--clr-auth-button-active);
19
+ }
20
+
21
+ &:focus-visible {
22
+ outline: 2px solid var(--clr-light);
23
+ background-color: var(--clr-auth-button-hover);
24
+ }
25
+
26
+ svg {
27
+ width: var(--fs-h2);
28
+ height: var(--fs-h2);
29
+ fill: var(--clr-dark);
30
+ margin-right: 0.5em;
31
+ }
32
+ }
@@ -0,0 +1,35 @@
1
+ import React, { forwardRef } from "react";
2
+
3
+ import { cn } from "../../../../utils/cn";
4
+
5
+ interface IButton extends React.ButtonHTMLAttributes<HTMLButtonElement> {
6
+ children: React.ReactNode;
7
+ }
8
+
9
+ export const Button = forwardRef<HTMLButtonElement, IButton>(
10
+ ({ children, className, ...props }, ref) => {
11
+ return (
12
+ <button
13
+ ref={ref}
14
+ {...props}
15
+ className={cn(
16
+ "grid cursor-pointer place-items-center rounded-full",
17
+ "transition-colors duration-200 ease-in-out",
18
+ "fill-secondary-100 p-[0.5em]",
19
+ "focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary-100",
20
+ "fill-secondary-100 [&>svg]:w-h2",
21
+ "disabled-button",
22
+ className,
23
+ "hover:bg-neutral-500 active:bg-neutral-600",
24
+ "focus-visible:bg-neutral-500 focus-visible:outline-secondary-100"
25
+ )}
26
+ aria-pressed={props["aria-pressed"]}
27
+ aria-disabled={props.disabled}
28
+ >
29
+ {children}
30
+ </button>
31
+ );
32
+ }
33
+ );
34
+
35
+ Button.displayName = "Button";
@@ -0,0 +1,27 @@
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
+ svg {
10
+ width: var(--fs-h2);
11
+ height: var(--fs-h2);
12
+ fill: var(--clr-secondary);
13
+ }
14
+
15
+ &:hover {
16
+ background-color: var(--clr-nav-hover);
17
+ }
18
+
19
+ &:active {
20
+ background-color: var(--clr-nav-active);
21
+ }
22
+
23
+ &:focus-visible {
24
+ outline: 2px solid var(--clr-secondary);
25
+ background-color: var(--clr-nav-hover);
26
+ }
27
+ }
@@ -0,0 +1 @@
1
+ export { Button } from "./components/button";
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import styles from "./styles/ellipses-wrapper.module.scss";
3
+
4
+ export const EllipsisWrapper = ({
5
+ children,
6
+ }: {
7
+ children: React.ReactNode;
8
+ }) => {
9
+ return (
10
+ <div
11
+ aria-hidden={true}
12
+ role="presentation"
13
+ className="grid grid-flow-col [&>*]:truncate"
14
+ >
15
+ {children}
16
+ </div>
17
+ );
18
+ };
@@ -0,0 +1,10 @@
1
+ .container {
2
+ display: grid;
3
+ grid-auto-flow: column;
4
+
5
+ * {
6
+ white-space: nowrap;
7
+ text-overflow: ellipsis;
8
+ overflow: hidden;
9
+ }
10
+ }
@@ -0,0 +1 @@
1
+ export * from "./components/EllipsisWrapper";
@@ -0,0 +1,62 @@
1
+ import React, { useEffect } from "react";
2
+ import { motion } from "framer-motion";
3
+ import styles from "./styles/confirmation-modal.module.scss";
4
+
5
+ export const ConfirmationModal = ({
6
+ heading,
7
+ paragraph,
8
+ confirmButtonText,
9
+ confirmButtonClick,
10
+ confirmButtonStyle = "delete",
11
+ cancelButtonText,
12
+ cancelButtonClick,
13
+ logo,
14
+ }: {
15
+ heading: string;
16
+ paragraph: string;
17
+ confirmButtonText: string;
18
+ confirmButtonClick: () => void;
19
+ confirmButtonStyle: "delete" | "unfollow" | "logout";
20
+ cancelButtonText: string;
21
+ cancelButtonClick: () => void;
22
+ logo?: React.ReactNode;
23
+ }) => {
24
+ useEffect(() => {
25
+ document.body.style.overflow = "hidden";
26
+ document.body.style.paddingRight = "11px";
27
+
28
+ return () => {
29
+ document.body.style.overflow = "unset";
30
+ document.body.style.paddingRight = "0";
31
+ };
32
+ }, []);
33
+
34
+ return (
35
+ <motion.div
36
+ initial={{ opacity: 0, y: 50 }}
37
+ animate={{ opacity: 1, y: 0 }}
38
+ exit={{ opacity: 0, y: 50 }}
39
+ transition={{ duration: 0.2 }}
40
+ className={styles.container}
41
+ >
42
+ {logo && <div className={styles.logo}>{logo}</div>}
43
+ <h1>{heading}</h1>
44
+ <p>{paragraph}</p>
45
+
46
+ <div className={styles.buttons}>
47
+ <button
48
+ onClick={confirmButtonClick}
49
+ className={`${styles.confirm} ${
50
+ styles[confirmButtonStyle as "delete" | "unfollow" | "logout"]
51
+ }
52
+ }`}
53
+ >
54
+ {confirmButtonText}
55
+ </button>
56
+ <button onClick={cancelButtonClick} className={styles.cancel}>
57
+ {cancelButtonText}
58
+ </button>
59
+ </div>
60
+ </motion.div>
61
+ );
62
+ };