Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions packages/extension/src/ui/action/components/base-button/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<template>
<a
class="button"
:class="{ alternative: noBackground, disabled: disabled }"
:class="{
alternative: noBackground,
disabled: disabled,
gray: gray,
red: red,
}"
@click="click()"
>
{{ title }}
Expand Down Expand Up @@ -29,6 +34,14 @@ defineProps({
default: () => ({}),
},
disabled: Boolean,
gray: {
type: Boolean,
default: false,
},
red: {
type: Boolean,
default: false,
},
});
</script>

Expand All @@ -54,14 +67,26 @@ defineProps({

&.disabled {
pointer-events: none;
background: rgba(95, 99, 104, 0.1);
color: rgba(0, 0, 0, 0.2);
background: rgba(95, 99, 104, 0.1) !important;
color: rgba(0, 0, 0, 0.2) !important;
box-shadow: none !important;
}

&.alternative {
color: @primaryLabel;
background: transparent;
box-shadow: none;
}

&.gray {
background: @buttonBg;
box-shadow: none;
color: @primaryLabel;
}

&.red {
background: @error;
color: @white;
}
}
</style>
24 changes: 7 additions & 17 deletions packages/extension/src/ui/action/components/base-input/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:placeholder="placeholder"
class="base-input"
:class="{ error: isError }"
@input="changeValue($event.target.value)"
@input="changeValue"
/>
<a
v-if="type == 'password'"
Expand All @@ -27,10 +27,8 @@ export default {
<script setup lang="ts">
import { ref } from "vue";
import HideIcon from "@action/icons/password/hide-icon.vue";

let showPassword = ref(false);
let text = "";

const props = defineProps({
placeholder: {
type: String,
Expand Down Expand Up @@ -63,9 +61,8 @@ const props = defineProps({
},
},
});

const changeValue = (text: string) => {
props.input(text);
const changeValue = (e: any) => {
props.input(e.target.value);
};
const toggleVisibility = () => {
showPassword.value = !showPassword.value;
Expand All @@ -74,7 +71,6 @@ const toggleVisibility = () => {

<style lang="less">
@import "~@action/styles/theme.less";

.base-input {
outline: none;
background: @white;
Expand All @@ -87,31 +83,25 @@ const toggleVisibility = () => {
font-size: 14px;
line-height: 40px;
letter-spacing: 0.25px;
background: none;
color: @primaryLabel;
width: 100%;
box-sizing: border-box;

&:focus {
border: 1.5px solid @primary;
line-height: 39px;
border: 2px solid @primary;
line-height: 38px;
}

&.error {
border: 1.5px solid @error;
line-height: 39px;
border: 2px solid @error;
line-height: 38px;
}

&__wrap {
position: relative;
}

&__hide {
position: absolute;
top: 12px;
right: 12px;
cursor: pointer;

&:active {
opacity: 0.7;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/extension/src/ui/action/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { createRouter, createWebHashHistory } from "vue-router";
import Intro from "@action/views/intro/index.vue";
import AddNetwork from "@action/views/add-network/index.vue";
import NetworkActivity from "@action/views/network-activity/index.vue";
import NetworkAssets from "@action/views/network-assets/index.vue";
import NetworkDApps from "@action/views/network-dapps/index.vue";
import NetworkNFTs from "@action/views/network-nfts/index.vue";
import LockScreen from "@action/views/lock-screen/index.vue";

const routes = [
{
path: "/",
components: {
view: Intro,
view: LockScreen,
},
name: "intro",
name: "lock-screen",
},
{
path: "/activity/:id?",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<template>
<div class="lock-screen-forgot">
<a class="lock-screen-forgot__close" @click="close">
<close-icon />
</a>
<h2>Forgot password?</h2>
<p>Enkrypt cannot recover your password for you.</p>
<p>
If you’re having trouble unlocking your account, you will need to reset
your wallet.
</p>

<base-button
title="Reset wallet"
:click="reset"
:red="true"
class="lock-screen-forgot__reset"
/>

<p class="lock-screen-forgot__info">
Still need help? <a href="#">Contact support</a>
</p>
</div>
</template>

<script lang="ts">
export default {
name: "LockScreenForgot",
};
</script>

<script setup lang="ts">
import { defineProps } from "vue";
import CloseIcon from "@action/icons/common/close-icon.vue";
import BaseButton from "@action/components/base-button/index.vue";
const props = defineProps({
close: {
type: Function,
default: () => {
return null;
},
},
reset: {
type: Function,
default: () => {
return null;
},
},
});
const close = () => {
props.close();
};
const reset = () => {
props.reset();
};
</script>

<style lang="less">
@import "~@action/styles/theme.less";
.lock-screen-forgot {
background: @white;
box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.1);
border-radius: 12px;
width: 360px;
height: auto;
box-sizing: border-box;
padding: 24px 20px 20px 20px;
position: relative;
&__close {
position: absolute;
top: 8px;
right: 8px;
border-radius: 8px;
cursor: pointer;
font-size: 0;
&:hover {
background: @black007;
}
}
h2 {
font-style: normal;
font-weight: 700;
font-size: 24px;
line-height: 32px;
color: @primaryLabel;
margin: 0 0 8px 0;
}
p {
font-style: normal;
font-weight: 400;
font-size: 16px;
line-height: 24px;
color: @secondaryLabel;
margin: 0 0 8px 0;
}
&__reset {
width: 100%;
margin-top: 24px;
margin-bottom: 36px;
}
&__info {
font-size: 14px !important;
line-height: 20px !important;
margin: 0 !important;
a {
color: @secondaryLabel;
&:hover {
text-decoration: none;
}
}
}
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<template>
<div class="lock-screen-password-input">
<base-input
type="password"
value=""
placeholder="Password"
class="lock-screen-password-input__input"
:is-error="isError"
:input="input"
/>
<p v-show="isError" class="lock-screen-password-input__error">
Wrong password
</p>
</div>
</template>

<script lang="ts">
export default {
name: "LockScreenPasswordInput",
};
</script>

<script setup lang="ts">
import { ref } from "vue";
import BaseInput from "@action/components/base-input/index.vue";
var password = ref("");
const props = defineProps({
input: {
type: Function,
default: () => {
return null;
},
},
isError: {
type: Boolean,
default: () => {
return false;
},
},
});
const input = (text: string) => {
password.value = text;
const isValid = text.length > 6;
props.input(text, isValid);
};
</script>

<style lang="less">
@import "~@action/styles/theme.less";
.lock-screen-password-input {
padding: 0 0 39px 0;
width: 100%;
position: relative;
box-sizing: border-box;
&__input {
margin: 0;
}
&__error {
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 20px;
letter-spacing: 0.25px;
color: @error;
margin: 0;
position: absolute;
left: 12px;
bottom: 15px;
}
}
</style>
Loading