Skip to content

Conversation

myjeong19
Copy link
Member

Description of Changes

Here is reference: #25


support 'toggle' block

Review point

-> I made the Toggle Button customizable.
-> I made the toggle button icon rotate when the toggle is opened.
-> I suggest passing separate props instead of using children as an approach to resolve issue #88

To reproduce

  • npm run story:start
  • click 'your created block' on the Storybook left side panel

Screenshot

스크린샷 2024-11-02 23 58 42

스크린샷 2024-11-02 23 58 49

Review Guide

Reviews are conducted based on priority levels, such as p0, p1, p2, p3, p4, and p5.
p0 ~ p2: If the author decides not to reflect a review for p0 to p2, it signals that a proper discussion with the reviewer is
necessary. It is expected that the review will be resolved either through incorporating the feedback or through further discussion.
p3: indicates that the reviewer has identified a significant issue, but either lacks a clear solution or the comment lacks sufficient context. Further explanation or additional discussion on the reviewer's concerns is needed.
p4, p5: p4 and p5 suggest low priority, and if the author does not deem them important, these comments can be disregarded.

@@ -1,4 +1,4 @@
import { Notion, type Block } from "@notionpresso/react";
Copy link
Contributor

Choose a reason for hiding this comment

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

p1: don't import with relative path

it is mono repo

see: workspace property on root package.json

Copy link
Member Author

Choose a reason for hiding this comment

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

I have resolved this issue.

import json from "./todo.json";
import { Todo, TodoArgs } from "@notionpresso/react";
import { Todo } from "../../../../core/src/lib";
import { TodoArgs } from "../../../../core/src/lib";
Copy link
Contributor

Choose a reason for hiding this comment

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

p1: don't import with relative path

it is mono repo

see: workspace property on root package.json

Copy link
Member Author

Choose a reason for hiding this comment

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

I have resolved this issue.

import json from "./toggle.json";

import { Toggle } from "../../../../core/src/lib";
import type { ToggleArgs } from "../../../../core/src/lib";
Copy link
Contributor

Choose a reason for hiding this comment

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

p1: don't import with relative path

it is mono repo

see: workspace property on root package.json

Copy link
Member Author

Choose a reason for hiding this comment

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

I have resolved this issue.

@Moon-DaeSeung
Copy link
Contributor

and It's new feature, you should mention FEAT not REFACTOR

@myjeong19 myjeong19 changed the title Refactor. Custom Toggle Feat. Custom Toggle Nov 5, 2024
import Component from "../../lib/Notion";
import json from "./todo.json";
import { Todo, TodoArgs } from "@notionpresso/react";
import { Todo } from "@notionpresso/react";
Copy link
Contributor

Choose a reason for hiding this comment

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

p3: unneccessary change

<Toggle.Icon>
<div
style={{
width: "10px",
Copy link
Contributor

Choose a reason for hiding this comment

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

p1: this toggle is not interactive

you should fix it

Copy link
Member Author

Choose a reason for hiding this comment

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

In response to "p1: this toggle is not interactive; you should fix it," are we referring only to the custom toggle, or does this apply to all toggle icons?

});

if (!iconElement) {
iconElement = <div className="notion-toggle-button-arrow" />;
Copy link
Contributor

Choose a reason for hiding this comment

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

p3: you just declare default iconElement on

let iconElement = {{ default }} // instead of assigning null

/>
className={`${open ? "notion-toggle-button-opened" : "notion-toggle-button-closed"}`}
>
{iconElement}
Copy link
Contributor

Choose a reason for hiding this comment

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

p3: dont iconElement inside it

iconElement should contains <div className={`${open ... }} />

custom icon can define its ui on opened or closed.

but It depends on 'notion-toggle-button-opened' css

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. In response to "custom icon can define its UI on opened or closed"
    does that mean it should accept two children—one for the open state and one for the closed state?

  2. For the default Notion toggle, there is a rotation animation based on the open/closed state, and I would like to maintain the current structure for the default toggle. Is that okay?

@Moon-DaeSeung
Copy link
Contributor

p1: you should explain your works more detail on pr title

@Moon-DaeSeung
Copy link
Contributor

p1: you should answer all review (you just changed code not answering review or question)

@myjeong19 myjeong19 changed the title Feat. Custom Toggle Feat. Users can freely customize the toggle icon. Nov 11, 2024
@Moon-DaeSeung Moon-DaeSeung merged commit f06eeba into main Nov 29, 2024
@Moon-DaeSeung Moon-DaeSeung deleted the refactor/toggle branch November 29, 2024 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants