Merge pull request #303 from AppFlowy-IO/feat/commit_lint

Feat/commit lint
This commit is contained in:
Nathan.fooo 2022-02-04 20:27:42 +08:00 committed by GitHub
commit 92b3f3e769
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 11 deletions

12
.github/workflows/commitlint.yml vendored Normal file
View File

@ -0,0 +1,12 @@
name: Lint Commit Messages
on: [pull_request, push]
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4

4
.husky/commit-msg Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no -- commitlint --edit

1
commitlint.config.js Normal file
View File

@ -0,0 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']}

View File

@ -1,6 +1,7 @@
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/notifier.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra_ui/style_widget/icon_button.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flutter/material.dart';
@ -81,6 +82,7 @@ class FlowyNavigation extends StatelessWidget {
}
Widget _renderCollapse(BuildContext context, PublishNotifier<bool> collapsedNotifier) {
final theme = context.watch<AppTheme>();
return ChangeNotifierProvider.value(
value: collapsedNotifier,
child: Consumer(
@ -94,7 +96,7 @@ class FlowyNavigation extends StatelessWidget {
notifier.value = false;
},
iconPadding: const EdgeInsets.fromLTRB(2, 2, 2, 2),
icon: svg("home/hide_menu"),
icon: svg("home/hide_menu", color: theme.iconColor),
),
);
} else {

View File

@ -1,7 +1,9 @@
import 'dart:math';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class FlowyIconButton extends StatelessWidget {
final double width;
@ -30,16 +32,6 @@ class FlowyIconButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
Widget child = icon;
// if (onPressed == null) {
// child = ColorFiltered(
// colorFilter: ColorFilter.mode(
// Colors.grey,
// BlendMode.saturation,
// ),
// child: child,
// );
// }
final size = Size(width, height ?? width);
assert(size.width > iconPadding.horizontal);