-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from e-picsa/feat/global-demo
feat: add global configuration
- Loading branch information
Showing
20 changed files
with
274 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 2 additions & 5 deletions
7
libs/components/src/components/configuration-select/configuration-select-dialog.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
libs/components/src/components/configuration-select/configuration-select.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
<button mat-button color="primary" (click)="openLanguageSelect()"> | ||
<img class="language-summary-flag" [src]="image" /> | ||
<span class="language-label">{{ label }}</span> | ||
<div style="display: flex; align-items: center"> | ||
<img class="language-summary-flag" [src]="image" /> | ||
<span class="language-label">{{ label }}</span> | ||
</div> | ||
</button> |
3 changes: 2 additions & 1 deletion
3
libs/components/src/components/configuration-select/configuration-select.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
:host { | ||
height: 36px; | ||
display: flex; | ||
justify-content: center; | ||
} | ||
img.language-summary-flag { | ||
height: 30px; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import mw from './configurations/mw'; | ||
import tj from './configurations/tj'; | ||
import zm from './configurations/zm'; | ||
import global from './configurations/global'; | ||
|
||
/** Configurations define different environments that can be set at runtime */ | ||
export const CONFIGURATIONS = [mw, zm, tj]; | ||
export const CONFIGURATIONS = [mw, zm, tj, global]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { IConfiguration } from '../types'; | ||
|
||
const configuration: IConfiguration.Settings = { | ||
id: 'demo', | ||
android: {}, | ||
budgetTool: { | ||
currency: '$', | ||
currencyBaseValue: 1, | ||
}, | ||
climateTool: { | ||
// include all stations | ||
stationFilter: () => true, | ||
}, | ||
|
||
localisation: { | ||
country: { | ||
label: 'Global', | ||
code: '', | ||
image: 'assets/images/flags/global.svg', | ||
}, | ||
language: { | ||
options: [ | ||
{ id: 'en', label: 'English', code: 'en' }, | ||
{ id: 'ny', label: 'Chichewa', code: 'ny' }, | ||
{ id: 'tg', label: 'Тоҷикӣ', code: 'tg' }, | ||
], | ||
selected: undefined, | ||
}, | ||
}, | ||
theme: 'picsa-global', | ||
}; | ||
export default configuration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
@use '@angular/material' as mat; | ||
|
||
@include mat.core(); | ||
|
||
// http://mcg.mbitson.com/#!?mcgpalette0=%23ef7d00&themename=mcgtheme | ||
$primary: ( | ||
50: #f1e5e9, | ||
100: #dcbec7, | ||
200: #c593a2, | ||
300: #ad677c, | ||
400: #9c4760, | ||
500: #8a2644, | ||
600: #82223e, | ||
700: #771c35, | ||
800: #6d172d, | ||
900: #5a0d1f, | ||
A100: #ff90a5, | ||
A200: #ff5d7b, | ||
A400: #ff2a52, | ||
A700: #ff103d, | ||
contrast: ( | ||
50: #000000, | ||
100: #000000, | ||
200: #000000, | ||
300: #ffffff, | ||
400: #ffffff, | ||
500: #ffffff, | ||
600: #ffffff, | ||
700: #ffffff, | ||
800: #ffffff, | ||
900: #ffffff, | ||
A100: #000000, | ||
A200: #000000, | ||
A400: #ffffff, | ||
A700: #ffffff, | ||
), | ||
); | ||
$accent: ( | ||
50: #f4e4e4, | ||
100: #e3baba, | ||
200: #d18d8d, | ||
300: #bf5f5f, | ||
400: #b13c3c, | ||
500: #a31a1a, | ||
600: #9b1717, | ||
700: #911313, | ||
800: #880f0f, | ||
900: #770808, | ||
A100: #ffa7a7, | ||
A200: #ff7474, | ||
A400: #ff4141, | ||
A700: #ff2727, | ||
contrast: ( | ||
50: #000000, | ||
100: #000000, | ||
200: #000000, | ||
300: #ffffff, | ||
400: #ffffff, | ||
500: #ffffff, | ||
600: #ffffff, | ||
700: #ffffff, | ||
800: #ffffff, | ||
900: #ffffff, | ||
A100: #000000, | ||
A200: #000000, | ||
A400: #ffffff, | ||
A700: #ffffff, | ||
), | ||
); | ||
|
||
// Define the palettes for your theme using the Material Design palettes available in palette.scss | ||
// (imported above). For each palette, you can optionally specify a default, lighter, and darker | ||
// hue. Available color palettes: https://material.io/design/color/ | ||
$palette-primary: mat.define-palette($primary); | ||
$palette-accent: mat.define-palette($accent, A200, A100, A400); | ||
|
||
// The warn palette is optional (defaults to red). | ||
$palette-warn: mat.define-palette(mat.$red-palette); | ||
|
||
// Create the theme object (a Sass map containing all of the palettes). | ||
$theme-global: mat.define-light-theme( | ||
$palette-primary, | ||
$palette-accent, | ||
$palette-warn | ||
); | ||
|
||
// .theme-global { | ||
// @include mat.all-component-themes($picsa-global); | ||
// } | ||
body[data-theme='picsa-global'] { | ||
@include mat.all-component-themes($theme-global); | ||
|
||
--color-primary: #{map-get($palette-primary, 500)}; | ||
--color-primary-50: #{map-get($palette-primary, 50)}; | ||
--color-secondary: #{map-get($palette-accent, 500)}; | ||
--color-black: #1a2138; | ||
--color-light: #d8d8d8; | ||
--color-white: #ffffff; | ||
} |
Oops, something went wrong.