aboutsummaryrefslogtreecommitdiff
path: root/extension/src/entries/popup/Components/Login.vue
blob: 8b7b80792edf6993ffe4c1b860e9ac73ea6c361c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<template>
    <div id="login-template" class="py-4">
        <TabGroup @change="onChange">
            <TabList as="div" class="flex flex-row mx-auto mb-3 font-bold w-fit">
                <Tab 
                    class="p-0.5 mx-1 border-b"
                    :class="[ isActive(0) ? 'border-gray-400' : 'border-transparent']"
                >
                    OTP
                </Tab>
                <Tab 
                    class="p-0.5 mx-1 border-b"
                    :class="[ isActive(1) ? 'border-gray-400' : 'border-transparent']"
                >
                    User/Pass
                </Tab>
            </TabList>
            <TabPanels>
                <TabPanel>
                    <OtpLogin />
                </TabPanel>
                <TabPanel>
                    <PassLogin />
                </TabPanel>
            </TabPanels>
        </TabGroup>
    </div>
</template>

<script setup lang="ts">
import { TabGroup, TabList, Tab, TabPanels, TabPanel } from '@headlessui/vue'
import PassLogin from "./PassLogin.vue";
import OtpLogin from "./OtpLogin.vue";
import { shallowRef } from 'vue';

const activeTab = shallowRef(0)

const onChange = (index: any) => {
    activeTab.value = index
}

const isActive = (index: any) => activeTab.value === index

</script>

<style lang="scss">

</style>