Skip to content

Commit

Permalink
feat(login): custimizable login buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
gravitano committed Jun 21, 2022
1 parent 81120d8 commit 735ac7e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
9 changes: 8 additions & 1 deletion packages/pages/src/Login.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,18 @@ const Template: Story<{}> = (args) => ({
},
template: `
<Auth>
<Login/>
<Login v-bind="args"/>
</Auth>
`,
});

export const Default = Template.bind({});
Default.args = {};
Default.storyName = 'Login';

export const Custom = Template.bind({});
Custom.args = {
btnProps: {
color: 'secondary',
},
};
18 changes: 17 additions & 1 deletion packages/pages/src/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ const props = defineProps({
type: String,
default: 'off',
},
btnProps: {
type: Object,
default: () => ({}),
},
btnRegisterProps: {
type: Object,
default: () => ({}),
},
});
const {message} = toRefs(props);
Expand Down Expand Up @@ -160,6 +168,7 @@ const onSubmit = handleSubmit((values) => {
uppercase
:disabled="loading || disabled"
:loading="loading"
v-bind="btnProps"
>
{{ loginText }}
</VBtn>
Expand All @@ -168,7 +177,14 @@ const onSubmit = handleSubmit((values) => {
<slot name="register">
<div class="mt-4">
Already have an account?
<v-btn text color="primary" :to="register">Register</v-btn>
<v-btn
text
color="primary"
:to="register"
v-bind="btnRegisterProps"
>
Register
</v-btn>
</div>
</slot>
</template>
Expand Down

0 comments on commit 735ac7e

Please sign in to comment.