Skip to content

Commit

Permalink
feat: export goBack ts intetface (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaoei committed Aug 23, 2021
1 parent e76d1ac commit 37d1794
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
7 changes: 1 addition & 6 deletions src/components/goBack/goBack.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import React from 'react'
import { Icon } from 'antd/lib'
import { browserHistory, hashHistory } from 'react-router'
import { GoBackProps } from './index'

export interface GoBackProps {
url?: string;
autoClose?: boolean;
style?: React.CSSProperties;
history?: boolean;
}
export default class GoBack extends React.Component<GoBackProps, any> {
go = () => {
const { url, history, autoClose } = this.props
Expand Down
9 changes: 1 addition & 8 deletions src/components/goBack/goBackButton.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import * as React from 'react'
import { Button } from 'antd'
import { browserHistory, hashHistory } from 'react-router'

export interface GoBackButtonProps {
title?: string;
url?: string;
autoClose?: boolean;
style?: React.CSSProperties;
history?: any;
}
import { GoBackButtonProps } from './index'

export default class GoBackButton extends React.Component<GoBackButtonProps, any> {
go = () => {
Expand Down
18 changes: 14 additions & 4 deletions src/components/goBack/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
import GoBack from './goBack'
import GoBackButton from './goBackButton'
import GoBack from './goBack';
import GoBackButton from './goBackButton';

GoBack.GoBackButton = GoBackButton
export default GoBack
export interface GoBackProps {
url?: string;
autoClose?: boolean;
style?: React.CSSProperties;
history?: boolean;
}
export interface GoBackButtonProps extends GoBackProps{
title?: string;
}

GoBack.GoBackButton = GoBackButton;
export default GoBack;

0 comments on commit 37d1794

Please sign in to comment.