Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expandable content -block #1305

Merged
merged 20 commits into from
Oct 17, 2024
Merged

Expandable content -block #1305

merged 20 commits into from
Oct 17, 2024

Conversation

Maijjay
Copy link
Contributor

@Maijjay Maijjay commented Sep 2, 2024

No description provided.

Copy link
Member

@nygrenh nygrenh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lock the main blocks and add templateLock={false} to the inner inner blocks.

editing={false}
selectedBlockId={null}
setEdits={function (): void {
throw new Error("Function not implemented.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out if this crashes the frontend

const InnerCardBlock: React.FC<React.PropsWithChildren<BlockRendererProps<FlipCardAttributes>>> = (
props,
) => {
if (isBlockImage(props.data.innerBlocks[0]) && props.data.innerBlocks.length == 1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment for explaining the if

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it crash if innerblocks is empty?

transition: transform 0.8s;
transform-style: preserve-3d;
${frontSideUp ? "transform: rotateY(180deg);" : "transform: rotateY(0);"}
${currentIsImage ? "" : "border: 3px solid #bfbec6"};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
${currentIsImage ? "" : "border: 3px solid #bfbec6"};
${!currentIsImage && "border: 3px solid #bfbec6;"}

const frontCard = props.data.innerBlocks[0] as Block<FlipCardAttributes>
const backCard = props.data.innerBlocks[1] as Block<FlipCardAttributes>

let size = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a function in this file sizeStringToSizePx

const { t } = useTranslation()
const frontCard = props.data.innerBlocks[0] as Block<FlipCardAttributes>
const backCard = props.data.innerBlocks[1] as Block<FlipCardAttributes>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if frontCard and backcard are defined and return an error banner if they are not.

@@ -0,0 +1,56 @@
/* eslint-disable i18next/no-literal-string */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to ignore the whole file

@nygrenh nygrenh merged commit 5861eb0 into master Oct 17, 2024
17 checks passed
@nygrenh nygrenh deleted the expandable-content-block branch October 17, 2024 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants