forked from agrawal-rohit/pearl-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: updated Screen docs to reflect new props, scrollability, and pu…
…ll-to-refresh
- Loading branch information
Rohit Agrawal
committed
Nov 17, 2021
1 parent
db0d366
commit 6e7de43
Showing
37 changed files
with
6,502 additions
and
3,172 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
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,5 @@ | ||
export default { | ||
parts: ["root", "image", "text"], | ||
baseStyle: {}, | ||
defaults: {}, | ||
}; |
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 React from "react"; | ||
import { render } from "@testing-library/react-native"; | ||
import Avatar from "./Avatar"; | ||
import { ThemeProvider } from "../../../theme/src/themeContext"; | ||
|
||
jest.useFakeTimers(); | ||
|
||
describe("Atoms/Divider", () => { | ||
it("passes the snapshot test in light mode", () => { | ||
const tree = render( | ||
<ThemeProvider> | ||
<Avatar source={{}} /> | ||
</ThemeProvider> | ||
).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); |
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 { storiesOf } from "@storybook/react-native"; | ||
import Screen from "../Screen/Screen"; | ||
import Avatar from "./Avatar"; | ||
|
||
storiesOf("Avatar", module) | ||
.addDecorator((getStory) => <Screen>{getStory()}</Screen>) | ||
.add("Main", () => ( | ||
<> | ||
{/* <Divider /> | ||
<Divider mt="l" length="50%" /> | ||
<Divider mt="l" orientation="vertical" length={20} bg="violet" /> */} | ||
</> | ||
)); |
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 React from "react"; | ||
import { useMolecularComponentConfig } from "../../../hooks/useMolecularComponentConfig"; | ||
import Box from "../../Atoms/Box/Box"; | ||
import { ImageProps } from "../../Molecules/Image/Image"; | ||
|
||
type AvatarProps = ImageProps & { | ||
/** The size of the avatar */ | ||
size?: string; | ||
/** The variant of the avatar */ | ||
variant?: string; | ||
}; | ||
|
||
// TODO: Add main user image render | ||
// TODO: Add icon fallback based on user name | ||
// TODO: Add support for custom fallback icon | ||
// TODO: Add icon badge to avatar | ||
|
||
/** The Avatar component is used to represent a user, and displays the profile picture, initials or fallback icon. */ | ||
const Avatar: React.FC<AvatarProps> = ({ children, ...rest }) => { | ||
const props = useMolecularComponentConfig("Avatar", rest, { | ||
size: rest.size, | ||
variant: rest.size, | ||
}); | ||
|
||
return <Box></Box>; | ||
}; | ||
|
||
export default Avatar; |
100 changes: 100 additions & 0 deletions
100
src/components/Atoms/Avatar/__snapshots__/Divider.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,100 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Atoms/Divider passes the snapshot test for different length modes 1`] = ` | ||
Array [ | ||
<View | ||
style={ | ||
Array [ | ||
Object { | ||
"backgroundColor": "#1A2138", | ||
"display": "flex", | ||
}, | ||
Object { | ||
"height": 1, | ||
"width": "50%", | ||
}, | ||
] | ||
} | ||
/>, | ||
<View | ||
style={ | ||
Array [ | ||
Object { | ||
"backgroundColor": "#ee82ee", | ||
"display": "flex", | ||
}, | ||
Object { | ||
"height": 20, | ||
"width": 1, | ||
}, | ||
] | ||
} | ||
/>, | ||
] | ||
`; | ||
|
||
exports[`Atoms/Divider passes the snapshot test in dark mode 1`] = ` | ||
Array [ | ||
<View | ||
style={ | ||
Array [ | ||
Object { | ||
"backgroundColor": "#1A2138", | ||
"display": "flex", | ||
}, | ||
Object { | ||
"height": 1, | ||
"width": "100%", | ||
}, | ||
] | ||
} | ||
/>, | ||
<View | ||
style={ | ||
Array [ | ||
Object { | ||
"backgroundColor": "#1A2138", | ||
"display": "flex", | ||
}, | ||
Object { | ||
"height": "100%", | ||
"width": 1, | ||
}, | ||
] | ||
} | ||
/>, | ||
] | ||
`; | ||
|
||
exports[`Atoms/Divider passes the snapshot test in light mode 1`] = ` | ||
Array [ | ||
<View | ||
style={ | ||
Array [ | ||
Object { | ||
"backgroundColor": "#E4E9F2", | ||
"display": "flex", | ||
}, | ||
Object { | ||
"height": 1, | ||
"width": "100%", | ||
}, | ||
] | ||
} | ||
/>, | ||
<View | ||
style={ | ||
Array [ | ||
Object { | ||
"backgroundColor": "#E4E9F2", | ||
"display": "flex", | ||
}, | ||
Object { | ||
"height": "100%", | ||
"width": 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
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.