Compare commits

...

2 Commits

Author SHA1 Message Date
SD fc743dbb7d 0.3.2 2025-02-14 16:00:14 +04:00
SD 28789e9054 feat: fix next public variable, add google verify 2025-02-14 15:59:26 +04:00
8 changed files with 335 additions and 325 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_GOOGLE_CLIENT_ID=909563069647-03rivr8k1jmirf382bcfehegamthcfg4.apps.googleusercontent.com
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_51LVB3LK5pVGxNPeKk4gedt5NW4cb8k7BVXvgOMPTK4x1nnbGTD8BCqDqgInboT6N72YwrTl4tOsVz8rAjbUadX1m00y4Aq5qE8
STRIPE_SECRET_KEY=sk_test_51LVB3LK5pVGxNPeK6j0wCsPqYMoGfcuwf1LpwGEBsr1dUx4NngukyjYL2oMZer5EOlW3lqnVEPjNDruN0OkUohIf00fWFUHN5O
STRIPE_PAYMENT_DESCRIPTION='BBuddy services'
NEXT_PUBLIC_STRIPE_SECRET_KEY=sk_test_51LVB3LK5pVGxNPeK6j0wCsPqYMoGfcuwf1LpwGEBsr1dUx4NngukyjYL2oMZer5EOlW3lqnVEPjNDruN0OkUohIf00fWFUHN5O
NEXT_PUBLIC_STRIPE_PAYMENT_DESCRIPTION='BBuddy services'
NEXT_PUBLIC_CONTENTFUL_SPACE_ID = voxpxjq7y7vf
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN = s99GWKfpDKkNwiEJ3pN7US_tmqsGvDlaex-sOJwpzuc

629
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "bbuddy-ui",
"version": "0.3.1",
"version": "0.3.2",
"private": true,
"scripts": {
"dev": "next dev -p 4200",
@ -26,7 +26,7 @@
"contentful": "^10.13.3",
"dayjs": "^1.11.10",
"lodash": "^4.17.21",
"next": "14.0.3",
"next": "14.2",
"next-intl": "^3.3.1",
"react": "^18",
"react-apple-login": "^1.1.6",

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
import { HubConnection, HubConnectionBuilder, LogLevel } from '@microsoft/signalr';
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';
const chatMessageMethodName = 'ReceiveMessage';
@ -24,11 +24,11 @@ const chatsReceiveMessageMethodName = 'ChatsMessageCreated';
class SignalConnector {
private connection: HubConnection;
private events ={} as any;
private events = {} as any;
static instance: SignalConnector;
constructor() {
constructor({ jwt }: { jwt?: string}) {
const options = {
accessTokenFactory: () => localStorage.getItem(AUTH_TOKEN_KEY)
accessTokenFactory: () => jwt
} as IHttpConnectionOptions;
this.connection = new HubConnectionBuilder()
.withUrl(`${BASE_URL}/hubs/chat`, options)
@ -69,9 +69,9 @@ class SignalConnector {
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)
SignalConnector.instance = new SignalConnector();
SignalConnector.instance = new SignalConnector({ jwt });
return SignalConnector.instance;
}
}

View File

@ -2,7 +2,7 @@ import "server-only";
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",
appInfo: {
name: "bbuddy-ui",