Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# 🗓 Changelog

## 1.2.0

`2020-01-06`

- remove height. [#2](https://github.com/image-component/react-image-follow/pull/2)

## 1.1.0

`2021-01-06`
Expand Down
1 change: 1 addition & 0 deletions assets/index.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.react-image-follow {
width: 100%;
height: 400px;
position: relative;
display: flex;
align-items: center;
Expand Down
2 changes: 1 addition & 1 deletion docs/example/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const src =
const App = () => {
return (
<div className="demo">
<ImageFollow src={src} height={400} />
<ImageFollow src={src} />
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion docs/example/extra.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const src =
const App = () => {
return (
<div className="demo">
<ImageFollow src={src} height={400}>
<ImageFollow src={src}>
<h1 style={{ color: '#fff' }}>Image Follow</h1>
</ImageFollow>
</div>
Expand Down
1 change: 0 additions & 1 deletion docs/example/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const App = () => {
<ImageFollow
href="https://github.com/image-component/react-image-follow"
src={src}
height={400}
>
<h1 style={{ color: '#fff' }}>Can Click</h1>
</ImageFollow>
Expand Down
13 changes: 1 addition & 12 deletions src/template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,14 @@ type ImageFollowProps = {
radius?: number;
src: string;
style?: React.CSSProperties;
height?: number;
href?: string;
children?: React.ReactNode;
};

export { ImageFollowProps };

const ImageFollow = (props: ImageFollowProps) => {
const {
alt,
className,
radius = 8,
src,
style,
height = 200,
href,
children,
} = props;
const { alt, className, radius = 8, src, style, href, children } = props;

const [cardStyle, setCardStyle] = React.useState({});
const [wrapperStyle, setWrapperStyle] = React.useState({});
Expand All @@ -33,7 +23,6 @@ const ImageFollow = (props: ImageFollowProps) => {
const cardRef = React.useRef<HTMLElement>();

const cardBaseStyle = {
height: `${height}px`,
borderRadius: `${radius}px`,
...style,
};
Expand Down
1 change: 0 additions & 1 deletion tests/__snapshots__/index.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ exports[`temp render 1`] = `
style={
Object {
"borderRadius": "8px",
"height": "200px",
}
}
target="_blank"
Expand Down