@luxfi/core 5.1.3 → 5.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. package/commerce/AUTO-GEN-bullion-by-family.json +33 -33
  2. package/commerce/EDIT-ME-bullion-market-prices.ts +11 -11
  3. package/commerce/assign-prices.ts +49 -49
  4. package/commerce/assign-videos-by-family-group.ts +14 -14
  5. package/commerce/bullion-price-1oz.ts +5 -5
  6. package/commerce/index.ts +18 -18
  7. package/commerce/lux-service-options.ts +6 -6
  8. package/components/access-code-input.tsx +71 -71
  9. package/components/auth/auth-listener.tsx +29 -29
  10. package/components/auth/auth-token/clear-auth-token.tsx +12 -12
  11. package/components/auth/auth-token/set-auth-token.tsx +16 -16
  12. package/components/auth/common-auth-domains.ts +16 -16
  13. package/components/auth/login-panel.tsx +104 -104
  14. package/components/chat-widget.tsx +80 -80
  15. package/components/commerce/bag-button.tsx +98 -98
  16. package/components/commerce/buy-drawer/drawer.tsx +44 -44
  17. package/components/commerce/buy-drawer/index.tsx +46 -46
  18. package/components/commerce/checkout-button.tsx +116 -116
  19. package/components/commerce/checkout-panel/close-button.tsx +26 -26
  20. package/components/commerce/checkout-panel/dt-bag-carousel.tsx +36 -36
  21. package/components/commerce/checkout-panel/dt-checkout-panel.tsx +66 -66
  22. package/components/commerce/checkout-panel/index.tsx +123 -123
  23. package/components/commerce/checkout-panel/links-row.tsx +21 -21
  24. package/components/commerce/checkout-panel/mb-checkout-panel.tsx +54 -54
  25. package/components/commerce/checkout-panel/steps-indicator.tsx +39 -39
  26. package/components/commerce/checkout-panel/thank-you.tsx +18 -18
  27. package/components/commerce/checkout-widget/const.ts +13 -13
  28. package/components/commerce/checkout-widget/index.tsx +86 -86
  29. package/components/commerce/checkout-widget/obs-string-set.ts +48 -48
  30. package/components/commerce/checkout-widget/use-anim-clx-set.ts +56 -56
  31. package/components/commerce/checkout-widget/use-lagging-item-ref.ts +29 -29
  32. package/components/commerce/desktop-bag-popup.tsx +78 -78
  33. package/components/commerce/mobile-bag-drawer.tsx +51 -51
  34. package/components/commerce/mobile-login-button.tsx +101 -0
  35. package/components/commerce/mobile-menu-toggle-button.tsx +35 -35
  36. package/components/commerce/mobile-nav-menu-ai.tsx +98 -0
  37. package/components/commerce/mobile-nav-menu-item.tsx +46 -0
  38. package/components/commerce/mobile-nav-menu.tsx +79 -64
  39. package/components/contact-dialog/contact-form.tsx +112 -112
  40. package/components/contact-dialog/disclaimer.tsx +13 -13
  41. package/components/contact-dialog/index.tsx +64 -64
  42. package/components/copyright.tsx +21 -21
  43. package/components/footer.tsx +77 -77
  44. package/components/header/desktop.tsx +54 -54
  45. package/components/header/guts.tsx +27 -0
  46. package/components/header/index.tsx +47 -26
  47. package/components/header/mobile.tsx +165 -161
  48. package/components/header/theme-toggle.tsx +26 -26
  49. package/components/icons/avatar.tsx +11 -0
  50. package/components/icons/bag-icon.tsx +10 -10
  51. package/components/icons/github.tsx +14 -14
  52. package/components/icons/index.tsx +43 -35
  53. package/components/icons/left-arrow.tsx +11 -0
  54. package/components/icons/lux-logo.tsx +10 -10
  55. package/components/icons/right-arrow.tsx +10 -0
  56. package/components/icons/search.tsx +12 -0
  57. package/components/icons/secure-delivery.tsx +13 -13
  58. package/components/icons/social-icon.tsx +35 -35
  59. package/components/icons/social-svg.css +3 -3
  60. package/components/icons/youtube-logo.tsx +59 -59
  61. package/components/index.ts +27 -27
  62. package/components/logo.tsx +81 -81
  63. package/components/mini-chart/index.tsx +7 -7
  64. package/components/mini-chart/mini-chart-props.ts +43 -43
  65. package/components/mini-chart/mini-chart.tsx +85 -85
  66. package/components/mini-chart/wrapper.tsx +23 -23
  67. package/components/not-found/index.tsx +27 -27
  68. package/components/not-found/not-found-content.mdx +5 -5
  69. package/components/scripts.tsx +24 -24
  70. package/conf/index.ts +50 -50
  71. package/environment.d.ts +5 -5
  72. package/next/analytics/fpixel.ts +15 -15
  73. package/next/analytics/google-analytics.ts +13 -13
  74. package/next/analytics/index.ts +3 -3
  75. package/next/analytics/pixel-analytics.tsx +54 -54
  76. package/next/font/get-app-router-font-classes.ts +12 -12
  77. package/next/font/load-and-return-lux-next-fonts-on-import.ts +68 -68
  78. package/next/font/next-font-desc.ts +27 -27
  79. package/next/font/pages-router-font-vars.tsx +18 -18
  80. package/next/head-metadata/from-next/metadata-types.ts +158 -158
  81. package/next/head-metadata/from-next/opengraph-types.ts +267 -267
  82. package/next/head-metadata/from-next/twitter-types.ts +92 -92
  83. package/next/head-metadata/index.tsx +208 -208
  84. package/next/middleware/determine-device-mw.ts +16 -16
  85. package/package.json +73 -72
  86. package/root-layout/WHY_THIS_IS_SEPARATE.txt +1 -1
  87. package/root-layout/index.tsx +121 -120
  88. package/server-actions/firebase-app.ts +14 -14
  89. package/server-actions/index.ts +5 -5
  90. package/server-actions/store-contact.ts +51 -51
  91. package/site-def/footer/community.tsx +67 -67
  92. package/site-def/footer/company.ts +37 -37
  93. package/site-def/footer/ecosystem.ts +37 -37
  94. package/site-def/footer/index.tsx +26 -26
  95. package/site-def/footer/legal.ts +28 -28
  96. package/site-def/footer/network.ts +45 -45
  97. package/site-def/footer/svg/warpcast-logo.svg +11 -11
  98. package/site-def/index.ts +2 -2
  99. package/site-def/main-nav.tsx +292 -0
  100. package/style/cart-animation.css +29 -29
  101. package/style/checkout-animation.css +23 -23
  102. package/style/lux-colors.css +85 -85
  103. package/style/lux-global.css +30 -30
  104. package/tailwind/fontFamily.tailwind.lux.ts +18 -18
  105. package/tailwind/index.ts +2 -2
  106. package/tailwind/lux-tw-fonts.ts +39 -39
  107. package/tailwind/tailwind.config.lux-preset.ts +10 -10
  108. package/tsconfig.json +10 -28
  109. package/types/chatbot-config.ts +6 -6
  110. package/types/chatbot-suggested-question.ts +7 -7
  111. package/types/commerce-config.ts +10 -10
  112. package/types/contact-info.ts +10 -10
  113. package/types/index.ts +5 -5
  114. package/types/site-def.ts +45 -45
  115. package/site-def/main-nav.ts +0 -35
@@ -1,34 +1,34 @@
1
- [
2
- {
3
- "id": "LXM-AG-B",
4
- "title": "Minted Bar",
5
- "parentTitle": "Lux Silver",
6
- "desc": "Get unprecedented access to silver with 1:1 asset-backed Lux Silver NFTs, sovereign ownership of physical silver without management fees, and mine-direct discount pricing.",
7
- "img": {
8
- "src": "/assets/commerce/silver/product/silver-bar-pt-800x800.png",
9
- "dim": {
10
- "w": 800,
11
- "h": 800
12
- }
13
- },
14
- "products": [
15
- {
16
- "id": "fce17569-a86c-4f69-bc61-ab435ed0c46f",
17
- "sku": "LXM-AG-B-1_OZ",
18
- "fullTitle": "Lux Silver, 1oz Minted Bar",
19
- "optionLabel": "1oz",
20
- "familyTitle": "Minted Bar",
21
- "familyId": "LXM-AG-B",
22
- "desc": "Get unprecedented access to silver with 1:1 asset-backed Lux Silver NFTs, sovereign ownership of physical silver without management fees, and mine-direct discount pricing.",
23
- "price": 0,
24
- "img": {
25
- "src": "/assets/commerce/silver/product/silver-bar-pt-800x800.png",
26
- "dim": {
27
- "w": 800,
28
- "h": 800
29
- }
30
- }
31
- }
32
- ]
33
- }
1
+ [
2
+ {
3
+ "id": "LXM-AG-B",
4
+ "title": "Minted Bar",
5
+ "parentTitle": "Lux Silver",
6
+ "desc": "Get unprecedented access to silver with 1:1 asset-backed Lux Silver NFTs, sovereign ownership of physical silver without management fees, and mine-direct discount pricing.",
7
+ "img": {
8
+ "src": "/assets/commerce/silver/product/silver-bar-pt-800x800.png",
9
+ "dim": {
10
+ "w": 800,
11
+ "h": 800
12
+ }
13
+ },
14
+ "products": [
15
+ {
16
+ "id": "fce17569-a86c-4f69-bc61-ab435ed0c46f",
17
+ "sku": "LXM-AG-B-1_OZ",
18
+ "fullTitle": "Lux Silver, 1oz Minted Bar",
19
+ "optionLabel": "1oz",
20
+ "familyTitle": "Minted Bar",
21
+ "familyId": "LXM-AG-B",
22
+ "desc": "Get unprecedented access to silver with 1:1 asset-backed Lux Silver NFTs, sovereign ownership of physical silver without management fees, and mine-direct discount pricing.",
23
+ "price": 0,
24
+ "img": {
25
+ "src": "/assets/commerce/silver/product/silver-bar-pt-800x800.png",
26
+ "dim": {
27
+ "w": 800,
28
+ "h": 800
29
+ }
30
+ }
31
+ }
32
+ ]
33
+ }
34
34
  ]
@@ -1,12 +1,12 @@
1
- // updated manually apr 29, 2024
2
-
3
- export default {
4
- au: {
5
- market1oz: 2336.50,
6
- discount: 0.01
7
- },
8
- ag: {
9
- market1oz: 27.143,
10
- discount: 0.10
11
- },
1
+ // updated manually apr 29, 2024
2
+
3
+ export default {
4
+ au: {
5
+ market1oz: 2336.50,
6
+ discount: 0.01
7
+ },
8
+ ag: {
9
+ market1oz: 27.143,
10
+ discount: 0.10
11
+ },
12
12
  }
@@ -1,50 +1,50 @@
1
- import type { Family } from '@hanzo/commerce/types'
2
-
3
- import prices from './EDIT-ME-bullion-market-prices'
4
-
5
- const sep = {
6
- tok: '-',
7
- subTok: '_',
8
- decimal: '.'
9
- }
10
-
11
- const GRAMS_PER_OZ = 28.3495
12
-
13
- const tree: any = {}
14
- for (let key in prices) {
15
- const values = prices[key as keyof typeof prices]
16
- tree[key] = {
17
- oz: values.market1oz * (1 - values.discount),
18
- g: values.market1oz * (1 - values.discount) / GRAMS_PER_OZ
19
- }
20
- }
21
-
22
- // LXB-AU-B-1_OZ, LXB-AU-B-2.5_g
23
- const priceFromSKU = (
24
- sku: string
25
- ) => {
26
- const tokens = sku.split(sep.tok)
27
- const type_ = tokens[1].toLowerCase()
28
-
29
- const quanAndUnit = tokens[tokens.length - 1]
30
- const quanAndUnitToks = quanAndUnit.split(sep.subTok)
31
- let quantity = quanAndUnitToks[0].includes(sep.decimal) ? parseFloat(quanAndUnitToks[0].split(sep.decimal).join('.')) : parseInt(quanAndUnitToks[0])
32
- let unit = quanAndUnitToks[1].toLowerCase()
33
- if (unit === 'kg') {
34
- quantity *= 1000
35
- unit = 'g'
36
- }
37
- else if (unit === 'lb') {
38
- quantity *= 16
39
- unit = 'oz'
40
- }
41
-
42
- return tree[type_][unit] * quantity
43
- }
44
-
45
- export default (c: Family): Family => {
46
- for (let prod of c.products) {
47
- prod.price = priceFromSKU(prod.sku)
48
- }
49
- return c
1
+ import type { Family } from '@hanzo/commerce/types'
2
+
3
+ import prices from './EDIT-ME-bullion-market-prices'
4
+
5
+ const sep = {
6
+ tok: '-',
7
+ subTok: '_',
8
+ decimal: '.'
9
+ }
10
+
11
+ const GRAMS_PER_OZ = 28.3495
12
+
13
+ const tree: any = {}
14
+ for (let key in prices) {
15
+ const values = prices[key as keyof typeof prices]
16
+ tree[key] = {
17
+ oz: values.market1oz * (1 - values.discount),
18
+ g: values.market1oz * (1 - values.discount) / GRAMS_PER_OZ
19
+ }
20
+ }
21
+
22
+ // LXB-AU-B-1_OZ, LXB-AU-B-2.5_g
23
+ const priceFromSKU = (
24
+ sku: string
25
+ ) => {
26
+ const tokens = sku.split(sep.tok)
27
+ const type_ = tokens[1].toLowerCase()
28
+
29
+ const quanAndUnit = tokens[tokens.length - 1]
30
+ const quanAndUnitToks = quanAndUnit.split(sep.subTok)
31
+ let quantity = quanAndUnitToks[0].includes(sep.decimal) ? parseFloat(quanAndUnitToks[0].split(sep.decimal).join('.')) : parseInt(quanAndUnitToks[0])
32
+ let unit = quanAndUnitToks[1].toLowerCase()
33
+ if (unit === 'kg') {
34
+ quantity *= 1000
35
+ unit = 'g'
36
+ }
37
+ else if (unit === 'lb') {
38
+ quantity *= 16
39
+ unit = 'oz'
40
+ }
41
+
42
+ return tree[type_][unit] * quantity
43
+ }
44
+
45
+ export default (c: Family): Family => {
46
+ for (let prod of c.products) {
47
+ prod.price = priceFromSKU(prod.sku)
48
+ }
49
+ return c
50
50
  }
@@ -1,14 +1,14 @@
1
- import type { VideoDef } from '@hanzo/ui/types'
2
- import type { Family } from '@hanzo/commerce/types'
3
-
4
- export default (fam: Family, map: Map<string, VideoDef>): Family => {
5
- if (fam.parentTitle) {
6
- for (let prod of fam.products) {
7
- const video = map.get(fam.parentTitle)
8
- if (video) {
9
- prod.video = video
10
- }
11
- }
12
- }
13
- return fam
14
- }
1
+ import type { VideoDef } from '@hanzo/ui/types'
2
+ import type { Family } from '@hanzo/commerce/types'
3
+
4
+ export default (fam: Family, map: Map<string, VideoDef>): Family => {
5
+ if (fam.parentTitle) {
6
+ for (let prod of fam.products) {
7
+ const video = map.get(fam.parentTitle)
8
+ if (video) {
9
+ prod.video = video
10
+ }
11
+ }
12
+ }
13
+ return fam
14
+ }
@@ -1,5 +1,5 @@
1
- import PRICES from './EDIT-ME-bullion-market-prices'
2
-
3
- export default (type_: keyof typeof PRICES): number => (
4
- PRICES[type_].market1oz * (1 - PRICES[type_].discount)
5
- )
1
+ import PRICES from './EDIT-ME-bullion-market-prices'
2
+
3
+ export default (type_: keyof typeof PRICES): number => (
4
+ PRICES[type_].market1oz * (1 - PRICES[type_].discount)
5
+ )
package/commerce/index.ts CHANGED
@@ -1,18 +1,18 @@
1
- import type { VideoDef } from '@hanzo/ui/types'
2
-
3
- import bullionByFamily from './AUTO-GEN-bullion-by-family.json'
4
-
5
- import assignPrices from './assign-prices'
6
- import assignVideosByFamilyGroup from './assign-videos-by-family-group'
7
-
8
- export const getBullionFamilies = (videoMap: Map<string, VideoDef>) => (
9
- bullionByFamily.map(
10
- (fam) => (assignPrices(fam))).map(
11
- (fam) => (assignVideosByFamilyGroup(fam, videoMap)
12
- )
13
- )
14
- )
15
-
16
- export { default as serviceOptions } from './lux-service-options'
17
- export { default as bullionPrice1oz } from './bullion-price-1oz'
18
-
1
+ import type { VideoDef } from '@hanzo/ui/types'
2
+
3
+ import bullionByFamily from './AUTO-GEN-bullion-by-family.json'
4
+
5
+ import assignPrices from './assign-prices'
6
+ import assignVideosByFamilyGroup from './assign-videos-by-family-group'
7
+
8
+ export const getBullionFamilies = (videoMap: Map<string, VideoDef>) => (
9
+ bullionByFamily.map(
10
+ (fam) => (assignPrices(fam))).map(
11
+ (fam) => (assignVideosByFamilyGroup(fam, videoMap)
12
+ )
13
+ )
14
+ )
15
+
16
+ export { default as serviceOptions } from './lux-service-options'
17
+ export { default as bullionPrice1oz } from './bullion-price-1oz'
18
+
@@ -1,6 +1,6 @@
1
- import type { ServiceOptions } from '@hanzo/commerce'
2
-
3
- export default {
4
- dbName: 'lux-commerce',
5
- ordersTable: 'orders'
6
- } satisfies ServiceOptions
1
+ import type { ServiceOptions } from '@hanzo/commerce'
2
+
3
+ export default {
4
+ dbName: 'lux-commerce',
5
+ ordersTable: 'orders'
6
+ } satisfies ServiceOptions
@@ -1,71 +1,71 @@
1
- 'use client'
2
-
3
- import { useState } from 'react'
4
- import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from '@hanzo/ui/primitives'
5
- import { cn } from '@hanzo/ui/util'
6
-
7
- const AccessCodeInput: React.FC<{
8
- onSuccess?: () => void
9
- onFail?: () => void
10
- validCodes?: string[]
11
- className?: string
12
- }> = ({
13
- onSuccess,
14
- onFail,
15
- validCodes,
16
- className
17
- }) => {
18
- const [status, setStatus] = useState<'valid' | 'invalid' | 'checking' | undefined>()
19
-
20
- const checkAccessCode = (code: string) => {
21
- setStatus(undefined)
22
- if (code.length === 6) {
23
- setStatus('checking')
24
- setTimeout(() => {
25
- if (validCodes?.includes(code) && onSuccess) {
26
- setStatus('valid')
27
- onSuccess()
28
- }
29
- else {
30
- setStatus('invalid')
31
- onFail && onFail()
32
- }
33
- }, 1000)
34
- }
35
- }
36
-
37
- return (
38
- <div className={cn('flex flex-col gap-2 mx-auto w-full text-center items-center', className)}>
39
- <InputOTP
40
- className='mx-auto'
41
- maxLength={6}
42
- onInput={(event) => checkAccessCode((event.target as HTMLInputElement).value)}
43
- render={({ slots }) => (
44
- <>
45
- <InputOTPGroup>
46
- {slots.slice(0, 3).map((slot, index) => (
47
- <InputOTPSlot key={index} {...slot} />
48
- ))}{" "}
49
- </InputOTPGroup>
50
- <InputOTPSeparator />
51
- <InputOTPGroup>
52
- {slots.slice(3).map((slot, index) => (
53
- <InputOTPSlot key={index + 3} {...slot} />
54
- ))}
55
- </InputOTPGroup>
56
- </>
57
- )}
58
- />
59
- <p className='h-[3rem]'>
60
- {
61
- status === 'checking' ? 'Checking access code...' :
62
- status === 'invalid' ? <span className='text-destructive'>Invalid access code!</span> :
63
- status === 'valid' ? <span>Access code is valid! Redirecting...</span> :
64
- null
65
- }
66
- </p>
67
- </div>
68
- )
69
- }
70
-
71
- export default AccessCodeInput
1
+ 'use client'
2
+
3
+ import { useState } from 'react'
4
+ import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from '@hanzo/ui/primitives'
5
+ import { cn } from '@hanzo/ui/util'
6
+
7
+ const AccessCodeInput: React.FC<{
8
+ onSuccess?: () => void
9
+ onFail?: () => void
10
+ validCodes?: string[]
11
+ className?: string
12
+ }> = ({
13
+ onSuccess,
14
+ onFail,
15
+ validCodes,
16
+ className
17
+ }) => {
18
+ const [status, setStatus] = useState<'valid' | 'invalid' | 'checking' | undefined>()
19
+
20
+ const checkAccessCode = (code: string) => {
21
+ setStatus(undefined)
22
+ if (code.length === 6) {
23
+ setStatus('checking')
24
+ setTimeout(() => {
25
+ if (validCodes?.includes(code) && onSuccess) {
26
+ setStatus('valid')
27
+ onSuccess()
28
+ }
29
+ else {
30
+ setStatus('invalid')
31
+ onFail && onFail()
32
+ }
33
+ }, 1000)
34
+ }
35
+ }
36
+
37
+ return (
38
+ <div className={cn('flex flex-col gap-2 mx-auto w-full text-center items-center', className)}>
39
+ <InputOTP
40
+ className='mx-auto'
41
+ maxLength={6}
42
+ onInput={(event) => checkAccessCode((event.target as HTMLInputElement).value)}
43
+ render={({ slots }) => (
44
+ <>
45
+ <InputOTPGroup>
46
+ {slots.slice(0, 3).map((slot, index) => (
47
+ <InputOTPSlot key={index} {...slot} />
48
+ ))}{" "}
49
+ </InputOTPGroup>
50
+ <InputOTPSeparator />
51
+ <InputOTPGroup>
52
+ {slots.slice(3).map((slot, index) => (
53
+ <InputOTPSlot key={index + 3} {...slot} />
54
+ ))}
55
+ </InputOTPGroup>
56
+ </>
57
+ )}
58
+ />
59
+ <p className='h-[3rem]'>
60
+ {
61
+ status === 'checking' ? 'Checking access code...' :
62
+ status === 'invalid' ? <span className='text-destructive'>Invalid access code!</span> :
63
+ status === 'valid' ? <span>Access code is valid! Redirecting...</span> :
64
+ null
65
+ }
66
+ </p>
67
+ </div>
68
+ )
69
+ }
70
+
71
+ export default AccessCodeInput
@@ -1,29 +1,29 @@
1
- 'use client'
2
-
3
- import { useEffect } from 'react'
4
- import { useAuth } from '@hanzo/auth/service'
5
- import { getCookie } from 'cookies-next'
6
-
7
- const AuthListener = () => {
8
- const auth = useAuth()
9
-
10
- useEffect(() => {
11
- fetch(`${process.env.NEXT_PUBLIC_LOGIN_SITE_URL}/api/auth/get-auth-token`, {
12
- method: 'GET',
13
- credentials: 'include',
14
- })
15
- .then(response => response.json())
16
- .then((data: any) => {
17
- const token = getCookie('auth-token')
18
- console.log(data)
19
- console.log(token)
20
- if (!!token) {
21
- auth.loginWithCustomToken(token)
22
- }
23
- })
24
- }, [auth])
25
-
26
- return ( <></> )
27
- }
28
-
29
- export default AuthListener
1
+ 'use client'
2
+
3
+ import { useEffect } from 'react'
4
+ import { useAuth } from '@hanzo/auth/service'
5
+ import { getCookie } from 'cookies-next'
6
+
7
+ const AuthListener = () => {
8
+ const auth = useAuth()
9
+
10
+ useEffect(() => {
11
+ fetch(`${process.env.NEXT_PUBLIC_LOGIN_SITE_URL}/api/auth/get-auth-token`, {
12
+ method: 'GET',
13
+ credentials: 'include',
14
+ })
15
+ .then(response => response.json())
16
+ .then((data: any) => {
17
+ const token = getCookie('auth-token')
18
+ console.log(data)
19
+ console.log(token)
20
+ if (!!token) {
21
+ auth.loginWithCustomToken(token)
22
+ }
23
+ })
24
+ }, [auth])
25
+
26
+ return ( <></> )
27
+ }
28
+
29
+ export default AuthListener
@@ -1,12 +1,12 @@
1
- import domains from '../common-auth-domains'
2
-
3
- const ClearAuthToken = () => {
4
- return (<>
5
- {domains.map(({url}) => (
6
- /* Clear auth-token cookie across all Lux domains */
7
- <img src={`${url}/api/auth/clear-auth-token`} className='absolute hidden'/>
8
- ))}
9
- </>)
10
- }
11
-
12
- export default ClearAuthToken
1
+ import domains from '../common-auth-domains'
2
+
3
+ const ClearAuthToken = () => {
4
+ return (<>
5
+ {domains.map(({url}) => (
6
+ /* Clear auth-token cookie across all Lux domains */
7
+ <img src={`${url}/api/auth/clear-auth-token`} className='absolute hidden'/>
8
+ ))}
9
+ </>)
10
+ }
11
+
12
+ export default ClearAuthToken
@@ -1,16 +1,16 @@
1
- import domains from '../common-auth-domains'
2
-
3
- const SetAuthToken: React.FC<{
4
- authToken: string
5
- }> = ({
6
- authToken,
7
- }) => {
8
- return (<>
9
- {!!authToken && domains.map(({url}) => (
10
- /* Set auth-token cookie across all Lux domains */
11
- <img src={`${url}/api/auth/set-auth-token?token=${authToken}`} className='absolute hidden'/>
12
- ))}
13
- </>)
14
- }
15
-
16
- export default SetAuthToken
1
+ import domains from '../common-auth-domains'
2
+
3
+ const SetAuthToken: React.FC<{
4
+ authToken: string
5
+ }> = ({
6
+ authToken,
7
+ }) => {
8
+ return (<>
9
+ {!!authToken && domains.map(({url}) => (
10
+ /* Set auth-token cookie across all Lux domains */
11
+ <img src={`${url}/api/auth/set-auth-token?token=${authToken}`} className='absolute hidden'/>
12
+ ))}
13
+ </>)
14
+ }
15
+
16
+ export default SetAuthToken
@@ -1,16 +1,16 @@
1
- const domains = [
2
- { id: 'lux.market', url: 'https://lux.market' },
3
- { id: 'lux.shop', url: 'https://lux.shop' },
4
- { id: 'lux.credit', url: 'https://lux.credit' },
5
- { id: 'lux.network', url: 'https://lux.network' },
6
- { id: 'wallet.lux.network', url: 'https://wallet.lux.network' },
7
- { id: 'safe.lux.network', url: 'https://safe.lux.network' },
8
- { id: 'lux.finance', url: 'https://lux.finance' },
9
- { id: 'lux.exchange', url: 'https://lux.exchange' },
10
- { id: 'lux.quest', url: 'https://lux.quest' },
11
- { id: 'lux.services', url: 'https://lux.services' },
12
- ]
13
-
14
- export {
15
- domains as default
16
- }
1
+ const domains = [
2
+ { id: 'lux.market', url: 'https://lux.market' },
3
+ { id: 'lux.shop', url: 'https://lux.shop' },
4
+ { id: 'lux.credit', url: 'https://lux.credit' },
5
+ { id: 'lux.network', url: 'https://lux.network' },
6
+ { id: 'wallet.lux.network', url: 'https://wallet.lux.network' },
7
+ { id: 'safe.lux.network', url: 'https://safe.lux.network' },
8
+ { id: 'lux.finance', url: 'https://lux.finance' },
9
+ { id: 'lux.exchange', url: 'https://lux.exchange' },
10
+ { id: 'lux.quest', url: 'https://lux.quest' },
11
+ { id: 'lux.services', url: 'https://lux.services' },
12
+ ]
13
+
14
+ export {
15
+ domains as default
16
+ }