Skip to content

Commit 3b515f8

Browse files
committed
dove into styling
1 parent 5dca482 commit 3b515f8

File tree

18 files changed

+759
-62
lines changed

18 files changed

+759
-62
lines changed

client/package-lock.json

Lines changed: 45 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
"build": "node build/build.js"
1515
},
1616
"dependencies": {
17+
"axios": "^0.19.2",
18+
"body-parser": "^1.19.0",
1719
"vue": "^2.5.2",
18-
"vue-router": "^3.0.1"
20+
"vue-router": "^3.0.1",
21+
"vuetify": "^2.2.33"
1922
},
2023
"devDependencies": {
2124
"autoprefixer": "^7.1.2",

client/src/App.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<template>
22
<div id="app">
3-
<img src="./assets/logo.png">
43
<router-view/>
54
</div>
65
</template>

client/src/components/Register.vue

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<template>
2+
<v-layout column>
3+
<v-flex xs6 offset-xs3>
4+
<div class="white elevation-2">
5+
<v-toolbar flat dense class='cyan' dark>
6+
<v-toolbar-title>
7+
Register
8+
</v-toolbar-title>
9+
</v-toolbar>
10+
<h1>Register</h1>
11+
<div class="pl-4 pr-4 pt-2 pb-2">
12+
<input
13+
type="email"
14+
v-model="email"
15+
name="email"
16+
placeholder="email" />
17+
<br>
18+
<input
19+
name="password"
20+
v-model="password"
21+
type="password"
22+
placeholder="password" />
23+
<br>
24+
<v-button
25+
@click="register">
26+
Register</v-button>
27+
<br>
28+
<div class="error" v-html="error"></div>
29+
</div>
30+
</div>
31+
</v-flex>
32+
</v-layout>
33+
</template>
34+
35+
<script>
36+
import AuthenitcationService from '@/services/AuthenticationService'
37+
38+
export default {
39+
data () {
40+
return {
41+
email: '',
42+
password: '',
43+
error: null
44+
}
45+
},
46+
methods: {
47+
async register () {
48+
try {
49+
await AuthenitcationService.register({
50+
email: this.email,
51+
password: this.password
52+
})
53+
} catch (error) {
54+
this.error = error.response.data.error
55+
}
56+
57+
58+
}
59+
}
60+
}
61+
</script>
62+
63+
<!-- Add "scoped" attribute to limit CSS to this component only -->
64+
<style scoped>
65+
.error {
66+
color: red
67+
}
68+
</style>

client/src/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import Vue from 'vue'
44
import App from './App'
55
import router from './router'
6+
import Veutify from 'vuetify'
7+
import 'vuetify/dist/vuetify.min.css'
68

79
Vue.config.productionTip = false
810

client/src/router/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Vue from 'vue'
22
import Router from 'vue-router'
33
import HelloWorld from '@/components/HelloWorld'
4+
import Register from '@/components/Register'
45

56
Vue.use(Router)
67

@@ -10,6 +11,11 @@ export default new Router({
1011
path: '/',
1112
name: 'HelloWorld',
1213
component: HelloWorld
14+
},
15+
{
16+
path: '/register',
17+
name: 'register',
18+
component: Register
1319
}
1420
]
1521
})

client/src/services/Api.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import axios from 'axios'
2+
3+
export default () => {
4+
return axios.create({
5+
baseURL: 'http://localhost:8081/'
6+
})
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Api from '@/services/Api'
2+
3+
export default {
4+
register (credentials) {
5+
return Api().post('register', credentials)
6+
}
7+
}

0 commit comments

Comments
 (0)