-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #619 from Secured-Finance/SF-1213-Shorten-header-a…
…dd-points-UI fix: header fix wip [SF-1213]
- Loading branch information
Showing
24 changed files
with
271 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/components/organisms/ConnectWalletDialog/ConnectWalletDialog.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { Meta, StoryFn } from '@storybook/react'; | ||
import { ConnectWalletDialog } from './ConnectWalletDialog'; | ||
|
||
export default { | ||
title: 'Organism/ConnectWalletDialog', | ||
component: ConnectWalletDialog, | ||
args: { | ||
isOpen: true, | ||
onClose: () => {}, | ||
}, | ||
} as Meta<typeof ConnectWalletDialog>; | ||
|
||
const Template: StoryFn<typeof ConnectWalletDialog> = args => { | ||
return <ConnectWalletDialog {...args} />; | ||
}; | ||
|
||
export const Default = Template.bind({}); |
23 changes: 23 additions & 0 deletions
23
src/components/organisms/ConnectWalletDialog/ConnectWalletDialog.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { composeStories } from '@storybook/react'; | ||
import { mockUseSF } from 'src/stories/mocks/useSFMock'; | ||
import { render, screen } from 'src/test-utils.js'; | ||
import * as stories from './ConnectWalletDialog.stories'; | ||
|
||
const { Default } = composeStories(stories); | ||
|
||
const mockSecuredFinance = mockUseSF(); | ||
jest.mock('src/hooks/useSecuredFinance', () => () => mockSecuredFinance); | ||
|
||
describe('DepositCollateral component', () => { | ||
it('should display the Connect Wallet Dialog when open', () => { | ||
render(<Default />); | ||
|
||
expect(screen.getByRole('dialog')).toBeInTheDocument(); | ||
expect( | ||
screen.getByRole('heading', { name: 'Connect Wallet' }) | ||
).toBeInTheDocument(); | ||
|
||
const button = screen.getByTestId('dialog-action-button'); | ||
expect(button).toHaveTextContent('Connect'); | ||
}); | ||
}); |
28 changes: 28 additions & 0 deletions
28
src/components/organisms/ConnectWalletDialog/ConnectWalletDialog.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Badge from 'src/assets/icons/badge.svg'; | ||
import { Dialog } from 'src/components/molecules'; | ||
|
||
export const ConnectWalletDialog = ({ | ||
isOpen, | ||
onClose, | ||
handleConnectWallet, | ||
}: { | ||
isOpen: boolean; | ||
onClose: () => void; | ||
handleConnectWallet: () => void; | ||
}) => { | ||
return ( | ||
<Dialog | ||
title='Connect Wallet' | ||
description='Get Points by placing limit orders and maintaining active positions on our app. But first, connect your wallet.' | ||
callToAction='Connect Wallet' | ||
onClick={handleConnectWallet} | ||
isOpen={isOpen} | ||
onClose={onClose} | ||
showCancelButton | ||
> | ||
<div className='mx-auto flex h-[100px] w-[100px] items-center justify-center rounded-full border border-white/[19%] bg-white/[5%]'> | ||
<Badge className='h-16 w-16' /> | ||
</div> | ||
</Dialog> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ConnectWalletDialog'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.