Skip to content

Commit

Permalink
Merge pull request #708 from digitalfabrik/523-configure-theme
Browse files Browse the repository at this point in the history
523: Configure theme
  • Loading branch information
f1sh1918 authored Jan 11, 2023
2 parents 56f4800 + ce5dd1a commit 5743185
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
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

0 comments on commit 5743185

Please sign in to comment.