Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cancel_button #1364

Merged
merged 1 commit into from
Jan 10, 2025
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
cancel_button
  • Loading branch information
isamu committed Jan 10, 2025
commit d95fc3b1f7e4265bce3b75866ebb6190b3aa1eb5
12 changes: 3 additions & 9 deletions src/app/auth/SignUpPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,9 @@

<!-- Submit Button -->
<div class="mt-2 text-center">
<o-button @click="handleCancel" class="b-reset-tw mr-4 mb-2">
<div
class="inline-flex h-12 w-32 items-center justify-center rounded-full bg-black bg-opacity-5"
>
<div class="text-base font-bold text-black text-opacity-60">
{{ $t("button.cancel") }}
</div>
</div>
</o-button>
<t-cancel-button @click="handleCancel" class="mr-4 mb-2 h-12 w-32">
{{ $t("button.cancel") }}
</t-cancel-button>

<o-button
:disabled="submitted && Object.keys(errors).length > 0"
Expand Down
41 changes: 41 additions & 0 deletions src/components/form/cancel_button.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<template>
<button
class="inline-flex items-center justify-center rounded-full bg-black bg-opacity-5 text-black text-opacity-60 font-bold"
:loading="isLoading"
:disabled="isLoading || isDisabled"
@click="handleClick"
>
<ButtonLoading v-if="isLoading" />
<slot></slot>
</button>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import ButtonLoading from "@/components/Button/Loading.vue";
export default defineComponent({
emits: ["click"],
name: "TCancelButton",
components: {
ButtonLoading,
},
props: {
isLoading: {
type: Boolean,
required: false,
},
isDisabled: {
type: Boolean,
required: false,
},
},
setup(props, ctx) {
const handleClick = () => {
ctx.emit("click");
};
return {
handleClick,
};
},
});
</script>
2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import VueGoogleMaps from "@fawmi/vue-google-maps";

import Checkbox from "@/components/form/checkbox.vue";
import Button from "@/components/form/button.vue";
import CancelButton from "@/components/form/cancel_button.vue";

// sentry
import * as Sentry from "@sentry/vue";
Expand All @@ -40,6 +41,7 @@ const app = createApp(App);
app.component(VueQrcode.name ?? "", VueQrcode);
app.component("t-checkbox", Checkbox);
app.component("t-button", Button);
app.component("t-cancel-button", CancelButton);

app.use(VueGoogleMaps, {
load: {
Expand Down
Loading