1
+ <!-- <template v-if="show">-->
1
2
<template >
2
- <div >
3
- <!--
4
- Slack Login Button:
5
- -->
6
- <q-btn @click =" slackOauth" class =" slackBtn" >
7
-
8
- <svg xmlns =" http://www.w3.org/2000/svg" style =" height :20px ;width :20px ;margin-right :12px " viewBox =" 0 0 122.8 122.8" >
9
- <path 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" fill =" #e01e5a" ></path >
10
- <path 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" fill =" #36c5f0" ></path >
11
- <path 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" fill =" #2eb67d" ></path >
12
- <path 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" fill =" #ecb22e" ></path >
13
- </svg >Sign in with Slack
14
- </q-btn >
15
- <!--
16
- Skip button:
17
- -->
18
- <br />
19
- <q-btn @click =" skipToHomePage" class =" skipBtn" >Skip</q-btn >
20
- </div >
3
+ <div >
4
+ <div >
5
+ <q-btn class =" openModalBtn" @click =" openLogin" >
6
+ <svg xmlns =" http://www.w3.org/2000/svg" style =" height :18px ;width :18px ;margin-right :0 " viewBox =" 0 0 122.8 122.8" >
7
+ <path 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" fill =" #e01e5a" ></path >
8
+ <path 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" fill =" #36c5f0" ></path >
9
+ <path 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" fill =" #2eb67d" ></path >
10
+ <path 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" fill =" #ecb22e" ></path >
11
+ </svg >
12
+ </q-btn >
13
+ </div >
14
+ <q-dialog v-model =" showLogin" position =" top" persistent >
15
+ <q-card class =" slack-login" >
16
+ <!--
17
+ Slack Login Button:
18
+ -->
19
+ <q-btn @click =" slackOauth" class =" slackBtn" >
21
20
21
+ <svg xmlns =" http://www.w3.org/2000/svg" style =" height :20px ;width :20px ;margin-right :12px " viewBox =" 0 0 122.8 122.8" >
22
+ <path 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" fill =" #e01e5a" ></path >
23
+ <path 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" fill =" #36c5f0" ></path >
24
+ <path 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" fill =" #2eb67d" ></path >
25
+ <path 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" fill =" #ecb22e" ></path >
26
+ </svg >Sign in with Slack
27
+ </q-btn >
28
+ <!--
29
+ Skip button:
30
+ -->
31
+ <br />
32
+ <q-btn @click =" closeLogin()" class =" skipBtn" >Skip</q-btn >
33
+ </q-card >
34
+ </q-dialog >
35
+ </div >
22
36
</template >
23
37
38
+
39
+
40
+
24
41
<script >
25
42
// import { mapState, mapActions } from 'vuex'
26
43
import localforage from ' localforage'
27
44
import { shell , ipcRenderer } from ' electron'
28
45
import slackApiStuff from ' ../../../secretStuff/slackApiStuff.js'
29
46
30
-
31
47
export default {
32
48
name: ' SlackLoginWindow' ,
33
49
data () {
34
50
return {
35
- isAuthenticating: false
51
+ isAuthenticating: false ,
52
+ showLogin: true ,
36
53
}
37
54
},
38
55
created () {
39
- ipcRenderer .on (' tokenReceived' , (data ) => {
40
- console .log (' data received in SlackLoginWindow: ' , data)
56
+ ipcRenderer .on (' tokenReceived' , (event , data ) => {
57
+ // JSON.parse(data).then(output => {
58
+ // console.log('PARSED DATA: ', output)
59
+ // })
60
+ console .log (' data in SlackLoginWindow: ' , data)
41
61
})
42
62
},
43
63
methods: {
@@ -53,7 +73,6 @@ export default {
53
73
this .isAuthenticating = true ;
54
74
55
75
console .log (' clicked' )
56
- // shell.openExternal(this.oauthURL)
57
76
// window.open(this.oauthURL, '_blank')
58
77
shell .openExternal (
59
78
` ${ slackBaseUrl} ?response_type=${ responseType} &scope=${ scope} &client_id=${ clientId} &redirect_uri=${ redirectUri} ` ,
@@ -62,17 +81,25 @@ export default {
62
81
// .then(data => console.log(data))
63
82
// .then(data => )
64
83
},
65
- skipToHomePage : function () {
66
- console .log (' CLICKK' )
67
- console .log (' process.env: ' , process .env )
68
- console .log (' process.platform: ' , process .platform )
84
+ closeLogin : function () {
85
+ this .showLogin = false
86
+ },
87
+ openLogin : function () {
88
+ this .showLogin = true
69
89
}
70
90
}
71
91
}
72
92
</script >
73
93
74
94
<style >
75
95
96
+ .slack-login {
97
+ display : flex ;
98
+ flex-direction : column ;
99
+ align-items : center ;
100
+ padding : 3em ;
101
+ }
102
+
76
103
.slackBtn {
77
104
align-items :center ;
78
105
color :#fff ;
@@ -87,6 +114,7 @@ export default {
87
114
justify-content :center ;
88
115
text-decoration :none ;
89
116
width :256px ;
117
+ margin : auto ;
90
118
}
91
119
92
120
.skipBtn {
@@ -100,6 +128,23 @@ export default {
100
128
width :128px ;
101
129
text-decoration :none ;
102
130
justify-content :center ;
131
+ margin : auto ;
132
+ }
133
+
134
+ .openModalBtn {
135
+ display :inline-flex ;
136
+ align-items :center ;
137
+ color :#000 ;
138
+ background-color :#fff ;
139
+ border :1px solid #ddd ;
140
+ border-radius :36px ;
141
+ font-family :Lato, sans-serif ;
142
+ font-size :14px ;
143
+ font-weight :600 ;
144
+ height :36px ;
145
+ justify-content :center ;
146
+ text-decoration :none ;
147
+ width :36px ;
103
148
}
104
149
105
150
</style >
0 commit comments