-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Reject All GDPR * chore: removal of loading
- Loading branch information
Showing
6 changed files
with
119 additions
and
44 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
import { StyleSheet, View } from 'react-native'; | ||
|
||
const styles = (unit: number) => | ||
StyleSheet.create({ | ||
spacer: { | ||
marginRight: unit, | ||
marginTop: unit, | ||
}, | ||
}); | ||
export const Spacer = ({ unit = 8 }: { unit?: number }) => ( | ||
<View style={styles(unit).spacer} /> | ||
); |
15 changes: 15 additions & 0 deletions
15
projects/Mallard/src/components/Spacer/__tests__/Spacer.spec.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,15 @@ | ||
import React from 'react'; | ||
import TestRenderer from 'react-test-renderer'; | ||
import { Spacer } from '../Spacer'; | ||
|
||
describe('<Spacer />', () => { | ||
it('should render with default props', () => { | ||
const wrapper = TestRenderer.create(<Spacer />).toJSON(); | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
|
||
it('should render with given props', () => { | ||
const wrapper = TestRenderer.create(<Spacer unit={30} />).toJSON(); | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
}); |
23 changes: 23 additions & 0 deletions
23
projects/Mallard/src/components/Spacer/__tests__/__snapshots__/Spacer.spec.tsx.snap
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 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<Spacer /> should render with default props 1`] = ` | ||
<View | ||
style={ | ||
{ | ||
"marginRight": 8, | ||
"marginTop": 8, | ||
} | ||
} | ||
/> | ||
`; | ||
|
||
exports[`<Spacer /> should render with given props 1`] = ` | ||
<View | ||
style={ | ||
{ | ||
"marginRight": 30, | ||
"marginTop": 30, | ||
} | ||
} | ||
/> | ||
`; |
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