Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add art & design category to explore page #1803

Merged
merged 4 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/app_center/lib/explore/explore_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ class ExplorePage extends ConsumerWidget {
showScreenshots: true,
onlyFeatured: true,
),
SliverList.list(
children: const [
SizedBox(height: 56),
CategoryBanner(category: SnapCategoryEnum.artAndDesign),
SizedBox(height: kPagePadding),
],
),
const CategorySnapList(
category: SnapCategoryEnum.artAndDesign,
hideBannerSnaps: true,
),
SliverList.list(
children: [
const SizedBox(height: 56),
Expand Down
3 changes: 3 additions & 0 deletions packages/app_center/lib/snapd/snap_category_enum.dart
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ enum SnapCategoryEnum {
};

String slogan(AppLocalizations l10n) => switch (this) {
artAndDesign => l10n.snapCategoryArtAndDesignSlogan,
development => l10n.snapCategoryDevelopmentSlogan,
featured => l10n.snapCategoryFeaturedSlogan,
games => l10n.snapCategoryGamesSlogan,
Expand All @@ -211,6 +212,7 @@ enum SnapCategoryEnum {

String buttonLabel(AppLocalizations l10n) => switch (this) {
productivity => l10n.snapCategoryProductivityButtonLabel,
artAndDesign => l10n.snapCategoryArtAndDesignButtonLabel,
_ => l10n.snapCategoryDefaultButtonLabel,
};

Expand Down Expand Up @@ -248,6 +250,7 @@ enum SnapCategoryEnum {

// TODO: map remaining categories to colors once the design is ready
List<Color> get bannerColors => switch (this) {
artAndDesign => _kBannerColors[4],
development => _kBannerColors[9],
featured => _kBannerColors[2],
productivity => _kBannerColors[4],
Expand Down
2 changes: 2 additions & 0 deletions packages/app_center/lib/src/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@
"snapCategoryAll": "All categories",
"snapActionUpdatingLabel": "Updating",
"snapCategoryArtAndDesign": "Art and Design",
"snapCategoryArtAndDesignButtonLabel": "Start creating",
"snapCategoryArtAndDesignSlogan": "From your first sketch to the final touch, explore apps for art and design.",
"snapCategoryBooksAndReference": "Books and Reference",
"snapCategoryDefaultButtonLabel": "Discover more",
"snapCategoryDevelopment": "Development",
Expand Down
Loading