Skip to content

Commit

Permalink
feat: display version
Browse files Browse the repository at this point in the history
  • Loading branch information
soni801 committed Jun 9, 2024
1 parent 8946612 commit 44ec122
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xwars-web",
"version": "0.0.0",
"version": "0.3.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
1 change: 1 addition & 0 deletions src/app/home/home.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<div id="home" class="flex column full-size center">
<h1>The Great X Wars</h1>
<p id="version-data">Version {{version}}</p>
<div id="navigation" class="flex column center">
<a class="button" routerLink="/play">Play</a>
<a class="button" routerLink="/about">About</a>
Expand Down
8 changes: 8 additions & 0 deletions src/app/home/home.component.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
@use '../../variables';

#version-data
{
color: variables.$button-foreground;
transform: translateY(-3rem);
}

#navigation
{
gap: 1.5rem;
Expand Down
12 changes: 4 additions & 8 deletions src/app/home/home.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import { Component, OnInit } from '@angular/core';
import {Component} from '@angular/core';
import packageData from '../../../package.json';

@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {

constructor() { }

ngOnInit(): void {
}

export class HomeComponent {
protected version: string = packageData.version;
}
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"target": "ES2022",
"module": "es2020",
"lib": [
Expand Down

0 comments on commit 44ec122

Please sign in to comment.