Skip to content

Commit

Permalink
fix(blockcontainer): disable SFBWrapper when not editing
Browse files Browse the repository at this point in the history
  • Loading branch information
schettn authored Sep 9, 2021
1 parent 3b90caa commit a171b96
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 23 deletions.
2 changes: 1 addition & 1 deletion examples/my-gatsby-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@emotion/react": "^11",
"@emotion/styled": "^11",
"@snek-at/jaen": "^2.0.0-beta.13",
"@snek-at/jaen-pages": "^2.0.0-beta.22",
"@snek-at/jaen-pages": "^2.0.0-beta.23",
"framer-motion": "^4",
"gatsby": "^3.11.1",
"gatsby-plugin-emotion": "^6.11.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/jaen-pages/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@snek-at/jaen-pages",
"version": "2.0.0-beta.22",
"version": "2.0.0-beta.23",
"main": "src/index.js",
"types": "src/index.tsx",
"license": "EUPL-1.2",
Expand Down
8 changes: 8 additions & 0 deletions packages/jaen-pages/src/containers/blocks/BlockItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ type BlockItemProps = {

const BlockItem = React.memo<BlockItemProps>(
({children, BlockComponent, isEditing, onDelete, ...blockProps}) => {
if (!isEditing) {
return (
<BlockProvider {...blockProps}>
<BlockComponent />
</BlockProvider>
)
}

return (
<BlockProvider {...blockProps}>
<SFBWrapper onDeleteClick={() => onDelete(blockProps.position)}>
Expand Down
21 changes: 0 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5021,27 +5021,6 @@
"@chakra-ui/react" "^1.6.6"
gatsby "^3.12.0"

"@snek-at/jaen-shared-ui@2.0.0-beta.7":
version "2.0.0-beta.7"
resolved "https://registry.yarnpkg.com/@snek-at/jaen-shared-ui/-/jaen-shared-ui-2.0.0-beta.7.tgz#be466cb876e5aa22aa65ab1374cbcd8c200c9e0a"
integrity sha512-uw4S2kwxjqcq7EaavWFFADeJFSIJt/wPRG9lJpfYbys7F1m+3pliDw+g/AduX8ZbhlUEX8uEPomaqOfvniFFlQ==
dependencies:
"@atlaskit/tree" "^8.4.0"
"@chakra-ui/icons" "^1.0.15"
"@chakra-ui/react" "^1.6.6"
"@emotion/react" "^11"
"@emotion/styled" "^11"
"@fortawesome/fontawesome-svg-core" "^1.2.36"
"@fortawesome/free-regular-svg-icons" "^5.15.4"
"@fortawesome/react-fontawesome" "^0.1.15"
"@react-icons/all-files" "^4.1.0"
"@snek-at/react-lottie" "1.0.0-beta.3"
"@snek-at/snek-finder" "1.0.0-beta.11"
framer-motion "^4.1.17"
react "^17.0.2"
react-analytics-charts "^1.2.12"
react-use-analytics-api "^1.4.16"

"@snek-at/react-lottie@1.0.0-beta.3":
version "1.0.0-beta.3"
resolved "https://registry.yarnpkg.com/@snek-at/react-lottie/-/react-lottie-1.0.0-beta.3.tgz#e2200b4bee31247cecaa9d8c9170207d8ff8b5ae"
Expand Down

0 comments on commit a171b96

Please sign in to comment.