-
Notifications
You must be signed in to change notification settings - Fork 0
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
Ameerul /P2PS-1305 access the share ad link #11
Ameerul /P2PS-1305 access the share ad link #11
Conversation
@@ -21,6 +21,7 @@ const ErrorModal = ({ | |||
has_close_icon={has_close_icon} | |||
is_open={is_modal_open} | |||
title={error_modal_title} | |||
toggleModal={onClose ?? hideModal} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for some reason the error modals in p2p can have the x icon but then we can't press them since it was missing the toggleModal function here so i decided to add it
setCounterpartyAdvertId(counterparty_advert_id) { | ||
this.counterparty_advert_id = counterparty_advert_id; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be handled in the component? Let's not add more logic to stores.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally it would be best, let me try and see if we can move it to the component buttt i added this because i needed to track if there was an advert id, and when the user navigates to the shared ad, the advert_id in search param disappears and reappears, so it kept causing issues when trying to show the advert... hence why i needed this observable... it was a similar issue for the advertiser id and the order id when niloofar and I changed the routing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so i tried to handle everything in app.jsx where i used useState to track the advert_id in search params. This did work, but the modal couldn't close because it still had a value within the state. And because that state is only handled in the app, i can't change the value... You can see that i had set `counterparty_advert_id' to an empty string so it wont show the modal.
i did try to reset the state in app, but then the modal wouldn't show
packages/p2p/src/components/modal-manager/modals/share-my-ads-modal/share-my-ads-modal.tsx
Outdated
Show resolved
Hide resolved
...onents/modal-manager/modals/share-my-ads-modal/share-my-ads-socials/share-my-ads-socials.tsx
Outdated
Show resolved
Hide resolved
packages/p2p/src/components/modal-manager/modals/share-my-ads-modal/share-my-ads-modal.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/components/vertical-tab/vertical-tab.tsx
Outdated
Show resolved
Hide resolved
@@ -73,7 +73,6 @@ | |||
justify-content: space-between; | |||
align-items: center; | |||
margin-bottom: 1rem; | |||
margin-top: 1.4rem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this to QA checklist.
… use hook, added suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
if (response.error) { | ||
this.setErrorMessage(response.error); | ||
} else { | ||
const { list } = response.p2p_advert_list; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const { list } = response.p2p_advert_list; | |
const { list = [] } = response.p2p_advert_list; |
Can the list (returned by BE) be undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just checked, the list wont be undefined, and there will always be an array returned *unless theres an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just that the above error couldn't recognise response.error, so we needed to check for response first
packages/p2p/src/components/modal-manager/modals/share-my-ads-modal/share-my-ads-modal.tsx
Outdated
Show resolved
Hide resolved
packages/p2p/src/components/advertiser-page/advertiser-page.jsx
Outdated
Show resolved
Hide resolved
packages/p2p/src/components/advertiser-page/advertiser-page.jsx
Outdated
Show resolved
Hide resolved
packages/p2p/src/components/advertiser-page/advertiser-page.jsx
Outdated
Show resolved
Hide resolved
* refactor: ts migration of chart loader * refactor: ts migration of screen large form and started purchase * refactor: add types in store and refcator contract * refactor: ts migaration of purchase field * refactor: ts migration of cancel deal info * refactor: ts migration of the purchase btn * refactor: cancel deal info * refactor: remove simular types * refactor: create file for types * chore: cover return value with react fragment * refactor: apply suggestions * refactor: update imports * refactor: type returned value * refactor: left an explanation of expecting ts error * Akmal / feat: migrate EmptyPortfolioMessage, ErrorComponent and Page404 in Trader package (#5) * feat: migrate Page404 to Typescript * feat: migrate EmptyPortfolioMessage to Typescript * feat: migrate ErrorComponent to Typescript * fix: dialog prop * fix: dialog type * chore: remove React.FC * maryia/WEBREL-321/feat: migrate Actions files to TS (#4) * feat: migrate /contract-type.js to ts & remove barrier.js * feat: migrate duration to ts + remove unused currency.js * feat: migrate actions/purchase to ts * feat: migrate actions/symbol to ts * feat: migrate start-date.js to ts * feat: migrate actions/test.js to ts * chore: improve types in start-date and duration * fix: address review comments * revert: unnecessary line deletion * fix: address reviews * refactor: remove some code smells * refactor: remove code smells * refactor: update types in stores * Akmal / feat: migrate utils in Trader package (#9) * feat: migrate MarketUnderlying to Typescript * feat: migrate errors to Typescript * feat: migrate error spec to Typescript * feat: migrate index to Typescript * feat: migrate validator to Typescript * feat: trigger vercel * chore: sort options alphabetically * fix: TValidationResult type * chore: prettier formatting * refactor: reduce code smells * chore: validator type improvements (binary-com#12) * Kate / DTRA-249 / Code refactoring and removing duplicated files (binary-com#13) * refactor: remove duplicated file * refactor: test improvements * fix: removed forgotten import * chore: empty commit to retrigger checks * refactor: apply suggestion * maryia/DTRA-260/TS migration of /Constants files & SmartChart/Helpers files in Trader (#6) * feat: validation-rules and ui.js to ts * chore: squash merge maryia/WEBREL-321/actions-to-TS changes * chore: added types to validation-rules.ts * chore: remove unused ui.js, migrate used ui.js and index.js to ts * chore: remove unused ui.js * chore: remove unused markers.js, and migrate barriers.js to ts * chore: added types to barriers.js and its test * test: add missing test for removeBarrier to barriers * Revert "chore: squash merge maryia/WEBREL-321/actions-to-TS changes" * feat: migrated chart-barrier-store.js to ts * feat: remove unused ChartMarkerStore * build: trigger build * fix: address review comments * henry/webrel-319/ts-migration-modules-trading-helpers-folder (#11) * fix: merge conflicts * fix: resolve comments * fix: remove comment * fix: add loadash types dependency * refactor: move error type to common props file * fix: circle CI * fix: resolve comment * fix: bug * fix: convert returntype to use ttradestore * empty commit * fix: type change * fix: resolve comments * fix: comments * maryia/861n17c54/fix: sonarcloud warnings (binary-com#14) * fix: sonarcloud warnings * fix: types * fix: resolve conflicts * refactor: apply suggestions * refactor: add last suggestion * refactor: tests * refactor: update function * refactor: add ts migration of exist tests * fix: tests * fix: test case --------- Co-authored-by: Akmal Djumakhodjaev <akmal@binary.com> Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com> Co-authored-by: henry-deriv <118344354+henry-deriv@users.noreply.github.com> Co-authored-by: Matin shafiei <matin@deriv.com>
Changes:
Please provide a summary of the change.
advert_id
in the url with the advertiser's idScreenshots:
Please provide some screenshots of the change.
Short demo of navigation:
94dd136f-461b-4131-82a0-b1ce4731721d.mp4