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] Create the llmMarketQuickActions feature flag #7558

Merged
merged 6 commits into from
Aug 9, 2024

Conversation

thesan
Copy link
Contributor

@thesan thesan commented Aug 8, 2024

βœ… Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • ...

πŸ“ Description

Add a first draft of the MarketQuickActions hidden behind the new llmMarketQuickActions feature flag.

❓ Context


🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

@thesan thesan requested a review from a team as a code owner August 8, 2024 14:20
Copy link

vercel bot commented Aug 8, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

5 Skipped Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-docs ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2024 3:59pm
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2024 3:59pm
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2024 3:59pm
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2024 3:59pm
web-tools ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2024 3:59pm

@live-github-bot live-github-bot bot added mobile Has changes in LLM common Has changes in live-common ledgerjs Has changes in the ledgerjs open source libs labels Aug 8, 2024

export const MarketQuickActions = () => {
const { t } = useTranslation();
const navigation = useNavigation<StackNavigationProp<Record<string, object | undefined>>>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const navigation = useNavigation<StackNavigationProp<Record<string, object | undefined>>>();
const navigation = useNavigation<StackNavigatorNavigation<BaseNavigatorStackParamList>>();

Should works :)

Copy link
Member

@KVNLS KVNLS left a comment

Choose a reason for hiding this comment

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

Tested and it works well!

Comment on lines 34 to 51
const QUICK_ACTIONS = ["SEND", "RECEIVE", "BUY", "SWAP", "STAKE"] as const;
const QUICK_ACTION_DATA = {
SEND: {
name: "portfolio.quickActions.send",
},
RECEIVE: {
name: "portfolio.quickActions.deposit",
},
BUY: {
name: "portfolio.quickActions.buy",
},
SWAP: {
name: "portfolio.quickActions.swap",
},
STAKE: {
name: "portfolio.quickActions.stake",
},
} as const;
Copy link
Member

Choose a reason for hiding this comment

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

Can we optimize this to only define once SEND, RECEIVE, etc...
I think that we can with something like keyof typeof.
Otherwise, maybe we can do Object.keys(QUICK_ACTION_DATA) to iterate on options.
wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I did this but it required an extra type casting because the Object keys and entries functions type def always collapse the type of the key to string.

Copy link
Member

@KVNLS KVNLS left a comment

Choose a reason for hiding this comment

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

lgtm!

@thesan thesan merged commit 9a650da into develop Aug 9, 2024
57 of 58 checks passed
@thesan thesan deleted the feature/llm-market-quick-action-flag branch August 9, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Has changes in live-common ledgerjs Has changes in the ledgerjs open source libs mobile Has changes in LLM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants