-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
66 additions
and
25 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,26 @@ | ||
import Taro from '@tarojs/taro' | ||
import { Button } from '@tarojs/components' | ||
|
||
import _isFunction from 'lodash/isFunction' | ||
|
||
import './index.scss' | ||
|
||
export default class ModalButton extends Taro.Component { | ||
constructor() { | ||
super(...arguments) | ||
} | ||
|
||
handleClick = () => { | ||
const { onClick } = this.props | ||
_isFunction(onClick) && onClick() | ||
} | ||
|
||
render() { | ||
const { children } = this.props | ||
return ( | ||
<Button className='at-modal-action__button' onClick={this.handleClick}> | ||
{children} | ||
</Button> | ||
) | ||
} | ||
} |
10 changes: 8 additions & 2 deletions
10
src/components/modal/footer/index.js → src/components/modal/action/index.js
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 |
---|---|---|
@@ -1,17 +1,23 @@ | ||
import Taro from '@tarojs/taro' | ||
import { View } from '@tarojs/components' | ||
|
||
import ModalButton from './button.js' | ||
|
||
import './index.scss' | ||
|
||
export default class ModalFooter extends Taro.Component { | ||
constructor() { | ||
super(...arguments) | ||
} | ||
|
||
static Button = ModalButton | ||
|
||
render() { | ||
const { children } = this.props | ||
return ( | ||
<View className='at-modal-header'>{children}</View> | ||
<View className='at-modal-footer'> | ||
<View className='at-modal-footer__action'>{children}</View> | ||
</View> | ||
) | ||
} | ||
} | ||
} |
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 @@ | ||
.at-modal-footer { | ||
border-top: 2px solid #e5e5e5; | ||
&__action { | ||
display: flex; | ||
} | ||
} | ||
|
||
.at-modal-action__button { | ||
outline: 0; | ||
flex: auto; | ||
border: none; | ||
font-size: 28px; | ||
background-color: white; | ||
&:not(:first-child) { | ||
border-left: 2px solid #e5e5e5; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
Empty file.
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