Skip to content

Commit

Permalink
feat(Toast): 优化样式
Browse files Browse the repository at this point in the history
  • Loading branch information
koppthe committed Aug 16, 2018
1 parent 0323937 commit 1dccf04
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ class App extends Component {
'pages/view/tag/index',
'pages/view/avatar/index',
'pages/view/article/index',
'pages/view/timeline/index',
'pages/action/toast/index',
'pages/action/modal/index',
'pages/action/progress/index',
'pages/action/action-sheet/index',
'pages/action/activity-indicator/index',
'pages/navigation/drawer/index',
'pages/navigation/timeline/index',
'pages/navigation/pagination/index',
'pages/navigation/tabs/index',
'pages/navigation/tabbar/index',
Expand Down
1 change: 1 addition & 0 deletions src/components/modal/action/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
& > button {
@include flex(auto);
@include line(1);
@include active;

min-width: 160px;
height: 88px;
Expand Down
6 changes: 5 additions & 1 deletion src/components/toast/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ export default class AtToast extends Taro.Component {
rootClass.push(`at-toast-body--${status}`)
}

if (image) {
rootClass.push('at-toast-body--custom-image')
}

return isOpened ? (
<View className='at-toast'>
{hasMask && <View className='at-toast-overlay' />}
Expand Down Expand Up @@ -121,7 +125,7 @@ export default class AtToast extends Taro.Component {
}

AtToast.defaultProps = {
duration: 3000
duration: 30000
}

AtToast.propTypes = {
Expand Down
21 changes: 9 additions & 12 deletions src/components/toast/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,17 @@ $toast-loading-size: 100px;
margin-top: 0;
}
}

&.at-toast-body--custom-image,
&.at-toast-body--success,
&.at-toast-body--error,
&.at-toast-body--loading {
padding-bottom: $spacing-v-lg - (($font-size-base * $line-height-zh - $font-size-base) / 2);
}
}

.at-toast-body--loading {
.toast-body-content__img {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: $toast-image-size;

&-item {
width: $toast-loading-size;
height: $toast-loading-size;
animation: atRotate 1350ms linear infinite;
}
.toast-body-content__img-item {
animation: atRotate 1350ms linear infinite;
}
}
4 changes: 2 additions & 2 deletions src/pages/action/modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default class ModalPage extends Taro.Component {
<Button onClick={this.closeModal.bind(this, 1, '点击了取消')}>
取消
</Button>
<Button onClick={this.closeModal.bind(this, 1, '点击了确定')}>
<Button style='color:#6190E8' onClick={this.closeModal.bind(this, 1, '点击了确定')}>
确定
</Button>
</AtModalAction>
Expand Down Expand Up @@ -152,7 +152,7 @@ export default class ModalPage extends Taro.Component {
<Button onClick={this.closeModal.bind(this, 3, '点击了取消')}>
取消
</Button>
<Button onClick={this.closeModal.bind(this, 3, '点击了确定')}>
<Button style='color:#6190E8' onClick={this.closeModal.bind(this, 3, '点击了确定')}>
确定
</Button>
</AtModalAction>
Expand Down
40 changes: 20 additions & 20 deletions src/pages/panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ export default class PanelBasic extends Component {
},
list: {
'basic': [
{
id: 'Icon',
name: '图标'
},
{
id: 'Color',
name: '颜色'
},
{
id: 'Icon',
name: '图标'
},
{
id: 'Typo',
name: '字体'
Expand All @@ -66,24 +66,28 @@ export default class PanelBasic extends Component {
],
'view': [
{
id: 'NoticeBar',
name: '通告栏'
id: 'Avatar',
name: '头像'
},
{
id: 'Article',
name: '文章'
},
{
id: 'Badge',
name: '徽标'
},
{
id: 'Tag',
name: '标签'
id: 'NoticeBar',
name: '通告栏'
},
{
id: 'Avatar',
name: '头像'
id: 'Tag',
name: '标签'
},
{
id: 'Article',
name: '文章'
id: 'Timeline',
name: '时间轴'
}
],
'action': [
Expand Down Expand Up @@ -151,13 +155,13 @@ export default class PanelBasic extends Component {
id: 'List',
name: '列表'
},
{
id: 'Float-Layout',
name: '浮层'
},
{
id: 'Card',
name: '卡片'
},
{
id: 'Float-Layout',
name: '浮层'
}
],
'navigation': [
Expand All @@ -177,10 +181,6 @@ export default class PanelBasic extends Component {
id: 'Segmented-Control',
name: '分段器'
},
{
id: 'Timeline',
name: '时间轴'
},
{
id: 'Pagination',
name: '分页器'
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 1dccf04

Please sign in to comment.