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: new tx history layout #2072

Draft
wants to merge 33 commits into
base: master
Choose a base branch
from
Draft

feat: new tx history layout #2072

wants to merge 33 commits into from

Conversation

fionnachan
Copy link
Member

Closes FS-974

Copy link

vercel bot commented Nov 11, 2024

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

Name Status Preview Updated (UTC)
arbitrum-token-bridge ✅ Ready (Inspect) Visit Preview Nov 26, 2024 2:32pm

packages/arb-token-bridge-ui/public/icons/wallet.svg Outdated Show resolved Hide resolved
}

export const useSelectedTabIndex = create<SelectedTabIndexStore>(set => ({
selectedIndex: 0,
setSelectedIndex: (index: number) => set({ selectedIndex: index }),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be cleaner if we used a consistent way of switching tabs, instead of having setSelectedIndex and openTransactionHistory & renamed the hook to useMainContentTabs. Just throwing a suggestion out here, let me know what you think:

enum MainContentTabs {
   Bridge = 0,
   TransactionHistory = 1
}

export const useMainContentTabs = create(set => ({
   selectedTab: MainContentTabs.Bridge,
   openBridge: () => set({ selectedTab: MainContentTabs.Bridge }),
   openTransactionHistory: () => set({ selectedTab: MainContentTabs.TransactionHistory })
)})

Copy link
Member Author

Choose a reason for hiding this comment

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

i like this, will add these
but we still need to keep the setSelectedIndex function to accept a number for Tab.Group to use at onChange

Copy link
Contributor

Choose a reason for hiding this comment

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

We use it only in TransactionHistory.tsx now, not sure if it's worth having it in a separate hook?

type MainContentTabStore = {
selectedTab: MainContentTabs
setSelectedTab: (index: MainContentTabs) => void
openBridge: () => void
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we rename these to switchToBridge and switchToTransactionHistory to be consistent with what we have in E2E's? Plus it sounds better since we aren't opening any panel - just switching to it.

@fionnachan fionnachan marked this pull request as draft November 26, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants