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

New Channel Creation Flow #1710

Conversation

abhishek-01k
Copy link
Collaborator

@abhishek-01k abhishek-01k commented Jul 10, 2024

Pull Request Template

Ticket Number

#1703

Description

  • Problem/Feature:

Type of Change

  • Bug fix
  • New feature
  • Code refactor
  • Documentation update
  • Other (please describe):

Checklist

  • Quick PR: Is this a quick PR? Can be approved before finishing a coffee.
    • Quick PR label added
  • Not Merge Ready: Is this PR dependent on some other PR/tasks and not ready to be merged right now.
    • DO NOT Merge PR label added

Frontend Guidelines

Build & Testing

  • No errors in the build terminal
  • Engineer has tested the changes on their local environment
  • Engineer has tested the changes on deploy preview

Screenshots/Video with Explanation

Figma link -> https://www.figma.com/design/FvJL0JWHlsVohsHTERB1Lh/Push-Design-Foundations-[Future]?node-id=5178-35807&m=dev

Additional Context

Review & Approvals

  • Self-review completed
  • Code review by at least one other engineer
  • Documentation updates if applicable

Notes

Things that are left:

  • About the website URL, rn it checks for https and www. But we need to talk with backend to update the url and then the user will be allowed to pass just url.org or url.com
  • Loader while the channel is getting created.
  • Pull the main and then change the theming based on new theme
  • Landing page when the chain is different.

@abhishek-01k abhishek-01k self-assigned this Jul 10, 2024
@abhishek-01k abhishek-01k added the DO NOT MERGE If the PR/task is dependent on some other task add this label to the PR. label Jul 10, 2024
Copy link

github-actions bot commented Jul 10, 2024

PR Preview Action v1.4.7
🚀 Deployed preview to https://push-protocol.github.io/push-dapp/pr-preview/pr-1710/
on branch gh-pages at 2024-07-12 10:24 UTC

Copy link

I found some issues in the code:

  1. In src/App.tsx:
  • In the CSS part, the closing curly brace for HeaderContainer is missing. Add } after setting the z-index property.
  • In the extendConsole function, there are syntax errors. The closing curly brace for the inner window.console[level] if block is missing. Also, there is a missing closing curly brace for the outer window.console[level] if block.
  • In the disable console logic, the second 'if' statement should be removed as it is redundant.
  1. In src/blocks/icons/components/CloudUpload.tsx:
  • It seems like the SVG paths are not properly formatted. Check the paths and make sure they are correct.
  1. In src/blocks/textInput/TextInput.tsx:
  • The closing tag for the Text component just before the errorMessage block is missing. Add </Text> before the errorMessage block.
  • The color prop is not correctly placed in the Text component inside the errorMessage block. Move it inside the component props.

Apart from these issues, the code seems well-structured and clear.

Kindly address the mentioned issues.

Copy link

I will review the code now.

Copy link

File: src/App.tsx

  1. In the CSS section, there is a mix of different types of comments (//, /* */). It's better to stick with one style of commenting throughout the file for consistency.

  2. In the extendConsole function, there is a missing closing curly brace after the condition checking for window.console[level].

  3. In the extendConsole function, there is a missing closing curly brace for the disabledConsoles[level] condition.

  4. In the App component, the closing </SpacesUIProvider> tag seems to be missing its closing curly brace.

Overall, the code structure seems fine and the logic looks good.

All looks good.

File: src/blocks/icons/components/CloudUpload.tsx

  1. In the SVG path details, there are multiple different path elements, but they are not properly wrapped inside <path> tags.

  2. The stroke-width attribute should be in camelCase as strokeWidth.

  3. Make sure to provide proper values for all the SVG paths and attributes to render the icon correctly.

  4. The CloudUpload component seems to be missing some closing braces at the end of the file.

Consider fixing the SVG path details and the missing closing braces.

File: src/blocks/textInput/TextInput.tsx

  1. In the StyledTextInput component, there are some formatting issues with the closing tags of JSX elements. Make sure all opening tags have proper closing tags.

  2. In the JSX structure, the closing </Text> tag is missing just before the errorMessage block.

  3. The errorMessage block should be wrapped properly inside a <div> or another appropriate JSX container element.

Overall, the TextInput component structure seems correct, but there are formatting issues and missing closing tags that need to be fixed.

Consider fixing the formatting issues and missing closing tags.

All other files were not provided in this review. If you need further reviews of those files, please provide them.

Copy link

I found some issues in the code:

  1. In src/App.tsx:
  • There is an unclosed block in the extendConsole function. The closing brace after the line disabledConsoles[level] = window.console[level]; is missing.
  • The ParentContainer component is missing the closing brace after the justify-content: center; property.
  • The background property in the styled component HeaderContainer is missing the closing parenthesis.
  • There seems to be some misplaced code related to custom styling options for a component. It might need refactoring or moving to the appropriate place.
  1. In src/blocks/icons/components/CloudUpload.tsx:
  • The <path> elements inside the <svg> tag are not properly formatted. They seem to be mixed together and should be separated with individual <path> tags.
  1. In src/blocks/textInput/TextInput.tsx:
  • The closing tags for the <Text> component inside the label and totalCount are missing.
  • The <Text> component for errorMessage is missing the opening tag and doesn't have proper syntax.
  1. In src/config/AppPaths.ts:
  • The enum definition for paths is incomplete; there is a missing closing brace.

Please review and correct these issues.

All looks good.

Copy link

There are a few issues in the code review:

File: src/App.tsx

  • Line 39: There is a missing closing curly brace } for the window.console[level] === null condition.

File: src/blocks/icons/components/CloudUpload.tsx

  • Line 43, 45: The paths are not valid. They should be enclosed in <path> tags.

File: src/blocks/textInput/TextInput.tsx

  • Line 113: The closing </Text> tag is missing for the totalCount block.
  • Line 125: The closing </div> tag is missing for the label-count block.
  • Line 139: The closing </Text> tag is missing for the description block.
  • Line 145: The closing </Text> tag is missing for the errorMessage block.
  • Line 148-149: The {errorMessage} should be inside a <Text> component.

Apart from these issues, the code seems to be structured and organized properly.

All looks good.

Copy link

It seems like there are some syntax errors and formatting issues in the code provided. Here are the mistakes found:

  1. In "App.tsx":

    • There is a missing closing brace } after defining window.console[level] function inside the console.enable function.
    • The closing tag </SpacesUIProvider> is missing inside the ContentContainer.
    • In the HeaderContainer styled component, the const keyword is missing before the component definition.
  2. In "CloudUpload.tsx":

    • Invalid SVG paths with missing <path> tags and incorrect properties.
    • The closing </IconWrapper> tag is missing at the end.
  3. In "TextInput.tsx":

    • The closing tag for the outermost div container inside the StyledTextInput is missing.
    • The Text component is not properly closed after errorMessage condition.

Other files have been provided but have not been checked due to their length.

Please correct the identified issues above and ensure the structure and syntax of the code is proper. Let me know if you need further assistance with any other file.

Copy link

There are a few issues in the provided code:

In src/App.tsx:

  1. There is a typo in the useState hook declaration. It should be setcurrentTime instead of setcurrentTime.
  2. In the styled-components section, the HeaderContainer styling is missing the closing curly brace '}' at the end.
  3. In the styled-components section, the ParentContainer styling is missing the closing curly brace '}' at the end.

In src/blocks/icons/components/CloudUpload.tsx:

  1. The <path> elements for 'd' attributes are not correctly formatted. The attributes should be enclosed in a single <path> element.
  2. The stroke-width attribute should be strokeWidth.

In src/blocks/textInput/TextInput.tsx:

  1. The closing tags for <Text>, <div>, and <StyledTextInput> components are not in the correct order. The <Text> component closing tags are missing.
  2. There is a typo in the closing tag of the <Text> component within the label-count section. It should be </Text> instead of <Text>.
  3. The error message section is not properly enclosed within the <Text> component.

In src/modules/createChannel/CreateChannel.constants.ts:

  1. The CreateChannelSteps array has missing properties for the objects.

After fixing the above issues, the code should be reviewed thoroughly in terms of logic and functionality.

All other files mentioned seem to be empty or not provided, so they cannot be reviewed.

Please make the necessary corrections based on the identified issues.

@abhishek-01k abhishek-01k changed the base branch from main to Feat-New-Channel-Creation-Flow July 12, 2024 10:31
Copy link
Collaborator

@mishramonalisha76 mishramonalisha76 left a comment

Choose a reason for hiding this comment

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

image the casing is not as figma image The color of drag and drop text is not correct image Spelling of amount is wrong, check casing too. Copy exact text from figma image Failure in channel creation keeps showing this page and no errors are shown.

Also after channel creation screen gets stuck in loading details . Is it expected ?

@abhishek-01k abhishek-01k removed the DO NOT MERGE If the PR/task is dependent on some other task add this label to the PR. label Jul 16, 2024
src/modules/createChannel/CreateChannel.tsx Outdated Show resolved Hide resolved
src/modules/createChannel/CreateChannel.tsx Outdated Show resolved Hide resolved
src/modules/createChannel/CreateChannel.tsx Outdated Show resolved Hide resolved
src/modules/createChannel/CreateChannel.tsx Outdated Show resolved Hide resolved
src/modules/createChannel/CreateChannel.tsx Show resolved Hide resolved
src/modules/createChannel/CreateChannel.tsx Show resolved Hide resolved
src/modules/createChannel/CreateChannel.tsx Outdated Show resolved Hide resolved
setActiveStepKey: (key: ActiveStepKey) => void;
}

const channelInfoValidationSchema = Yup.object().shape({
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rohitmalhotra1420 Here you can see I have implemented the Yup validations. for the channel Info form

src/modules/createChannel/CreateChannel.constants.ts Outdated Show resolved Hide resolved
src/modules/createChannel/CreateChannel.form.ts Outdated Show resolved Hide resolved
Comment on lines 21 to 49
export const createChannelInfoForm = ({ handleNextStep, setActiveStepKey }: FormikProps) =>
useFormik<ChannelInfoFormValues>({
initialValues: {
channelName: '',
channelDesc: '',
channelURL: '',
},
validationSchema: channelInfoValidationSchema,
onSubmit: (values) => {
handleNextStep('upload_logo');
setActiveStepKey('upload_logo');
},
});

const logoValidationSchema = Yup.object().shape({
image: Yup.mixed().required('Image is required'),
});

export const uploadLogoForm = () =>
useFormik({
initialValues: {
image: null,
imageSrc: '',
imageType: '',
},
validationSchema: logoValidationSchema,
onSubmit: (values) => {
// Handle form submission logic here
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

We will not use 2 separate forms for this. The form is one and it is divided into two steps.

We will create a formik provider in this file with a custom hook to use the form values in different components.
Checkout this PR for reference: #1723

}

const UploadLogo: FC<UploadLogoProps> = () => {
const UploadLogo: FC<UploadLogoProps> = ({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const UploadLogo: FC<UploadLogoProps> = ({
const UploadChannelLogo: FC<UploadLogoProps> = ({

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also change the file name

Upload a PNG, JPG upto 1MB. Crop the image to resize to 128px.
</Text>

<form onSubmit={uploadLogoFormik.handleSubmit}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This whole form component will be a separate component called upload file and will live under blocks/FileUpload.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also check the props here: https://ant.design/components/upload

src/modules/createChannel/components/StakeFees.tsx Outdated Show resolved Hide resolved
type CreateChannelErrorProp = {
channelCreationError: ChannelCreationError;
}
const CreateChannelError: FC<CreateChannelErrorProp> = ({
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will be a design system component and goes to blocks/Alert. For now you can only implement the error variant.

Assign a ticket to @rohitmalhotra1420 for implementing all other variants.

src/modules/createChannel/CreateChannel.utils.ts Outdated Show resolved Hide resolved
Comment on lines 10 to 11
hidden?: boolean;
id: string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't think we need these two props

Copy link
Collaborator

Choose a reason for hiding this comment

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

input will be hidden all the time

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need id because we are adding a label in the children . Because with this id only it opens the upload option.

Browse to Choose/Upload

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will remove the hidden tag and make it true for all the case

handleNextStep('uploadLogo')
}

if (Object.keys(errors).length === 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if (!Object.keys(errors).length) {

@rohitmalhotra1420 rohitmalhotra1420 merged commit d69aed2 into Feat-New-Channel-Creation-Flow Jul 22, 2024
1 check failed
rohitmalhotra1420 added a commit that referenced this pull request Jul 30, 2024
* New Channel Creation flow UI

* added common stepper

* fixed stepper

* fixed stepper

* fixed stepper

* Changed the Stepper flow

* added layout

* send notif

* Add new chain to a channel (#1723)

* added basic layout

* finished ui

* added fixes

* addes stepper

* added layout of select

* fixed width of the popover

* fixed alignment

* added review comments

* fixed form code

* removed Box from select

* added form context wrapper

* moved validation outside

* Update index.ts

* added formik

* New Channel Creation Flow  (#1710)

* New Channel Creation Flow based on new UI

* Function implementation of the create Channel

* Added New Page when chain is diff

* Fixed the navigation for channel creation flow

* Pulled the main to change the theme way

* Removed the new createChannel route

* Removed faucet duplication

* Fixed issue with the text and text color

* Fixed the imports and other issues

* Resolved the stepper issue

* Fixed the input validation and also added validaiton msg

* fxed error validations

* import fixes

* refactoring done

* Fixed the stepper steps prop

* File upload moved to blocks and form is also corrected for ChannelInfo

* Created Alert Block just for error

* Removed hidden prop fro file upload and also fixed the stake fees error comment

---------

Co-authored-by: rohitmalhotra1420 <[email protected]>

* fixed mobile view

* fixed mobile view

* fixed enter key

* added missing things in select

* channel dashboard fix

* fixed the navigation issue

* fixed the navigation issue

* fixed review issues

---------

Co-authored-by: abhishek-01k <[email protected]>
Co-authored-by: Abhishek <[email protected]>
Co-authored-by: rohitmalhotra1420 <[email protected]>
rohitmalhotra1420 added a commit that referenced this pull request Aug 20, 2024
…feature (#1782)

* Dapp 1752 send notif (#1775)

* New Channel Creation flow UI

* added common stepper

* fixed stepper

* fixed stepper

* fixed stepper

* Changed the Stepper flow

* added layout

* send notif

* Add new chain to a channel (#1723)

* added basic layout

* finished ui

* added fixes

* addes stepper

* added layout of select

* fixed width of the popover

* fixed alignment

* added review comments

* fixed form code

* removed Box from select

* added form context wrapper

* moved validation outside

* Update index.ts

* added formik

* New Channel Creation Flow  (#1710)

* New Channel Creation Flow based on new UI

* Function implementation of the create Channel

* Added New Page when chain is diff

* Fixed the navigation for channel creation flow

* Pulled the main to change the theme way

* Removed the new createChannel route

* Removed faucet duplication

* Fixed issue with the text and text color

* Fixed the imports and other issues

* Resolved the stepper issue

* Fixed the input validation and also added validaiton msg

* fxed error validations

* import fixes

* refactoring done

* Fixed the stepper steps prop

* File upload moved to blocks and form is also corrected for ChannelInfo

* Created Alert Block just for error

* Removed hidden prop fro file upload and also fixed the stake fees error comment

---------

Co-authored-by: rohitmalhotra1420 <[email protected]>

* fixed mobile view

* fixed mobile view

* fixed enter key

* added missing things in select

* channel dashboard fix

* fixed the navigation issue

* fixed the navigation issue

* fixed review issues

---------

Co-authored-by: abhishek-01k <[email protected]>
Co-authored-by: Abhishek <[email protected]>
Co-authored-by: rohitmalhotra1420 <[email protected]>

* Dapp 1703 channel creation flow UI (#1776)

* New Channel Creation flow UI

* added common stepper

* fixed stepper

* fixed stepper

* New Channel Creation Flow based on new UI

* fixed stepper

* Function implementation of the create Channel

* Changed the Stepper flow

* Added New Page when chain is diff

* Fixed the navigation for channel creation flow

* Pulled the main to change the theme way

* Removed the new createChannel route

* Removed faucet duplication

* Fixed issue with the text and text color

* Fixed the imports and other issues

* Resolved the stepper issue

* Fixed the input validation and also added validaiton msg

* fxed error validations

* import fixes

* refactoring done

* Add new chain to a channel (#1723)

* added basic layout

* finished ui

* added fixes

* addes stepper

* added layout of select

* fixed width of the popover

* fixed alignment

* added review comments

* fixed form code

* removed Box from select

* added form context wrapper

* moved validation outside

* Update index.ts

* Fixed the stepper steps prop

* File upload moved to blocks and form is also corrected for ChannelInfo

* Created Alert Block just for error

* Removed hidden prop fro file upload and also fixed the stake fees error comment

---------

Co-authored-by: Monalisha Mishra <[email protected]>
Co-authored-by: rohitmalhotra1420 <[email protected]>
Co-authored-by: Monalisha Mishra <[email protected]>

* Dapp 1704 alias verification (#1777)

* New Channel Creation flow UI

* added common stepper

* added basic layout

* finished ui

* added fixes

* fixed stepper

* addes stepper

* fixed stepper

* fixed stepper

* Changed the Stepper flow

* added layout of select

* fixed width of the popover

* fixed alignment

* added review comments

* fixed form code

* removed Box from select

* added form context wrapper

* moved validation outside

* Update index.ts

---------

Co-authored-by: abhishek-01k <[email protected]>
Co-authored-by: rohitmalhotra1420 <[email protected]>

* Created different routes for Create Channel and Channel Dashboard

* Created Channel Dashboard Header and App Footer, also added listSemantics and modified MenuItem.ts file

* Added Notification Settings in the dashboard body

* Channel Delegates and Get Delegates functionality

* Add Delegate and Remove Delegate Functionality added

* Deactivate Channel Func added

* Added Subgraph component and also used Uint8Array as type

* Added token faucet and Reactivate channel function

* Added Alert block and also added inline error in the components

* Edit Channel Component and Function added

* Fixed the build error

* Revert "Fixed the build error"

This reverts commit 464ce63.

* Revert "Edit Channel Component and Function added"

This reverts commit c8a440e.

* Created New file for edit channel just UI

* Edit Channel Functionality added

* Changed the route for CreateChannel on Navigation

* Check For Changes are implemented in EditChannel

* Added tooltip and attached dashboard to notification setting page

* Fixed the schematic issue in create channel

* Fixed the Send Notification issue and updated Navigation file

* Added space between balance and number

* Changed the tooltip from description to title

* fixed review comments

* Fixed the issues on the Channel flow 1

* Fixed the connect modal on create channel and also fixed the overlay for blocknative modal

* added frontend fixes

* added frontend fixes

* added frontend fixes

* Added support for differnet chains on dashboard

* added select close on scroll

* added event removal

* alais fixes

* added event removal

* Fixed the alias featured on the dashboard

* added event removal

* Fixed the displaying of channel details on dashboard for alias addresses

* added validations

* fixed review comments

* Fixed poling of channel details for the alias condition

* fixed ui

* fixed closing of unlock in send notif

* added fixes

* fixed alias issues

* Fixed the tag color and the sidebar send notification disappearing issur

* Added verified alias logo to the dashboard header

---------

Co-authored-by: Monalisha Mishra <[email protected]>
Co-authored-by: rohitmalhotra1420 <[email protected]>
Co-authored-by: Monalisha Mishra <[email protected]>
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.

😈 [Feature Enhancement] - Implement the New Create Channel Flow
3 participants