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

feat: Add cancel order component to deprecated limit orders #10291

Merged
merged 2 commits into from
Dec 23, 2024

Conversation

memoyil
Copy link
Collaborator

@memoyil memoyil commented Jul 30, 2024


PR-Codex overview

This PR introduces the handling of existing limit orders in the application, enhancing the user interface with a new component for displaying these orders. It also implements caching for transaction queries to improve performance.

Detailed summary

  • Added ORDER_CATEGORY.Existing to handle existing orders.
  • Created ExistingOrder interface for existing limit order data structure.
  • Introduced ExistingLimitOrderTable component to display existing orders.
  • Implemented caching mechanism in handler for transaction queries.
  • Updated LimitOrderTable to include logic for rendering existing orders.
  • Modified localization files to add translations for existing orders.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Jul 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 23, 2024 9:02am
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
aptos-web ⬜️ Ignored (Inspect) Visit Preview Dec 23, 2024 9:02am
blog ⬜️ Ignored (Inspect) Visit Preview Dec 23, 2024 9:02am
bridge ⬜️ Ignored (Inspect) Visit Preview Dec 23, 2024 9:02am
games ⬜️ Ignored (Inspect) Visit Preview Dec 23, 2024 9:02am
gamification ⬜️ Ignored (Inspect) Visit Preview Dec 23, 2024 9:02am
uikit ⬜️ Ignored (Inspect) Visit Preview Dec 23, 2024 9:02am

Copy link

changeset-bot bot commented Jul 30, 2024

⚠️ No Changeset found

Latest commit: b491225

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

</Td>
<Td>
<Button
onClick={async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

how about wrap a useCallback

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, I refactored the code too and make the return type of existing orders as an object instead of an array to make it more readable

const handleClick = useCallback((tabType: ORDER_CATEGORY) => setIndex(tabType), [])
const tabMenuItems = useMemo(() => {
if (activeTab === ORDER_CATEGORY.Existing) {
return [t('Existing Orders')]
}
return [t('Open Orders'), t('Expired Order'), t('Order History')]
Copy link
Contributor

Choose a reason for hiding this comment

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

so there will still show the ('Open Orders'), t('Expired Order'), t('Order History') tabs? or just drop them

Copy link
Contributor

Choose a reason for hiding this comment

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

when i click the tabMenu header, the activeTab will be 0, so then the tabMenuItems will render to the old three tabs, and i can't back to the 'Existing Orders' tab

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@chef-eric Fixed the issue, i keep the tabs texts for now to not get removed from translations.json, because if i remove it from here translation test will get failed therefore it needs to be removed to make it green

chef-eric
chef-eric previously approved these changes Jul 31, 2024
@memoyil memoyil marked this pull request as draft July 31, 2024 09:29
@chef-eric
Copy link
Contributor

oh, some conflict

@memoyil memoyil marked this pull request as ready for review July 31, 2024 09:54
@memoyil memoyil requested a review from chef-eric July 31, 2024 09:55
@memoyil memoyil force-pushed the feature/feat_add_cancel_order_limit_component branch from c2a7118 to 1637b9c Compare July 31, 2024 09:55
@memoyil memoyil force-pushed the feature/feat_add_cancel_order_limit_component branch from 63429ca to 1a27342 Compare September 27, 2024 07:17
@memoyil memoyil requested a review from chef-ryan as a code owner September 27, 2024 07:17
@memoyil memoyil force-pushed the feature/feat_add_cancel_order_limit_component branch from 1a27342 to 24b5d7e Compare October 1, 2024 07:05
@memoyil memoyil force-pushed the feature/feat_add_cancel_order_limit_component branch from 24b5d7e to 695ca0a Compare November 7, 2024 08:28
@memoyil memoyil force-pushed the feature/feat_add_cancel_order_limit_component branch from 695ca0a to beebc91 Compare December 2, 2024 08:10
@memoyil memoyil force-pushed the feature/feat_add_cancel_order_limit_component branch from beebc91 to 3c161c6 Compare December 20, 2024 08:13
@vercel vercel bot temporarily deployed to Preview – ton December 20, 2024 08:13 Inactive
@memoyil memoyil force-pushed the feature/feat_add_cancel_order_limit_component branch from 3c161c6 to 6c5dd32 Compare December 23, 2024 06:39
@vercel vercel bot temporarily deployed to Preview – ton December 23, 2024 06:39 Inactive
@chef-ryan chef-ryan merged commit 3e7d0b8 into develop Dec 23, 2024
21 checks passed
@chef-ryan chef-ryan deleted the feature/feat_add_cancel_order_limit_component branch December 23, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants