feat: fix next public variable, add google verify

This commit is contained in:
SD 2025-02-14 15:59:26 +04:00
parent 4e849b47a2
commit 28789e9054
8 changed files with 332 additions and 322 deletions

4
.env
View File

@ -2,8 +2,8 @@ NEXT_PUBLIC_SERVER_BASE_URL=https://api.bbuddy.expert/api
NEXT_PUBLIC_AGORA_APPID=ed90c9dc42634e5687d4e2e0766b363f NEXT_PUBLIC_AGORA_APPID=ed90c9dc42634e5687d4e2e0766b363f
NEXT_PUBLIC_GOOGLE_CLIENT_ID=909563069647-03rivr8k1jmirf382bcfehegamthcfg4.apps.googleusercontent.com NEXT_PUBLIC_GOOGLE_CLIENT_ID=909563069647-03rivr8k1jmirf382bcfehegamthcfg4.apps.googleusercontent.com
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_51LVB3LK5pVGxNPeKk4gedt5NW4cb8k7BVXvgOMPTK4x1nnbGTD8BCqDqgInboT6N72YwrTl4tOsVz8rAjbUadX1m00y4Aq5qE8 NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_51LVB3LK5pVGxNPeKk4gedt5NW4cb8k7BVXvgOMPTK4x1nnbGTD8BCqDqgInboT6N72YwrTl4tOsVz8rAjbUadX1m00y4Aq5qE8
STRIPE_SECRET_KEY=sk_test_51LVB3LK5pVGxNPeK6j0wCsPqYMoGfcuwf1LpwGEBsr1dUx4NngukyjYL2oMZer5EOlW3lqnVEPjNDruN0OkUohIf00fWFUHN5O NEXT_PUBLIC_STRIPE_SECRET_KEY=sk_test_51LVB3LK5pVGxNPeK6j0wCsPqYMoGfcuwf1LpwGEBsr1dUx4NngukyjYL2oMZer5EOlW3lqnVEPjNDruN0OkUohIf00fWFUHN5O
STRIPE_PAYMENT_DESCRIPTION='BBuddy services' NEXT_PUBLIC_STRIPE_PAYMENT_DESCRIPTION='BBuddy services'
NEXT_PUBLIC_CONTENTFUL_SPACE_ID = voxpxjq7y7vf NEXT_PUBLIC_CONTENTFUL_SPACE_ID = voxpxjq7y7vf
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN = s99GWKfpDKkNwiEJ3pN7US_tmqsGvDlaex-sOJwpzuc NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN = s99GWKfpDKkNwiEJ3pN7US_tmqsGvDlaex-sOJwpzuc

625
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,7 @@
"contentful": "^10.13.3", "contentful": "^10.13.3",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"next": "14.0.3", "next": "14.2",
"next-intl": "^3.3.1", "next-intl": "^3.3.1",
"react": "^18", "react": "^18",
"react-apple-login": "^1.1.6", "react-apple-login": "^1.1.6",

View File

@ -10,7 +10,10 @@ type RootLayoutProps = {
export const metadata: Metadata = { export const metadata: Metadata = {
title: 'Bbuddy', title: 'Bbuddy',
description: 'Bbuddy' description: 'Bbuddy',
verification: {
google: 'UqmM7WbpuMetvvkMeyVRGKiSvXHEGyaaRuYbWxM-njs'
}
}; };
export default function RootLayout({ children, params: { locale } }: RootLayoutProps) { export default function RootLayout({ children, params: { locale } }: RootLayoutProps) {

View File

@ -19,8 +19,8 @@ type CompProps = {
}; };
export const ChatMessages = ({ locale, groupId }: CompProps) => { export const ChatMessages = ({ locale, groupId }: CompProps) => {
const { newMessage, joinChat, readMessages, addListener } = SignalrConnection();
const [jwt] = useLocalStorage(AUTH_TOKEN_KEY, ''); const [jwt] = useLocalStorage(AUTH_TOKEN_KEY, '');
const { newMessage, joinChat, readMessages, addListener } = SignalrConnection({ jwt });
//const messages = await getChatMessages(locale, jwt, groupId) //const messages = await getChatMessages(locale, jwt, groupId)
const [loading, setLoading] = useState<boolean>(false); const [loading, setLoading] = useState<boolean>(false);
const [text, setText] = useState(''); const [text, setText] = useState('');

View File

@ -38,7 +38,7 @@ export const ExpertCard: FC<ExpertDetailsProps> = ({ expert, locale, expertId })
const isRus = locale === Locale.ru; const isRus = locale === Locale.ru;
const { publicCoachDetails: { tags = [], sessionCost = 0, sessionDuration = 0, coachLanguages = [] , id, botUserId} } = expert || {}; const { publicCoachDetails: { tags = [], sessionCost = 0, sessionDuration = 0, coachLanguages = [] , id, botUserId} } = expert || {};
const [jwt] = useLocalStorage(AUTH_TOKEN_KEY, ''); const [jwt] = useLocalStorage(AUTH_TOKEN_KEY, '');
const { joinChatPerson, closeConnection } = SignalrConnection(); const { joinChatPerson, closeConnection } = SignalrConnection({ jwt });
const router = useRouter(); const router = useRouter();

View File

@ -1,6 +1,6 @@
import { HubConnection, HubConnectionBuilder, LogLevel } from '@microsoft/signalr'; import { HubConnection, HubConnectionBuilder, LogLevel } from '@microsoft/signalr';
import { IHttpConnectionOptions } from "@microsoft/signalr/src/IHttpConnectionOptions"; import { IHttpConnectionOptions } from "@microsoft/signalr/src/IHttpConnectionOptions";
import { AUTH_TOKEN_KEY, BASE_URL } from '../constants/common'; import { BASE_URL } from '../constants/common';
import { IChatMessage } from '../types/chat'; import { IChatMessage } from '../types/chat';
const chatMessageMethodName = 'ReceiveMessage'; const chatMessageMethodName = 'ReceiveMessage';
@ -26,9 +26,9 @@ class SignalConnector {
private connection: HubConnection; private connection: HubConnection;
private events = {} as any; private events = {} as any;
static instance: SignalConnector; static instance: SignalConnector;
constructor() { constructor({ jwt }: { jwt?: string}) {
const options = { const options = {
accessTokenFactory: () => localStorage.getItem(AUTH_TOKEN_KEY) accessTokenFactory: () => jwt
} as IHttpConnectionOptions; } as IHttpConnectionOptions;
this.connection = new HubConnectionBuilder() this.connection = new HubConnectionBuilder()
.withUrl(`${BASE_URL}/hubs/chat`, options) .withUrl(`${BASE_URL}/hubs/chat`, options)
@ -69,9 +69,9 @@ class SignalConnector {
this.connection.invoke(sendChatMessagesSeenMethodName, messagesId).then(x => console.log(sendChatMessagesSeenMethodName, x)) this.connection.invoke(sendChatMessagesSeenMethodName, messagesId).then(x => console.log(sendChatMessagesSeenMethodName, x))
} }
public static getInstance(): SignalConnector { public static getInstance({ jwt }: { jwt?: string }): SignalConnector {
if (!SignalConnector.instance) if (!SignalConnector.instance)
SignalConnector.instance = new SignalConnector(); SignalConnector.instance = new SignalConnector({ jwt });
return SignalConnector.instance; return SignalConnector.instance;
} }
} }

View File

@ -2,7 +2,7 @@ import "server-only";
import Stripe from "stripe"; import Stripe from "stripe";
export const stripe = new Stripe(process.env.STRIPE_SECRET_KEY as string, { export const stripe = new Stripe(process.env.NEXT_PUBLIC_STRIPE_SECRET_KEY as string, {
apiVersion: "2024-06-20", apiVersion: "2024-06-20",
appInfo: { appInfo: {
name: "bbuddy-ui", name: "bbuddy-ui",