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

523: Configure theme #708

Merged
merged 1 commit into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions frontend/build-configs/bayern/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export const bayernCommon: CommonBuildConfigType = {
},
categories: [1, 2, 3],
theme: {
primaryColor: "#123456",
secondaryColor: "#123456"
primaryLight: "#5f5384",
primaryDark: "#8377A9"
},
mapStyleUrl: {
production: "https://api.entitlementcard.app/project/bayern.ehrenamtskarte.app/map",
Expand Down
6 changes: 3 additions & 3 deletions frontend/build-configs/nuernberg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export const nuernbergCommon: CommonBuildConfigType = {
},
categories: [],
theme: {
primaryColor: "#123456",
secondaryColor: "#123456"
primaryLight: "#D88C51",
primaryDark: "#F9B787"
},
mapStyleUrl: {
production: "https://api.entitlementcard.app/project/nuernberg.sozialpass.app/map",
Expand All @@ -38,7 +38,7 @@ export const nuernbergCommon: CommonBuildConfigType = {
bodyLabel: "Nürnberg-Pass",
bodyTextColor: "#000000",
bodyBackgroundImage: true,
bodyBackgroundImageUrl:"assets/nuernberg/background.png",
bodyBackgroundImageUrl: "assets/nuernberg/background.png",
colorStandard: "#F9B787",
colorPremium: "#F9B787",
boxDecorationRadius: 0,
Expand Down
8 changes: 4 additions & 4 deletions frontend/build-configs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ type BuildConfigType = {
export type FeatureFlagsType = {}

export type ThemeType = {
primaryColor: string,
secondaryColor: string
primaryLight: string,
primaryDark: string
}

export type CommonBuildConfigType = {
Expand Down Expand Up @@ -36,12 +36,12 @@ export type CommonBuildConfigType = {
headerTitleRight: string,
headerLogo: string,
headerLogoPadding: number,
headerContainerPadding: {top:number, left: number; bottom: number, right: number}
headerContainerPadding: { top: number, left: number; bottom: number, right: number }
headerTextFontSize: number,
bodyTextColor: string,
colorPremium: string,
colorStandard: string,
bodyContainerPadding: {top:number, left: number; bottom: number, right: number}
bodyContainerPadding: { top: number, left: number; bottom: number, right: number }
bodyLogo: string,
bodyLogoPosition: string,
bodyLabel: string,
Expand Down
14 changes: 8 additions & 6 deletions frontend/lib/themes.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import 'package:ehrenamtskarte/build_config/build_config.dart';
import 'package:ehrenamtskarte/util/color_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

ThemeData get lightTheme {
const defaultTypography = Typography.blackMountainView;
final lightTheme = ThemeData.from(
colorScheme: const ColorScheme.light(
primary: Color(0xff5f5384),
secondary: Color(0xff5f5384),
colorScheme: ColorScheme.light(
primary: getColorFromHex(buildConfig.theme.primaryLight),
secondary: getColorFromHex(buildConfig.theme.primaryLight),
),
textTheme: defaultTypography.copyWith(
headline4: defaultTypography.headline4?.apply(color: Colors.black87),
Expand All @@ -31,9 +33,9 @@ ThemeData get lightTheme {
ThemeData get darkTheme {
const defaultTypography = Typography.whiteMountainView;
final theme = ThemeData.from(
colorScheme: const ColorScheme.dark(
primary: Color(0xff8377A9),
secondary: Color(0xff8377A9),
colorScheme: ColorScheme.dark(
primary: getColorFromHex(buildConfig.theme.primaryDark),
secondary: getColorFromHex(buildConfig.theme.primaryDark),
),
textTheme: defaultTypography.copyWith(
headline4: defaultTypography.headline4?.apply(color: Colors.white),
Expand Down