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

Add new chain to a channel #1723

Merged

Conversation

mishramonalisha76
Copy link
Collaborator

@mishramonalisha76 mishramonalisha76 commented Jul 12, 2024

Pull Request Template

Ticket Number

Description

  • Problem/Feature:
    Created a new page to add chain to a channel.

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

Uploading image.png…

Additional Context

Review & Approvals

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

Notes

@mishramonalisha76 mishramonalisha76 self-assigned this Jul 12, 2024
@mishramonalisha76 mishramonalisha76 linked an issue Jul 12, 2024 that may be closed by this pull request
@mishramonalisha76 mishramonalisha76 changed the base branch from main to Feat-New-Channel-Creation-Flow July 12, 2024 08:20
Copy link

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

Copy link

All looks good.

Copy link

All looks good.

Copy link

All looks good.

src/blocks/select/Select.tsx Show resolved Hide resolved
src/structure/Navigation.tsx Outdated Show resolved Hide resolved
src/config/AppPaths.ts Outdated Show resolved Hide resolved
src/blocks/select/Select.tsx Show resolved Hide resolved
Comment on lines 114 to 121
<TextInput
label="Your Address on New Chain"
description="Make sure you own this alias as verification will take place."
value={formik.values.alias}
onChange={formik.handleChange('alias')}
error={formik.touched.alias && Boolean(formik.errors.alias)}
errorMessage={formik.touched.alias ? formik.errors.alias : ''}
/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This field needs to have a min and max char length validation.

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 there is not fixed length for the address, but have added a function to check if the address is valid

src/modules/addNewChain/components/NewAddress.tsx Outdated Show resolved Hide resolved
src/modules/addNewChain/components/ChangeNetwork.tsx Outdated Show resolved Hide resolved
src/modules/addNewChain/AddNewChain.tsx Outdated Show resolved Hide resolved
src/modules/addNewChain/AddNewChain.tsx Outdated Show resolved Hide resolved
src/modules/addNewChain/AddNewChain.tsx Outdated Show resolved Hide resolved
Copy link

All looks good.

Comment on lines 35 to 51
const validationSchema = yup.object().shape({
alias: yup
.string()
.required('Address is required')
.test('is-valid-address', 'Invalid wallet address', isValidAddress),
chainId: yup.string().required('ChainId is required'),
});
const formik = useFormik<NewChainAddressValue>({
initialValues: {
alias: '',
chainId: '11155111',
},
validationSchema: validationSchema,
onSubmit: (values) => {
handleInitiate(values.alias, values.chainId);
},
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

We decided the validation schema, form types and initial values goes to the AddNewChain.form.ts

Copy link
Collaborator Author

@mishramonalisha76 mishramonalisha76 Jul 18, 2024

Choose a reason for hiding this comment

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

@rohitmalhotra1420 but useFormik can only be used in a react component, as its a react hook

Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not talking out moving out the hook but validation schema, form types and initial values from the component to another file

import { getSelectChains } from '../AddNewChain.utils';

export type NewAddressProps = {
formik: any;
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
formik: any;
form: Type;

Please provide a type

src/modules/addNewChain/AddNewChain.tsx Outdated Show resolved Hide resolved
src/modules/addNewChain/AddNewChain.tsx Outdated Show resolved Hide resolved
src/modules/addNewChain/AddNewChain.tsx Outdated Show resolved Hide resolved
src/modules/addNewChain/components/ChangeNetwork.tsx Outdated Show resolved Hide resolved
src/modules/addNewChain/components/VerifyAliasChain.tsx Outdated Show resolved Hide resolved
src/modules/addNewChain/components/VerifyAliasChain.tsx Outdated Show resolved Hide resolved
src/modules/addNewChain/components/VerifyAliasChain.tsx Outdated Show resolved Hide resolved
Comment on lines +43 to +45
border-bottom: 1.5px solid var(--stroke-tertiary);
border-left: 1.5px solid var(--stroke-tertiary);
border-bottom-left-radius: 10px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Screenshot 2024-07-18 at 11 36 51 AM
  • borderWidth should be a css variable
  • 1.5 px is not a valid borderwidth. Ask Zee to fix this.

Copy link

All looks good.

Copy link

All looks good.

@rohitmalhotra1420 rohitmalhotra1420 linked an issue Jul 18, 2024 that may be closed by this pull request
src/modules/addNewChain/AddNewChain.form.tsx Outdated Show resolved Hide resolved
@@ -13,7 +13,7 @@ export type TextInputProps = {
type?: 'text' | 'password';
errorMessage?: string;
label?: string;
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why make it optional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because even when the input is disabled like in the last section - verify alias, Text input shows error

Copy link

All looks good.

Copy link

All looks good.

@rohitmalhotra1420 rohitmalhotra1420 mentioned this pull request Jul 19, 2024
20 tasks
@rohitmalhotra1420 rohitmalhotra1420 merged commit 9a68be0 into Feat-New-Channel-Creation-Flow Jul 19, 2024
1 check passed
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 Jul 30, 2024
* 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]>
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] - Alias Verification flow [DApp - DS] Create Select component
2 participants