-
Notifications
You must be signed in to change notification settings - Fork 200
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
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
} | ||
|
||
export const useSelectedTabIndex = create<SelectedTabIndexStore>(set => ({ | ||
selectedIndex: 0, | ||
setSelectedIndex: (index: number) => set({ selectedIndex: index }), |
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.
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 })
)})
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.
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
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.
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 |
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.
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.
Closes FS-974