Skip to content

Commit

Permalink
Merge branch 'main' of ariane:bosonprotocol/core-components into 819_…
Browse files Browse the repository at this point in the history
…upload_component_fix
  • Loading branch information
AdrianBielecAriane committed Oct 28, 2024
2 parents 61b5497 + f579af3 commit 3a2e4d5
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 94 deletions.
4 changes: 2 additions & 2 deletions e2e/meta-tx-gateway/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meta-tx-gateway",
"version": "1.7.10-alpha.17",
"version": "1.7.10-alpha.18",
"description": "",
"main": "index.js",
"private": true,
Expand All @@ -23,7 +23,7 @@
},
"homepage": "https://github.com/bosonprotocol/core-components#readme",
"dependencies": {
"@bosonprotocol/common": "^1.29.0-alpha.12",
"@bosonprotocol/common": "^1.29.0-alpha.13",
"cors": "^2.8.5",
"dotenv": "^16.0.2",
"ethers": "^5.7.0",
Expand Down
4 changes: 2 additions & 2 deletions e2e/opensea-api-mock/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opensea-api-mock",
"version": "1.0.5-alpha.17",
"version": "1.0.5-alpha.18",
"description": "",
"main": "index.js",
"private": true,
Expand All @@ -23,7 +23,7 @@
},
"homepage": "https://github.com/bosonprotocol/core-components#readme",
"dependencies": {
"@bosonprotocol/common": "^1.29.0-alpha.12",
"@bosonprotocol/common": "^1.29.0-alpha.13",
"@opensea/seaport-js": "^4.0.0",
"cors": "^2.8.5",
"dotenv": "^16.0.2",
Expand Down
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bosonprotocol/common",
"version": "1.29.0-alpha.12",
"version": "1.29.0-alpha.13",
"description": "Common configs, types, interfaces and utilities shared by the core components of the Boson Protocol.",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/core-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bosonprotocol/core-sdk",
"version": "1.41.0-alpha.26",
"version": "1.41.0-alpha.27",
"description": "Facilitates interaction with the contracts and subgraphs of the Boson Protocol",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
Expand Down Expand Up @@ -35,7 +35,7 @@
"access": "public"
},
"dependencies": {
"@bosonprotocol/common": "^1.29.0-alpha.12",
"@bosonprotocol/common": "^1.29.0-alpha.13",
"@ethersproject/abi": "^5.5.0",
"@ethersproject/address": "^5.5.0",
"@ethersproject/bignumber": "^5.5.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/eth-connect-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bosonprotocol/eth-connect-sdk",
"version": "1.7.0-alpha.12",
"version": "1.7.0-alpha.13",
"description": "Implementation of the Web3LibAdapter interface and contract abstractions targeting eth-connect for the Boson Protocol.",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
Expand Down Expand Up @@ -31,7 +31,7 @@
"access": "public"
},
"dependencies": {
"@bosonprotocol/common": "^1.29.0-alpha.12"
"@bosonprotocol/common": "^1.29.0-alpha.13"
},
"devDependencies": {
"eslint": "^8.10.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/ethers-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bosonprotocol/ethers-sdk",
"version": "1.15.0-alpha.12",
"version": "1.15.0-alpha.13",
"description": "Implementation of the Web3LibAdapter interface and contract abstractions targeting ethers for the Boson Protocol.",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
Expand Down Expand Up @@ -32,7 +32,7 @@
"access": "public"
},
"dependencies": {
"@bosonprotocol/common": "^1.29.0-alpha.12"
"@bosonprotocol/common": "^1.29.0-alpha.13"
},
"devDependencies": {
"@typechain/ethers-v5": "^9.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-storage/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bosonprotocol/ipfs-storage",
"version": "1.12.0-alpha.24",
"version": "1.12.0-alpha.25",
"description": "IPFS metadata storage implementation for building on top of the Boson Protocol.",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
Expand Down
8 changes: 4 additions & 4 deletions packages/react-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@bosonprotocol/react-kit",
"description": "React toolkit with smart components and hooks for building on top of the Boson Protocol.",
"version": "0.34.0-alpha.24",
"version": "0.34.0-alpha.25",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/cjs/index.d.ts",
Expand All @@ -15,9 +15,9 @@
"license": "Apache-2.0",
"dependencies": {
"@bosonprotocol/chat-sdk": "^1.3.1-alpha.9",
"@bosonprotocol/core-sdk": "^1.41.0-alpha.26",
"@bosonprotocol/ethers-sdk": "^1.15.0-alpha.12",
"@bosonprotocol/ipfs-storage": "^1.12.0-alpha.24",
"@bosonprotocol/core-sdk": "^1.41.0-alpha.27",
"@bosonprotocol/ethers-sdk": "^1.15.0-alpha.13",
"@bosonprotocol/ipfs-storage": "^1.12.0-alpha.25",
"@davatar/react": "1.11.1",
"@ethersproject/units": "5.6.0",
"@glidejs/glide": "3.6.0",
Expand Down
21 changes: 11 additions & 10 deletions packages/react-kit/src/components/buttons/BaseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ import { Typography } from "../ui/Typography";
import { theme } from "../../theme";
import { Loading } from "../ui/loading/Loading";
import { ButtonSize } from "../ui/buttonSize";

import { AddDollarPrefixToKeys } from "../../types/helpers";
const colors = theme.colors.light;

const ButtonWithThemeProps = styled.button<{
size: ButtonSizeProp;
fill: boolean | undefined;
theme: BaseButtonTheme;
}>`
const ButtonWithThemeProps = styled.button<
AddDollarPrefixToKeys<{
size: ButtonSizeProp;
fill: boolean | undefined;
}> & { theme: BaseButtonTheme }
>`
${() => Styles.button};
${(props) => Styles[props.size as keyof typeof Styles]}
${(props) => Styles[props.$size as keyof typeof Styles]}
border-style: solid;
border-color: ${(props) => props.theme?.borderColor || "transparent"};
border-width: ${(props) => props.theme?.borderWidth || 0}px;
Expand All @@ -35,7 +36,7 @@ const ButtonWithThemeProps = styled.button<{
stroke: ${(props) => props.theme?.color || "#000000"};
}
${(props) =>
props.fill
props.$fill
? css`
width: 100%;
`
Expand Down Expand Up @@ -175,8 +176,8 @@ export const BaseButton = forwardRef<HTMLButtonElement, BaseButtonProps>(
<ButtonWithThemeProps
onClick={onClick}
type={type}
size={size}
fill={fill ? fill : undefined}
$size={size}
$fill={fill ? fill : undefined}
theme={theme}
{...rest}
ref={ref}
Expand Down
26 changes: 15 additions & 11 deletions packages/react-kit/src/components/form/Upload/BaseUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ function BaseUpload({
}
handleLoading(true);
try {
const imagePreview = await loadMedia(fileSrc || "");
if (imagePreview) {
setPreview(imagePreview);
const videoPreview = await loadMedia(fileSrc || "");
if (videoPreview) {
setPreview(videoPreview);
} else {
console.warn(
`imagePreview ${imagePreview} is falsy in loadIpfsImagePreview`
`videoPreview ${videoPreview} is falsy in loadIpfsImagePreview`
);
}
} catch (error) {
Expand Down Expand Up @@ -246,7 +246,7 @@ function BaseUpload({
borderRadius: borderRadius ? `${borderRadius}${borderRadiusUnit}` : "",
width: width ? `100%` : ""
};

const showPreview = field.value && field.value?.length !== 0 && preview;
return (
<>
{withEditor && showEditor && (
Expand Down Expand Up @@ -327,17 +327,21 @@ function BaseUpload({
<Loading size={2} />
) : (
<>
{field.value && field.value?.length !== 0 && preview ? (
{showPreview ? (
<>
{isVideoOnly ? (
<VideoPreview
src={
preview?.startsWith("http")
? preview
: "data:video/mp4;base64," +
preview?.substring(
"data:application/octet-stream;base64,".length
)
: preview?.startsWith(
"data:application/octet-stream;base64,"
)
? "data:video/mp4;base64," +
preview?.substring(
"data:application/octet-stream;base64,".length
)
: preview
}
autoPlay
muted
Expand All @@ -355,7 +359,7 @@ function BaseUpload({
) : (
<Image size={24} />
)}
{placeholder && (
{placeholder && !showPreview && (
<Typography tag="p" marginBottom={0} textAlign="center">
{placeholder}
</Typography>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-kit/src/components/ui/Video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export const Video: React.FC<VideoProps> = ({
return <ComponentWhileLoading />;
}
return (
<VideoWrapper {...rest}>
<VideoWrapper {...rest} className="video-container">
<VideoPlaceholder $position="static">
<Typography tag="div">
<Loading />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,19 @@ const IconBlock = forwardRef<
borderRadius: CSSProperties["borderRadius"];
}
>(function IconBlock(props, ref) {
const { color, backgroundColor, borderRadius } = props;
if ("href" in props) {
const { color, backgroundColor, borderRadius, ...restProps } = props;
return (
<IconBlockLink
ref={ref as React.ForwardedRef<HTMLAnchorElement>}
$color={color}
$backgroundColor={backgroundColor}
$borderRadius={borderRadius}
{...props}
{...restProps}
/>
);
}

const { color, backgroundColor, borderRadius, ...restProps } = props;
return (
<IconBlockButton
// ignoring 'button' 'type' conflict between React and styled-components
Expand All @@ -134,7 +134,7 @@ const IconBlock = forwardRef<
$color={color}
$backgroundColor={backgroundColor}
$borderRadius={borderRadius}
{...props}
{...restProps}
/>
);
});
Expand Down
Loading

0 comments on commit 3a2e4d5

Please sign in to comment.