@luxfi/ui 5.5.1 → 5.5.3

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.
@@ -14,12 +14,15 @@ import { Loader2 } from 'lucide-react'
14
14
  import {
15
15
  Button,
16
16
  Input,
17
+ } from '@hanzo/ui/primitives'
18
+
19
+ import {
17
20
  Form,
18
21
  FormControl,
19
22
  FormField,
20
23
  FormItem,
21
24
  FormMessage,
22
- } from '@hanzo/ui/primitives'
25
+ } from '@hanzo/ui/form'
23
26
 
24
27
  import type { SubmitServerAction } from '@hanzo/ui/types'
25
28
  import type { ContactInfo } from '../../types'
@@ -1,8 +1,8 @@
1
1
  'use client'
2
-
2
+ import React, { useEffect, useState } from 'react'
3
3
  import { usePathname } from 'next/navigation'
4
4
  import Script from 'next/script'
5
- import { useEffect, useState } from 'react'
5
+
6
6
  import * as fbq from './fpixel'
7
7
 
8
8
  const FacebookPixelHead = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxfi/ui",
3
- "version": "5.5.1",
3
+ "version": "5.5.3",
4
4
  "description": "Library that contains shared UI primitives, support for a common design system, and other boilerplate support.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -29,7 +29,6 @@
29
29
  ".": "./components/index.ts",
30
30
  "./commerce": "./commerce/ui/context.tsx",
31
31
  "./root-layout": "./root-layout/index.tsx",
32
- "./server-actions": "./server-actions/index.ts",
33
32
  "./next": "./next/index.ts",
34
33
  "./style/": "./style/",
35
34
  "./site-def": "./site-def/index.ts",
@@ -3,7 +3,6 @@ import type { Viewport } from 'next'
3
3
 
4
4
  import { Toaster } from '@hanzo/ui/primitives'
5
5
  import { AuthServiceProvider } from '@hanzo/auth/service'
6
- import { getUserServerSide } from '@hanzo/auth/server'
7
6
  import type { AuthServiceConf } from '@hanzo/auth/types'
8
7
  import { CommerceProvider } from '@hanzo/commerce'
9
8
 
@@ -47,7 +46,7 @@ const bodyClasses =
47
46
  'bg-background text-foreground flex flex-col min-h-full ' +
48
47
  getAppRouterBodyFontClasses()
49
48
 
50
- async function RootLayout({
49
+ function RootLayout({
51
50
  showHeader = false,
52
51
  chatbot = false,
53
52
  siteDef,
@@ -58,7 +57,9 @@ async function RootLayout({
58
57
  chatbot?: boolean
59
58
  } & PropsWithChildren) {
60
59
 
61
- const currentUser = await getUserServerSide()
60
+ // For static export, we don't have server-side auth
61
+ // User auth will be handled client-side via AuthListener
62
+ const currentUser = null
62
63
 
63
64
  const Guts: React.FC = () => (<>
64
65
  {showHeader && <Header siteDef={siteDef}/>}
@@ -83,7 +84,7 @@ async function RootLayout({
83
84
  <body suppressHydrationWarning className={bodyClasses} style={{
84
85
 
85
86
  // As noted above: 'overflow: hidden' on the <body> tag breaks scroll snap!
86
- display: 'none', // see analytics.tsx
87
+ display: 'none', // see analytics.tsx
87
88
  }}>
88
89
  <Analytics/>
89
90
  <AuthServiceProvider user={currentUser} conf={{} as AuthServiceConf}>
@@ -103,7 +104,7 @@ async function RootLayout({
103
104
  </body>
104
105
  </html>
105
106
  )
106
- }
107
+ }
107
108
 
108
109
  export {
109
110
  RootLayout,
@@ -1 +0,0 @@
1
- move login and logout api routes here!
@@ -1,14 +0,0 @@
1
- import { initializeApp, getApps } from 'firebase/app'
2
-
3
- const firebaseConfig = {
4
- apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
5
- authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN,
6
- projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
7
- storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET,
8
- messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
9
- appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID,
10
- measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID,
11
- }
12
-
13
- // Initialize Firebase instance if there isn't one already
14
- export default getApps().length === 0 ? initializeApp(firebaseConfig) : getApps()[0]
@@ -1,5 +0,0 @@
1
- import storeContact from './store-contact'
2
-
3
- export {
4
- storeContact as default
5
- }
@@ -1,51 +0,0 @@
1
- 'use server'
2
-
3
- import {
4
- getFirestore,
5
- collection,
6
- setDoc,
7
- doc,
8
- serverTimestamp,
9
- type Firestore,
10
- } from 'firebase/firestore'
11
-
12
- import firebaseApp from './firebase-app'
13
- import type { ContactInfo } from '../types'
14
-
15
- let dbInstance: Firestore | undefined = undefined
16
-
17
- const getDBInstance = (name: string): Firestore => {
18
- if (!dbInstance) {
19
- dbInstance = getFirestore(firebaseApp, name)
20
- }
21
- return dbInstance
22
- }
23
-
24
- const storeContact = async ( formData: ContactInfo, enclosure: any ) => {
25
- const email = formData.email
26
- const phone = formData.phone
27
- const dbName = enclosure?.dbId
28
- const tableName = enclosure?.listId
29
-
30
- let error: any | null = null
31
- const tableRef = collection(getDBInstance(dbName), tableName)
32
-
33
- try {
34
- await setDoc(doc(tableRef, email), {
35
- email,
36
- phone,
37
- timestamp: serverTimestamp(),
38
- })
39
- return { success: !error, error, id: email }
40
- }
41
- catch (e) {
42
- console.error('Error writing contact info to database: ', e)
43
- error = e
44
- }
45
-
46
- return { success: !error, error }
47
- }
48
-
49
- export {
50
- storeContact as default
51
- }