Skip to content

Commit

Permalink
fix: x logos
Browse files Browse the repository at this point in the history
  • Loading branch information
Arenukvern committed Mar 5, 2024
1 parent 7311e85 commit 1bd0a3e
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 93 deletions.
45 changes: 21 additions & 24 deletions lib/settings/features/characters_limit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,11 @@ class CharactersLimitSetting extends HookWidget {
}
// TODO(arenukvern): refactor to separate widget

SvgGenImage twitterIcon;
if (controller.isTwitterLimit) {
twitterIcon = Assets.icons.twitterLogoBlue;
AssetGenImage xIcon;
if (controller.isXLimit) {
xIcon = dark ? Assets.icons.xLogoBlack : Assets.icons.xLogoWhite;
} else {
twitterIcon =
dark ? Assets.icons.twitterLogoWhite : Assets.icons.twitterLogoBlack;
xIcon = dark ? Assets.icons.xLogoWhite : Assets.icons.xLogoBlack;
}
// TODO(arenukvern): refactor to separate widget

Expand All @@ -107,25 +106,20 @@ class CharactersLimitSetting extends HookWidget {
children: [
CharactersLimitButton(
onTap: controller.onSetInstagramLimit,
child: ImageGenIcon(
genImage: instagramIcon,
dimension: 18,
child: instagramIcon.image(
colorBlendMode: BlendMode.srcIn,
width: 18,
height: 18,
color: controller.isInstagramLimit
? null
: theme.textTheme.bodyMedium?.color,
),
),
CharactersLimitButton(
onTap: controller.onSetTwitterLimit,
child: twitterIcon.svg(
width: 16,
height: 16,
colorFilter: ColorFilter.mode(
controller.isTwitterLimit
? AppColors.twitterBlue
: theme.textTheme.bodyMedium?.color ?? AppColors.twitterBlue,
BlendMode.src,
),
child: ImageGenIcon(
genImage: xIcon,
dimension: 18,
),
),
CharactersLimitButton(
Expand Down Expand Up @@ -165,14 +159,17 @@ class CharactersLimitButton extends StatelessWidget {
final Widget child;

@override
Widget build(final BuildContext context) => HoverableButton(
onPressed: onTap,
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 3,
horizontal: 3,
Widget build(final BuildContext context) => Card(
color: context.colorScheme.primaryContainer,
child: HoverableButton(
onPressed: onTap,
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 3,
horizontal: 3,
),
child: child,
),
child: child,
),
);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/settings/features/characters_limit_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ class CharactersLimitController extends ValueNotifier<CharacterLimitState> {

static const int twitterLimit = 280;
static const String twitterLimitStr = '$twitterLimit';
bool get isTwitterLimit => limit == twitterLimitStr;
bool get isXLimit => limit == twitterLimitStr;
void onSetTwitterLimit() {
final newLimit = isTwitterLimit ? 0 : twitterLimit;
final newLimit = isXLimit ? 0 : twitterLimit;
setLimit(newLimit);
}

Expand Down
13 changes: 0 additions & 13 deletions packages/core/assets/icons/twitter_logo_black.svg

This file was deleted.

16 changes: 0 additions & 16 deletions packages/core/assets/icons/twitter_logo_blue.svg

This file was deleted.

16 changes: 0 additions & 16 deletions packages/core/assets/icons/twitter_logo_white.svg

This file was deleted.

Binary file added packages/core/assets/icons/x_logo_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/assets/icons/x_logo_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@ class ProjectIsarCollection with IsarEquatableMixin {
DateTime? updatedAt;
List<String> tags = [];
String type = ProjectTypes.note.name;

@Index()
List<String> get contentWords => jsonContent.split(' ');
}
27 changes: 11 additions & 16 deletions packages/core/lib/src/generated/assets.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions packages/core/lib/src/theme/app_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,4 @@ class AppColors {

/// #FFBFBD
static const accent5 = Color(0xFFFFBFBD);

/// #1D9BF0
static const twitterBlue = Color(0xFF1D9BF0);
}

0 comments on commit 1bd0a3e

Please sign in to comment.