Skip to content

Commit 71de0ff

Browse files
author
Egor Didenko
committed
feat: updated getUserAgentIntegration
1 parent a840e90 commit 71de0ff

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

packages/react-uploader/src/Uploader/Inline/FileUploaderInline.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { AdapterUploadCtxProvider } from "../core/AdapterUploadCtxProvider";
66
import type { TProps } from "../types";
77
import { getStyleSource } from "../default";
88
import { getCalcPropertyOfProps } from "../../utils/getCalcPropertyOfProps";
9-
import { getUserAgentIntegration } from "../../utils/getUserAgentIntegration";
9+
import { getUserAgentIntegration } from "../../utils/getUserAgentIntegration.ts";
1010

1111
LR.registerBlocks(LR);
1212

@@ -33,7 +33,7 @@ export const FileUploaderInline: FC<TProps> = ({
3333
return (
3434
<div className={className}>
3535
{/* @ts-ignore */}
36-
<AdapterConfig userAgentIntegration={getUserAgentIntegration(config.pubkey)} ctx-name={CTX_NAME} {...config} />
36+
<AdapterConfig userAgentIntegration={getUserAgentIntegration()} ctx-name={CTX_NAME} {...config} />
3737
{/* @ts-ignore */}
3838
<AdapterUploadCtxProvider
3939
ref={refUploadCtxProvider}

packages/react-uploader/src/Uploader/Minimal/FileUploaderMinimal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { AdapterUploadCtxProvider } from "../core/AdapterUploadCtxProvider";
66
import type { TProps } from "../types";
77
import { getStyleSource } from "../default";
88
import { getCalcPropertyOfProps } from "../../utils/getCalcPropertyOfProps";
9-
import { getUserAgentIntegration } from "../../utils/getUserAgentIntegration";
9+
import { getUserAgentIntegration } from "../../utils/getUserAgentIntegration.ts";
1010

1111
LR.registerBlocks(LR);
1212

@@ -34,7 +34,7 @@ export const FileUploaderMinimal: FC<TProps> = ({
3434
return (
3535
<div className={className}>
3636
{/* @ts-ignore */}
37-
<AdapterConfig userAgentIntegration={getUserAgentIntegration(config.pubkey)} ctx-name={CTX_NAME} {...config} />
37+
<AdapterConfig userAgentIntegration={getUserAgentIntegration()} ctx-name={CTX_NAME} {...config} />
3838
{/* @ts-ignore */}
3939
<AdapterUploadCtxProvider
4040
ref={refUploadCtxProvider}

packages/react-uploader/src/Uploader/Regular/FileUploaderRegular.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { getStyleSource } from "../default";
77
import type { TProps } from "../types";
88

99
import { getCalcPropertyOfProps } from "../../utils/getCalcPropertyOfProps";
10-
import { getUserAgentIntegration } from "../../utils/getUserAgentIntegration";
10+
import { getUserAgentIntegration } from "../../utils/getUserAgentIntegration.ts";
1111

1212
LR.registerBlocks(LR);
1313

@@ -35,7 +35,7 @@ export const FileUploaderRegular: FC<TProps> = ({
3535
return (
3636
<div className={className}>
3737
{/* @ts-ignore */}
38-
<AdapterConfig userAgentIntegration={getUserAgentIntegration(config.pubkey)} ctx-name={CTX_NAME} {...config}/>
38+
<AdapterConfig userAgentIntegration={getUserAgentIntegration()} ctx-name={CTX_NAME} {...config} />
3939
{/* @ts-ignore */}
4040
<AdapterUploadCtxProvider
4141
ref={refUploadCtxProvider}
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { version, name } from "../../package.json";
1+
import { version } from "../../package.json";
22

3-
export const getUserAgentIntegration = (pubkey: string) => {
4-
return `${name}/${version}/${pubkey} (JavaScript; React;)`;
3+
const NAME_EXTENTION = "React-Uploader";
4+
5+
export const getUserAgentIntegration = () => {
6+
return `${NAME_EXTENTION}/${version}`;
57
};

0 commit comments

Comments
 (0)