Skip to content

Commit

Permalink
Merge pull request #763 from nanu-c/layouts
Browse files Browse the repository at this point in the history
[axolotl-web]: Add a default layout
  • Loading branch information
nanu-c authored Mar 15, 2022
2 parents e994351 + 8c683c5 commit f7c4f20
Show file tree
Hide file tree
Showing 60 changed files with 5,646 additions and 3,991 deletions.
15 changes: 15 additions & 0 deletions axolotl-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions axolotl-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@fortawesome/fontawesome-svg-core": "^1.3.0",
"@fortawesome/free-solid-svg-icons": "^6.0.0",
"@fortawesome/vue-fontawesome": "^3.0.0-5",
"@popperjs/core": "^2.11.2",
"bootstrap": "^5.1.3",
"core-js": "^3.20.3",
"file-saver": "^2.0.5",
Expand Down
12 changes: 3 additions & 9 deletions axolotl-web/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<template>
<div id="app" @click="checkDebug">
<header-comp />
<main class="container">
<error-modal v-if="error" />
<router-view />
</main>
<error-modal v-if="error" />
<router-view />
</div>
</template>

Expand All @@ -28,14 +25,12 @@ if (window.getCookie("darkMode") === "true") {
} else {
import("./assets/light.scss");
}
import {router} from "./router/router";
import HeaderComp from "@/components/Header.vue";
import { router } from "./router/router";
import ErrorModal from "@/components/ErrorModal.vue";
export default {
name: "AxolotlWeb",
components: {
HeaderComp,
ErrorModal,
},
data() {
Expand Down Expand Up @@ -80,7 +75,6 @@ export default {
html,
body,
#app {
height: 100%;
font-family: "ubuntu";
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,39 +361,6 @@
</div>
</div>
</div>
<!-- chat list page -->
<div v-else-if="route() === 'chatList'" class="settings-container row">
<div v-if="errorConnection !== null" class="connection-error" />
<div class="dropdown d-flex justify-content-end">
<button
id="dropdownMenuButton"
class="btn"
type="button"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
@click="toggleSettings"
>
<font-awesome-icon icon="ellipsis-v" />
</button>
<div
v-if="showSettingsMenu"
id="settings-dropdown"
class="dropdown-menu"
aria-labelledby="dropdownMenuButton"
>
<router-link v-translate class="dropdown-item" :to="'/contacts/'">
Contacts
</router-link>
<router-link v-translate class="dropdown-item" :to="'/newGroup'">
New group
</router-link>
<router-link v-translate class="dropdown-item" :to="'/settings/'">
Settings
</router-link>
</div>
</div>
</div>
<div v-else>
<!-- <button class="back btn" @click="back()">
<font-awesome-icon icon="arrow-left" /></button> -->
Expand Down Expand Up @@ -614,8 +581,6 @@ export default {
padding: 5px 0;
background-color: #2090ea;
z-index: 2;
-webkit-box-shadow: 0px -11px 14px 7px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0px -11px 14px 7px rgba(0, 0, 0, 0.75);
box-shadow: 0px -11px 14px 7px rgba(0, 0, 0, 0.75);
min-height: 49px;
}
Expand Down
83 changes: 83 additions & 0 deletions axolotl-web/src/layouts/Default.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<template>
<div class="base-layout">
<header :class="currentRoute + ' header fixed-top'">
<div class="container">
<div class="header-row row">
<div class="col-2 header-left">
<button
v-if="$route.meta.hasBackButton"
class="btn"
@click="back()"
>
<font-awesome-icon icon="arrow-left" />
</button>
</div>
<div class="col-8 header-center">
<slot name="header" />
</div>
<div class="col-2 header-right justify-content-end d-flex">
<div class="dropdown">
<button
id="dropdownMenuButton"
class="btn btn-primary"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
<font-awesome-icon icon="ellipsis-v" />
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<slot name="menu" />
</ul>
</div>
</div>
</div>
</div>
</header>
<main class="container">
<slot />
</main>
<footer>
<slot name="footer" />
</footer>
</div>
</template>
<script>
export default {
name: "DefaultLayout",
data: () => ({
showMenu: false,
}),
computed: {
currentRoute() {
return this.$route.name;
},
},
methods: {
back() {
this.$router.back();
},
toggleMenu() {
this.showMenu = !this.showMenu;
},
},
};
</script>
<style scoped>
.header {
padding: 5px 0;
background-color: #2090ea;
z-index: 2;
box-shadow: 0px -11px 14px 7px rgba(0, 0, 0, 0.75);
min-height: 49px;
}
#dropdownMenuButton {
color: #fff;
}
.dropdown-menu {
border: 1px solid #2090ea;
}
main {
padding-top: 50px;
}
</style>
27 changes: 27 additions & 0 deletions axolotl-web/src/layouts/Legacy.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<div class="legacy-layout">
<header>
<legacy-header />
</header>
<main class="container">
<slot />
</main>
<footer>
<slot name="footer" />
</footer>
</div>
</template>
<script>
import LegacyHeader from "@/components/LegacyHeader.vue";
export default {
name: "LegacyLayout",
components: {
LegacyHeader,
},
};
</script>
<style scoped>
.legacy-layout {
height: 100vh;
}
</style>
1 change: 1 addition & 0 deletions axolotl-web/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import translations from '../translations/translations.json'
import { library } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import linkifyHTML from 'linkify-html'
import 'bootstrap';

import {
faArrowDown,
Expand Down
72 changes: 37 additions & 35 deletions axolotl-web/src/pages/About.vue
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
<template>
<div class="about">
<img class="logo" src="/axolotl.png" alt="Axolotl logo">
<h1 class="title">Axolotl Beta {{ config.Version }}</h1>
<h2 v-translate class="subtitle">A cross-platform Signal client</h2>
<div class="description">
<translate>
This is a free and open source Signal client written in golang and
vuejs.
</translate>
<br>
<translate class="mr-1">
You can support the development of Axolotl either by filling
</translate>
<a
v-translate
href="https://github.com/nanu-c/axolotl/issues"
@click="openExtern($event, 'https://github.com/nanu-c/axolotl/issues')"
>issues at the bug tracker</a>.
<br>
<translate class="mr-1">or by becoming a</translate>
<a
href="https://www.patreon.com/bePatron?u=11219559"
@click="
openExtern($event, 'https://www.patreon.com/bePatron?u=11219559')
"
><span v-translate>sponsor on patreon.</span></a><br>
<br>
<font-awesome-icon id="heart" icon="heart" />
<br>
<a
href="https://axolotl.chat"
@click="openExtern($event, 'https://axolotl.chat')"
>https://axolotl.chat</a>
<component :is="$route.meta.layout || 'div'">
<div class="about">
<img class="logo" src="/axolotl.png" alt="Axolotl logo">
<h1 class="title">Axolotl Beta {{ config.Version }}</h1>
<h2 v-translate class="subtitle">A cross-platform Signal client</h2>
<div class="description">
<translate>
This is a free and open source Signal client written in golang, rust and
vuejs.
</translate>
<br>
<translate class="mr-1">
You can support the development of Axolotl either by filling
</translate>
<a
v-translate
href="https://github.com/nanu-c/axolotl/issues"
@click="openExternal($event, 'https://github.com/nanu-c/axolotl/issues')"
>issues at the bug tracker</a>.
<br>
<translate class="mr-1">or by becoming a</translate>
<a
href="https://www.patreon.com/bePatron?u=11219559"
@click="
openExternal($event, 'https://www.patreon.com/bePatron?u=11219559')
"
><span v-translate>sponsor on patreon.</span></a><br>
<br>
<font-awesome-icon id="heart" icon="heart" />
<br>
<a
href="https://axolotl.chat"
@click="openExternal($event, 'https://axolotl.chat')"
>https://axolotl.chat</a>
</div>
</div>
</div>
</component>
</template>

<script>
Expand All @@ -48,7 +50,7 @@ export default {
},
computed: mapState(["config", "gui"]),
methods: {
openExtern(e, url) {
openExternal(e, url) {
if (this.gui === "ut") {
e.preventDefault();
alert(url);
Expand Down
Loading

0 comments on commit f7c4f20

Please sign in to comment.