-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixes #268 (-webkit-fill-available vs background gradient bug) use react modals custom classname to add the styles to html and body only when our modal is open * Fix (hideFromDefaults option not hiding wallets) (#275) * fixes #274 (hide from defaults not hiding wallets) * return an array of which default providers are being used. rather than reuse all screens, which would have had extra and potentially gotten weird * Fix handling of reactModalProp (#278) * fixes the connect modal not recognizing when it receives style props externally. * Remove Extra Global Styles (#282) * remove tailwind base as it is messing with global styles * remove unnessessary css resets for react-celo * fix vertical allignments
- Loading branch information
Showing
12 changed files
with
223 additions
and
271 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ on: | |
pull_request: | ||
branches: | ||
- master | ||
- stable | ||
- 'release/**' | ||
|
||
jobs: | ||
build: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import '@testing-library/jest-dom'; | ||
|
||
import { RenderResult } from '@testing-library/react'; | ||
import React from 'react'; | ||
|
||
import { ConnectModal } from '../../src/modals'; | ||
import { renderComponentInCKProvider } from '../render-in-provider'; | ||
|
||
const theme = { | ||
primary: '#eef2ff', | ||
secondary: '#6366f1', | ||
text: '#ffffff', | ||
textSecondary: '#cbd5e1', | ||
textTertiary: '#64748b', | ||
muted: '#334155', | ||
background: '#1e293b', | ||
error: '#ef4444', | ||
}; | ||
|
||
describe('ConnectModal', () => { | ||
describe('when given reactModalProps', () => { | ||
let dom: RenderResult; | ||
describe('style.overlay', () => { | ||
beforeEach(() => { | ||
dom = renderComponentInCKProvider( | ||
<ConnectModal | ||
reactModalProps={{ | ||
isOpen: true, | ||
style: { overlay: { zIndex: 10 } }, | ||
}} | ||
/>, | ||
{ providerProps: { theme } } | ||
); | ||
}); | ||
it('applies those styles while keeping original', async () => { | ||
const modal = await dom.findByRole('dialog'); | ||
expect(modal.parentElement).toHaveStyle( | ||
'z-index: 10; background: rgba(30, 41, 59, 0.75)' | ||
); | ||
}); | ||
it('still uses theme for background on content modal', async () => { | ||
const modal = await dom.findByRole('dialog'); | ||
expect(modal).toHaveStyle('background: rgba(30, 41, 59, 1)'); | ||
}); | ||
}); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { render, renderHook } from '@testing-library/react'; | ||
import React, { ReactElement } from 'react'; | ||
|
||
import { CeloProvider, CeloProviderProps } from '../src/react-celo-provider'; | ||
|
||
interface RenderArgs { | ||
providerProps: Partial<CeloProviderProps>; | ||
} | ||
|
||
const defaultProps: CeloProviderProps = { | ||
dapp: { | ||
name: 'Testing Celo React', | ||
description: 'Test it well', | ||
url: 'https://celo.developers', | ||
icon: '', | ||
}, | ||
children: null, | ||
}; | ||
|
||
export function renderComponentInCKProvider( | ||
ui: ReactElement<unknown, string>, | ||
{ providerProps }: RenderArgs | ||
) { | ||
return render(ui, { | ||
wrapper: ({ children }) => { | ||
const props = { ...defaultProps, ...providerProps }; | ||
return <CeloProvider {...props}>{children}</CeloProvider>; | ||
}, | ||
}); | ||
} | ||
|
||
export function renderHookInCKProvider<R>( | ||
hook: (i: unknown) => R, | ||
{ providerProps }: RenderArgs | ||
) { | ||
return renderHook<R, unknown>(hook, { | ||
wrapper: ({ children }) => { | ||
const props = { ...defaultProps, ...providerProps }; | ||
return <CeloProvider {...props}>{children}</CeloProvider>; | ||
}, | ||
}); | ||
} |
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.
961620f
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.
Successfully deployed to the following URLs:
react-celo – ./
react-celo-c-labs.vercel.app
react-celo.vercel.app
react-celo-git-stable-c-labs.vercel.app