-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add getters for tstore access, feeding the consistency hobgoblin - include timezone in toLocaleTimeString - move logo style into portOfMarsLogoProps - remove dead code, unused props and attributes, etc.
- Loading branch information
Showing
3 changed files
with
38 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,18 +15,12 @@ [email protected] | |
<b-link :to="solo" title="Solo Mode">Solo Mode</b-link> | ||
</li> | ||
<li> | ||
<b-link | ||
v-if="$tstore.state.isFreePlayEnabled" | ||
:to="freePlayLobby" | ||
title="Port of Mars Free Play" | ||
<b-link v-if="isFreePlayEnabled" :to="freePlayLobby" title="Port of Mars Free Play" | ||
>Free Play</b-link | ||
> | ||
</li> | ||
<li> | ||
<b-link | ||
v-if="$tstore.state.isFreePlayEnabled" | ||
:to="tournamentDashboard" | ||
title="Join Mars Madness" | ||
<b-link v-if="isTournamentEnabled" :to="tournamentDashboard" title="Join Mars Madness" | ||
>Join Mars Madness</b-link | ||
> | ||
</li> | ||
|
@@ -132,6 +126,14 @@ export default class Footer extends Vue { | |
get constants() { | ||
return Constants; | ||
} | ||
|
||
get isTournamentEnabled() { | ||
return this.$tstore.state.isTournamentEnabled; | ||
} | ||
|
||
get isFreePlayEnabled() { | ||
return this.$tstore.state.isFreePlayEnabled; | ||
} | ||
} | ||
</script> | ||
|
||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<b-navbar tag="header" toggleable="xl" type="dark" variant="dark" class="w-100" fixed="top"> | ||
<b-navbar-brand :to="home"> | ||
<b-img | ||
id="logo" | ||
class="logo" | ||
v-bind="portOfMarsLogoProps" | ||
:src="$getAssetUrl(`images/logo-Port-of-Mars-White.svg`)" | ||
alt="the planet mars illustrated in white above Port of Mars" | ||
|
@@ -17,8 +17,9 @@ | |
:to="admin" | ||
exact-active-class="active" | ||
title="Admin Dashboard" | ||
>Admin</b-nav-item | ||
> | ||
Admin | ||
</b-nav-item> | ||
<b-nav-item class="mx-2" :to="about" exact-active-class="active" title="About Port of Mars" | ||
>About</b-nav-item | ||
> | ||
|
@@ -31,8 +32,9 @@ | |
target="_blank" | ||
exact-active-class="active" | ||
title="Game Manual" | ||
>Manual</b-nav-item | ||
> | ||
Manual | ||
</b-nav-item> | ||
<b-nav-item class="mx-2" :to="leaderboard" exact-active-class="active" title="Leaderboard" | ||
>Leaderboard</b-nav-item | ||
> | ||
|
@@ -45,21 +47,21 @@ | |
Solo Mode | ||
</b-nav-item> | ||
<b-nav-item | ||
v-if="$tstore.state.isFreePlayEnabled" | ||
v-if="isFreePlayEnabled" | ||
class="mx-2 text-nowrap" | ||
:to="freePlayLobby" | ||
exact-active-class="active" | ||
title="Free Play (Open) Game Lobby" | ||
title="Free Play Game Lobby" | ||
> | ||
Free Play | ||
</b-nav-item> | ||
<b-nav-item | ||
v-if="$tstore.state.isTournamentEnabled" | ||
v-if="isTournamentEnabled" | ||
class="mx-2 text-nowrap" | ||
link-classes="btn btn-success text-white" | ||
:to="tournamentDashboard" | ||
exact-active-class="active" | ||
title="Free Play (Open) Game Lobby" | ||
title="Tournament Dashboard" | ||
> | ||
<b>Join Mars Madness</b> | ||
</b-nav-item> | ||
|
@@ -94,7 +96,7 @@ | |
</template> | ||
|
||
<script lang="ts"> | ||
import { Component, Prop, Vue } from "vue-property-decorator"; | ||
import { Component, Vue } from "vue-property-decorator"; | ||
import { | ||
ADMIN_PAGE, | ||
HOME_PAGE, | ||
|
@@ -110,20 +112,14 @@ import { | |
PROFILE_PAGE, | ||
TOURNAMENT_DASHBOARD_PAGE, | ||
} from "@port-of-mars/shared/routes"; | ||
import { isDevOrStaging, Constants } from "@port-of-mars/shared/settings"; | ||
import { Constants } from "@port-of-mars/shared/settings"; | ||
import _ from "lodash"; | ||
@Component({}) | ||
export default class Navbar extends Vue { | ||
@Prop({ default: "Mission Control Dashboard" }) | ||
title!: string; | ||
isDevMode: boolean = false; | ||
contactUrl: string = "mailto:[email protected]"; | ||
portOfMarsLogoProps = { | ||
height: 60, | ||
width: 200, | ||
}; | ||
readonly SITE_URL = "https://portofmars.asu.edu"; | ||
|
@@ -141,15 +137,6 @@ export default class Navbar extends Vue { | |
freePlayLobby = { name: FREE_PLAY_LOBBY_PAGE }; | ||
profile = { name: PROFILE_PAGE }; | ||
async created() { | ||
this.isDevMode = isDevOrStaging(); | ||
} | ||
mounted() { | ||
console.log("route name: ", this.$route.name); | ||
console.log("route.name = login", this.$route.name == this.login.name); | ||
} | ||
get constants() { | ||
return Constants; | ||
} | ||
|
@@ -166,12 +153,12 @@ export default class Navbar extends Vue { | |
return this.$tstore.getters.isAdmin; | ||
} | ||
get isInGame() { | ||
if (_.isNil(this.$route.name)) { | ||
return false; | ||
} else { | ||
return this.game.name == this.$route.name || this.freePlayLobby.name == this.$route.name; | ||
} | ||
get isTournamentEnabled() { | ||
return this.$tstore.state.isTournamentEnabled; | ||
} | ||
get isFreePlayEnabled() { | ||
return this.$tstore.state.isFreePlayEnabled; | ||
} | ||
logout() { | ||
|
@@ -182,8 +169,4 @@ export default class Navbar extends Vue { | |
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
#logo { | ||
width: 200px; | ||
} | ||
</style> | ||
<style lang="scss" scoped></style> |
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