Skip to content

Commit 97d9153

Browse files
author
Julia Bakerink
committed
Added functionality to nav bar button, specifically for Slack login, import componenent, and get started.
1 parent b687164 commit 97d9153

File tree

5 files changed

+83
-100
lines changed

5 files changed

+83
-100
lines changed

src/components/file_system_interface/OpenProjectComponent.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Description:
1010
<div class="settings-dropdown column items-center">
1111
<p class="center">Import:</p>
1212
<q-btn class="menu-btn" no-caps color="secondary" label="Project" @click="openProjectJSON"/>
13-
<q-btn class="menu-btn" no-caps color="secondary" label="Component" @click="exportProject"/>
13+
<!-- <ImportComponent title="Component"/> -->
14+
<!-- <q-btn class="menu-btn" no-caps color="secondary" label="Component" @click="exportProject"/> -->
1415
</div>
1516
</q-menu>
1617

@@ -19,11 +20,15 @@ Description:
1920

2021
<script>
2122
import { mapActions } from "vuex";
23+
import ImportComponent from "../home_sidebar_items/ComponentTab/ImportComponent.vue"
2224
const Mousetrap = require("mousetrap");
2325
const { fs, ipcRenderer } = window;
2426
2527
export default {
2628
name: "OpenProjectComponent",
29+
components: {
30+
ImportComponent
31+
},
2732
methods: {
2833
...mapActions(["openProject"]),
2934
// opens project
@@ -64,4 +69,9 @@ export default {
6469
.mr-sm {
6570
margin-right: 0.2rem;
6671
}
72+
.menu-btn{
73+
width: 85%;
74+
margin: 10px 0px;
75+
box-shadow:inset 0 -0.6em 0 -0.35em rgba(0,0,0,0.17);
76+
}
6777
</style>

src/components/home_sidebar_items/ComponentTab/CreateComponent.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Description:
88
<template>
99
<div class="create-component-div drawer-menu">
1010
<q-expansion-item group="accordion" label="Import Component">
11-
<ImportComponent v-if="activeComponent === ''" @imported="createComponent" />
11+
<ImportComponent v-if="activeComponent === ''" @imported="createComponent" title="Import Component" />
1212
</q-expansion-item>
1313
<q-expansion-item group="accordion" label="Create Component">
1414
<form class="create-component-form" v-on:submit.prevent="createComponent">

src/components/home_sidebar_items/ComponentTab/ImportComponent.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<template>
2-
<q-btn
2+
<q-btn
33
id="import-component-btn"
44
size="md"
55
color="secondary"
6-
label="Import Component"
6+
:label=title
77
@click="importComponent"
88
/>
99
</template>
1010

1111
<script>
1212
1313
export default {
14-
14+
props: ['title'],
1515
methods: {
1616
//emitter to send the importedObj to CreateComponent when fully parsed.
1717
createImport(importObj){
@@ -256,11 +256,11 @@ export default {
256256
</script>
257257

258258
<style scoped>
259-
#import-component-btn {
260-
margin: 20px 0;
261-
width: 100%;
262-
align-items: center;
263-
}
259+
#import-component-btn{
260+
width: 85%;
261+
margin: 10px 0px;
262+
box-shadow:inset 0 -0.6em 0 -0.35em rgba(0,0,0,0.17);
263+
}
264264
</style>
265265

266266

src/components/slack_login/SlackLoginWindow.vue

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,6 @@
33
<div>
44
<!-- <div>
55
<q-btn class="glossy bg-black openModalBtn" size="5px" @click="openLogin">
6-
<svg
7-
xmlns="http://www.w3.org/2000/svg"
8-
style="height: 18px; width: 18px; margin-right: 0"
9-
viewBox="0 0 122.8 122.8"
10-
>
11-
<path
12-
d="M25.8 77.6c0 7.1-5.8 12.9-12.9 12.9S0 84.7 0 77.6s5.8-12.9 12.9-12.9h12.9v12.9zm6.5 0c0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9v32.3c0 7.1-5.8 12.9-12.9 12.9s-12.9-5.8-12.9-12.9V77.6z"
13-
fill="#e01e5a"
14-
></path>
15-
<path
16-
d="M45.2 25.8c-7.1 0-12.9-5.8-12.9-12.9S38.1 0 45.2 0s12.9 5.8 12.9 12.9v12.9H45.2zm0 6.5c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H12.9C5.8 58.1 0 52.3 0 45.2s5.8-12.9 12.9-12.9h32.3z"
17-
fill="#36c5f0"
18-
></path>
19-
<path
20-
d="M97 45.2c0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9-5.8 12.9-12.9 12.9H97V45.2zm-6.5 0c0 7.1-5.8 12.9-12.9 12.9s-12.9-5.8-12.9-12.9V12.9C64.7 5.8 70.5 0 77.6 0s12.9 5.8 12.9 12.9v32.3z"
21-
fill="#2eb67d"
22-
></path>
23-
<path
24-
d="M77.6 97c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9-12.9-5.8-12.9-12.9V97h12.9zm0-6.5c-7.1 0-12.9-5.8-12.9-12.9s5.8-12.9 12.9-12.9h32.3c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H77.6z"
25-
fill="#ecb22e"
26-
></path>
27-
</svg>
286
</q-btn>
297
</div> -->
308

@@ -35,6 +13,37 @@
3513
<!--
3614
Skip button:
3715
-->
16+
<q-btn
17+
class="menu-btn"
18+
color= "purple"
19+
no-caps
20+
@click="openLogin"
21+
>
22+
<svg
23+
xmlns="http://www.w3.org/2000/svg"
24+
style="height: 20px; width: 20px; margin-right: 12px"
25+
viewBox="0 0 122.8 122.8"
26+
>
27+
<path
28+
d="M25.8 77.6c0 7.1-5.8 12.9-12.9 12.9S0 84.7 0 77.6s5.8-12.9 12.9-12.9h12.9v12.9zm6.5 0c0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9v32.3c0 7.1-5.8 12.9-12.9 12.9s-12.9-5.8-12.9-12.9V77.6z"
29+
fill="#e01e5a"
30+
></path>
31+
<path
32+
d="M45.2 25.8c-7.1 0-12.9-5.8-12.9-12.9S38.1 0 45.2 0s12.9 5.8 12.9 12.9v12.9H45.2zm0 6.5c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H12.9C5.8 58.1 0 52.3 0 45.2s5.8-12.9 12.9-12.9h32.3z"
33+
fill="#36c5f0"
34+
></path>
35+
<path
36+
d="M97 45.2c0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9-5.8 12.9-12.9 12.9H97V45.2zm-6.5 0c0 7.1-5.8 12.9-12.9 12.9s-12.9-5.8-12.9-12.9V12.9C64.7 5.8 70.5 0 77.6 0s12.9 5.8 12.9 12.9v32.3z"
37+
fill="#2eb67d"
38+
></path>
39+
<path
40+
d="M77.6 97c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9-12.9-5.8-12.9-12.9V97h12.9zm0-6.5c-7.1 0-12.9-5.8-12.9-12.9s5.8-12.9 12.9-12.9h32.3c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H77.6z"
41+
fill="#ecb22e"
42+
></path>
43+
</svg>
44+
Slack Login
45+
</q-btn>
46+
3847
<q-dialog
3948
v-model="showLogin"
4049
persistent
@@ -87,7 +96,7 @@ export default {
8796
data() {
8897
return {
8998
isAuthenticating: false,
90-
showLogin: true,
99+
showLogin: false,
91100
errorMessage: "",
92101
};
93102
},
@@ -150,6 +159,7 @@ export default {
150159
this.errorMessage = "";
151160
},
152161
openLogin: function () {
162+
console.log('trying to open!')
153163
this.showLogin = true;
154164
},
155165
},
@@ -171,6 +181,7 @@ export default {
171181
color: $menutext;
172182
background-color: purple;
173183
margin-bottom: 10px;
184+
174185
}
175186
176187
#skipButton {
@@ -199,4 +210,10 @@ export default {
199210
.openModalBtn {
200211
border: 1px solid #289ead;
201212
}
213+
.menu-btn{
214+
width: 100%;
215+
margin-bottom:20px;
216+
}
217+
218+
202219
</style>

src/layouts/MyLayout.vue

Lines changed: 23 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ Description:
1313
<!-- the top header of OverVue -->
1414
<q-header elevated class="gradient text-white">
1515
<q-toolbar>
16-
<!-- <q-btn dense flat color="subaccent" round @click="left = !left">
17-
<i
18-
:class="[left ? 'fas fa-chevron-left' : 'fas fa-list-ul']"
19-
id="btn"
20-
></i>
21-
</q-btn> -->
2216
<q-toolbar-title><img alt="OverVue" src="../assets/OverVue_navLogo.png" id="nav-logo"><div id="undo-redo">
2317
<q-btn>
2418
<i
@@ -44,28 +38,8 @@ Description:
4438
<i v-else class="fa fa-redo" id="unavailable" aria-hidden="true"></i>
4539
</q-btn>
4640
</div></q-toolbar-title>
47-
<!-- <SlackLoginWindow /> -->
4841
<div></div>
49-
<!-- <i
50-
v-if="doneAction.length"
51-
class="fa fa-backward"
52-
aria-hidden="true"
53-
@click="undo"
54-
></i>
55-
<i
56-
v-else
57-
class="fa fa-backward"
58-
id="unavailable"
59-
aria-hidden="true"
60-
></i>
61-
<i
62-
v-if="undoneAction.length"
63-
class="fa fa-forward"
64-
aria-hidden="true"
65-
@click="redo"
66-
></i>
67-
<i v-else class="fa fa-forward" id="unavailable" aria-hidden="true"></i> -->
68-
42+
6943
<SaveProjectComponent />
7044
<OpenProjectComponent />
7145
<ExportProjectComponent />
@@ -80,41 +54,15 @@ Description:
8054
color="secondary"
8155
label="Getting Started"
8256
no-caps
57+
@click= "this.toggleTutorial"
8358
/>
8459

85-
<q-btn
86-
class="menu-btn"
87-
color="secondary"
88-
no-caps
89-
>
90-
<svg
91-
xmlns="http://www.w3.org/2000/svg"
92-
style="height: 20px; width: 20px; margin-right: 12px"
93-
viewBox="0 0 122.8 122.8"
94-
>
95-
<path
96-
d="M25.8 77.6c0 7.1-5.8 12.9-12.9 12.9S0 84.7 0 77.6s5.8-12.9 12.9-12.9h12.9v12.9zm6.5 0c0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9v32.3c0 7.1-5.8 12.9-12.9 12.9s-12.9-5.8-12.9-12.9V77.6z"
97-
fill="#e01e5a"
98-
></path>
99-
<path
100-
d="M45.2 25.8c-7.1 0-12.9-5.8-12.9-12.9S38.1 0 45.2 0s12.9 5.8 12.9 12.9v12.9H45.2zm0 6.5c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H12.9C5.8 58.1 0 52.3 0 45.2s5.8-12.9 12.9-12.9h32.3z"
101-
fill="#36c5f0"
102-
></path>
103-
<path
104-
d="M97 45.2c0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9-5.8 12.9-12.9 12.9H97V45.2zm-6.5 0c0 7.1-5.8 12.9-12.9 12.9s-12.9-5.8-12.9-12.9V12.9C64.7 5.8 70.5 0 77.6 0s12.9 5.8 12.9 12.9v32.3z"
105-
fill="#2eb67d"
106-
></path>
107-
<path
108-
d="M77.6 97c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9-12.9-5.8-12.9-12.9V97h12.9zm0-6.5c-7.1 0-12.9-5.8-12.9-12.9s5.8-12.9 12.9-12.9h32.3c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H77.6z"
109-
fill="#ecb22e"
110-
></path>
111-
</svg>
112-
Connect to Slack
113-
</q-btn>
114-
<div>
115-
<label for="typescript" class="switch">
60+
<SlackLoginWindow />
61+
<div class="typescript">
62+
<p> <b>TypeScript: </b> </p>
63+
<label for="typescript" class="switch">
11664
<input class="switch-input" type="checkbox" name="typescript" id="typescript" :value="exportAsTypescript" @change="syncTypescriptFlag" />
117-
<span class="switch-label" data-on="TypeScript" data-off="JavaScript"></span>
65+
<span class="switch-label" data-on="On" data-off="Off"></span>
11866
<span class="switch-handle"></span>
11967
</label>
12068
</div>
@@ -203,7 +151,7 @@ import OpenProjectComponent from "../components/file_system_interface/OpenProjec
203151
import SlackLoginWindow from "../components/slack_login/SlackLoginWindow.vue";
204152
import ComponentTab from "../components/home_sidebar_items/ComponentTab/ComponentTab.vue";
205153
import StoreTab from "../components/home_sidebar_items/StoreTab/StoreTab.vue";
206-
import { mapState } from "vuex";
154+
import { mapState, mapActions } from "vuex";
207155
208156
export default {
209157
// Passed down from App.vue
@@ -213,7 +161,7 @@ export default {
213161
tab: "component",
214162
left: true,
215163
right: true,
216-
dashWidth: 950,
164+
dashWidth: 650,
217165
originalWidth: 400,
218166
originalLeft: 400,
219167
timer: null,
@@ -229,9 +177,10 @@ export default {
229177
StoreTab,
230178
},
231179
computed: {
232-
...mapState(["exportAsTypescript", "toggleTutorial"]),
180+
...mapState(["exportAsTypescript"]),
233181
},
234182
methods: {
183+
...mapActions(["toggleTutorial"]),
235184
hideRight() {
236185
this.right = !this.right;
237186
if (this.$refs.resizeBox.style.display === "none") {
@@ -482,7 +431,7 @@ background: #5c5e61;
482431
position: relative;
483432
display: block;
484433
vertical-align: top;
485-
width: 100px;
434+
width: 100%;
486435
height: 30px;
487436
padding: 3px;
488437
margin: 0 10px 10px 0;
@@ -504,7 +453,7 @@ background: #5c5e61;
504453
position: relative;
505454
display: block;
506455
height: inherit;
507-
font-size: 10px;
456+
font-size: 0.8rem;
508457
text-transform: uppercase;
509458
background: #eceeef;
510459
border-radius: inherit;
@@ -536,7 +485,7 @@ background: #5c5e61;
536485
opacity: 0;
537486
}
538487
.switch-input:checked ~ .switch-label {
539-
background: #289ead;
488+
background: #42B883;
540489
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15), inset 0 0 3px rgba(0, 0, 0, 0.2);
541490
}
542491
.switch-input:checked ~ .switch-label:before {
@@ -563,14 +512,14 @@ background: #5c5e61;
563512
left: 50%;
564513
margin: -6px 0 0 -6px;
565514
width: 12px;
566-
height: 12px;
515+
height: 12px ;
567516
background: linear-gradient(to bottom, #eeeeee, #FFFFFF);
568517
background-image: -webkit-linear-gradient(top, #eeeeee, #FFFFFF);
569518
border-radius: 6px;
570519
box-shadow: inset 0 1px rgba(0, 0, 0, 0.02);
571520
}
572521
.switch-input:checked ~ .switch-handle {
573-
left: 74px;
522+
left: 56%;
574523
box-shadow: -1px 1px 5px rgba(0, 0, 0, 0.2);
575524
}
576525
@@ -582,4 +531,11 @@ background: #5c5e61;
582531
-moz-transition: All 0.3s ease;
583532
-o-transition: All 0.3s ease;
584533
}
534+
.typescript{
535+
display: flex;
536+
justify-content: space-around;
537+
align-items: flex-end;
538+
width: 90%;
539+
flex-direction: row;
540+
}
585541
</style>

0 commit comments

Comments
 (0)