diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/create-character/create-character.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/create-character/create-character.component.css index 6f087b8..ec7cb8f 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/create-character/create-character.component.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/create-character/create-character.component.css @@ -61,6 +61,14 @@ input { } } +@media (max-width: 400px) { + .container { + margin-left: 0%; + width: 300px; + padding-top: 5%; + } +} + @media (min-width: 401px) { .container { margin-left: 1%; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/create-character/create-character.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/create-character/create-character.component.html index dc1f3d8..24b8003 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/create-character/create-character.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/create-character/create-character.component.html @@ -6,8 +6,8 @@ account_circle -
{{character.name}}
- arrow_forward +
{{character.name}}
+ arrow_forward
{{character.class}}, {{character.race}}
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/create-character/create-character.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/create-character/create-character.component.ts index 1c821b2..7b1256f 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/create-character/create-character.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/create-character/create-character.component.ts @@ -7,28 +7,43 @@ import { ErrorResponse } from '../../../types/ErrorResponse'; import { HttpErrorResponse } from '@angular/common/http'; import { CharacterFromTemplatesViewModel } from '../../../types/viewmodels/character-viewmodels/CharacterFromTemplatesViewModel'; import { CharacterService } from '../../../services/character.service'; -import { CreateCharacterFromTemplate } from '../../store/actions/player.action'; +import { + ChooseTemplateToCreateCharacter, + ClearCharacterId, +} from '../../store/actions/player.action'; @Component({ selector: 'app-create-character', templateUrl: './create-character.component.html', - styleUrls: ['./create-character.component.css'] + styleUrls: ['./create-character.component.css'], }) export class CreateCharacterComponent implements OnInit { charactersTemplateList: CharacterFromTemplatesViewModel[]; - constructor(private router: Router, private store: Store, private characterService: CharacterService) { } + constructor( + private router: Router, + private store: Store, + private characterService: CharacterService + ) {} ngOnInit() { this.getTemplateCharacters(); } onArrowBackClick() { - this.router.navigate(['select-character']); + this.store + .select((s) => s.playerStore.characterId) + .pipe(first()) + .subscribe((characterId) => { + if (characterId !== null) { + this.store.dispatch(new ClearCharacterId()); + } + this.router.navigate(['select-character']); + }); } - onCharacterClick() { - this.store.dispatch(new CreateCharacterFromTemplate); + onCharacterClick(characterId: number) { + this.store.dispatch(new ChooseTemplateToCreateCharacter({ characterId })); this.router.navigate(['create-character-step-2']); } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/personalize-template/personalize-template.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/personalize-template/personalize-template.component.html index 3da7f72..bc60759 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/personalize-template/personalize-template.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/personalize-template/personalize-template.component.html @@ -1,7 +1,23 @@ -
+
arrow_back
Create character
Step 2 - Personalize template
+ + + + If the field is left blank, your character will have the default name + + person + + + {{apiErrorMessage}} +