Skip to content

Commit

Permalink
localize sass vars + make flasmessages static
Browse files Browse the repository at this point in the history
  • Loading branch information
IceMaD committed Feb 20, 2016
1 parent d1badcd commit da2b6a5
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 45 deletions.
10 changes: 5 additions & 5 deletions app/sass/component/flash/_flash-message.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
$text-color: $snow-white;
$info-background-color: $perano-blue;
$danger-background-color: $blush-pink;
$warning-background-color: $gold-yellow;

@include component(flash-message) {

$text-color: $snow-white;
$info-background-color: $perano-blue;
$danger-background-color: $blush-pink;
$warning-background-color: $gold-yellow;

display: block;
padding: 1em;

Expand Down
6 changes: 3 additions & 3 deletions app/sass/component/global/_button.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
$default-background-color: $perano-blue;
$default-text-color: $snow-white;

@include component(button) {

$default-background-color: $perano-blue;
$default-text-color: $snow-white;

padding: 0.5em 1.5em;
text-decoration: none;
background-color: $default-background-color;
Expand Down
6 changes: 3 additions & 3 deletions app/sass/component/global/_message.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
$error-text-color: $blush-pink;
$success-text-color: $granny-green;

@include component(message) {

$error-text-color: $blush-pink;
$success-text-color: $granny-green;

display: flex;
align-items: center;

Expand Down
6 changes: 3 additions & 3 deletions app/sass/component/global/_tooltip.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
$background-color: $perano-blue;
$text-color: $snow-white;

@include component(tooltip) {

$background-color: $perano-blue;
$text-color: $snow-white;

position: fixed;
background-color: $background-color;
color: $text-color;
Expand Down
12 changes: 6 additions & 6 deletions app/sass/component/team/_team-form.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
$disabled-background-color: $alto-grey;
$disabled-border-color: darken($disabled-background-color, 15%);
$submit-text-color: $snow-white;
$submit-background-color: $granny-green;
$submit-border-color: darken($submit-background-color, 15%);

@include component(team-form) {

$disabled-background-color: $alto-grey;
$disabled-border-color: darken($disabled-background-color, 15%);
$submit-text-color: $snow-white;
$submit-background-color: $granny-green;
$submit-border-color: darken($submit-background-color, 15%);

margin: 1em 0;
display: flex;

Expand Down
8 changes: 4 additions & 4 deletions app/sass/component/team/_team.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
$border-color: $alto-grey;
@include component(team) {

$remove-background-color: $blush-pink;
$remove-text-color: $snow-white;
$border-color: $alto-grey;

@include component(team) {
$remove-background-color: $blush-pink;
$remove-text-color: $snow-white;

padding: 0.5em 0;
box-shadow: shadow-border("bottom", $border-color);
Expand Down
17 changes: 9 additions & 8 deletions app/sass/component/tree/_node.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
$title-background-color: $snow-white;
$title-border-color: $alto-grey;
$title-text-color: $text-color;

$winner-background-color: $gold-yellow;
$won-background-color: $granny-green;
$lost-background-color: $blush-pink;

@mixin node-title-variant($color) {

@include modifier(winner) {

background-color: lighten($color, 10%);
Expand All @@ -20,6 +13,14 @@ $lost-background-color: $blush-pink;

@include component(node) {

$title-background-color: $snow-white;
$title-border-color: $alto-grey;
$title-text-color: $text-color;

$winner-background-color: $gold-yellow;
$won-background-color: $granny-green;
$lost-background-color: $blush-pink;

display: flex;
flex-direction: row-reverse;
align-items: center;
Expand Down
6 changes: 1 addition & 5 deletions app/ts/Components/TournamentAppComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ export class TournamentAppComponent {

private flashMessages: FlashMessageModel[];

constructor(
private _flashService: FlashService
) {}

ngOnInit() {
this.flashMessages = this._flashService.get();
this.flashMessages = FlashService.list;
}
}
6 changes: 3 additions & 3 deletions app/ts/Services/FlashService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import {FlashMessageModel} from "../Models/FlashMessageModel";

export class FlashService {

private _list: FlashMessageModel[] = [];
private static _list: FlashMessageModel[] = [];

push(message: string, type: string = null): this {
public static push(message: string, type: string = null): this {
this._list.push(new FlashMessageModel(message, type));

setTimeout(() => {
Expand All @@ -14,7 +14,7 @@ export class FlashService {
return this;
}

get(): FlashMessageModel[] {
static get list():FlashMessageModel[] {
return this._list;
}
}
4 changes: 3 additions & 1 deletion app/ts/Services/TreeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ export class TreeManager {
}
}

nodes[0].last = true;

this._nodes = this._nodes.concat(nodes);

nodes[0].last = true;
console.log(nodes);

return nodes[0];
}
Expand Down
5 changes: 1 addition & 4 deletions app/ts/Views/TreeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,20 @@ import {NodeComponent} from "../Components/NodeComponent";
})

export class TreeView {
public teams: TeamModel[] = [];
private tree: Object;

constructor(
private _flashService: FlashService,
private _router: Router
) {}

ngOnInit() {
if (!TeamHolderService.isFilled()) {
this._flashService.push('Vous devez renseigner 2, 4, 8, 16 ou 32 équipes');
FlashService.push('Vous devez renseigner 2, 4, 8, 16 ou 32 équipes');
this._router.navigate(['TeamManagement']);

return;
}

this.teams = TeamHolderService.teams;
this.tree = TeamHolderService.tree;
}
}

0 comments on commit da2b6a5

Please sign in to comment.