♻️ Lint
This commit is contained in:
20
components/firebase/feeds.vue
Normal file
20
components/firebase/feeds.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<div>
|
||||
<p v-for="ball in store.ballsInFeed" :key="ball.id">
|
||||
<span> {{ ball.author_name }}:</span>
|
||||
{{ ball.message }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { store } from "../../functions/store";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
store
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
25
components/firebase/inputform.vue
Normal file
25
components/firebase/inputform.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<form @submit.prevent="formPost">
|
||||
<input type="text" autofocus ref="inputMessage" v-model="message" />
|
||||
<input :disabled="!this.message" type="submit" value="DUNK!" />
|
||||
</form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { store } from "../../functions/store";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
message: null
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
formPost() {
|
||||
store.writeBall(this.message);
|
||||
this.message = null;
|
||||
this.$refs.inputMessage.focus();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
29
components/firebase/login.vue
Normal file
29
components/firebase/login.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<div>
|
||||
<button @click.prevent="signInWithGoogle">Log in with Google</button>
|
||||
<button @click.prevent="signInWithGithub">Log in with GitHub</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import firebase from "firebase/app";
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
signInWithGoogle() {
|
||||
const provider = new firebase.auth.GoogleAuthProvider();
|
||||
firebase
|
||||
.auth()
|
||||
.signInWithPopup(provider)
|
||||
.catch(err => alert(err.message || err));
|
||||
},
|
||||
signInWithGithub() {
|
||||
const provider = new firebase.auth.GithubAuthProvider();
|
||||
firebase
|
||||
.auth()
|
||||
.signInWithPopup(provider)
|
||||
.catch(err => alert(err.message || err));
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user