Skip to content

Instantly share code, notes, and snippets.

@nparsons08 nparsons08/13.js Secret
Created May 28, 2019

Embed
What would you like to do?
<!-- ./src/App.vue -->
<template>
<div id="app">
<div v-if="!authenticated">
<Login @login="setAuthenticated" />
</div>
<div v-else class="main">
<Channels
:channels="channels"
@joinChannel="setActiveChannel"
@createChannel="createChannel"
/>
<div class="message-area">
<div class="message-header">
<div class="message-header-left"> Chatx </div>
<div class="message-header-right">
<select v-model="language" class="language" @change="translateLanguage">
<option value="en" selected>English</option>
<option value="fr">French</option>
<option value="de">German</option>
<option value="fa">Persian</option>
<option value="pl">Polish</option>
<option value="pt">Portuguese</option>
</select>
</div>
</div>
<Messages
:messages="messages"
:user-id="userId"
/>
<InputForm
:active-channel="activeChannel"
@newMessage="sendMessage"
@joinedRoom="joinedRoom = true"
/>
</div>
</div>
</div>
</template>
<script>
import { StreamChat } from 'stream-chat';
import axios from "axios";
import Messages from "@/components/Messages";
import InputForm from "@/components/InputForm";
import Channels from "@/components/Channels";
import Login from "@/components/Login";
import "./App.css";
export default {
name: "App",
components: {
Messages,
InputForm,
Channels,
Login
},
data() {
return {
messages: [],
authenticated: false,
channels: [],
activeChannel: null,
status: null,
userId: null,
language: "en"
};
},
methods: {
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.