forked from Jiiks/BetterDiscordApp
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add api's for easy generic components
- Loading branch information
Showing
5 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* BetterDiscord Generic Button Component | ||
* Copyright (c) 2015-present Jiiks/JsSucks - https://github.com/Jiiks / https://github.com/JsSucks | ||
* All rights reserved. | ||
* https://betterdiscord.net | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
<template> | ||
<div class="bd-button" :class="classes" @click="onClick"> | ||
{{text}} | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: ['classes', 'text', 'onClick'] | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* BetterDiscord Generic Button Group Component | ||
* Copyright (c) 2015-present Jiiks/JsSucks - https://github.com/Jiiks / https://github.com/JsSucks | ||
* All rights reserved. | ||
* https://betterdiscord.net | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
<template> | ||
<div class="bd-buttonGroup" :class="classes"> | ||
<Button v-for="(button, index) in buttons" :text="button.text" :classes="button.classes" :onClick="button.onClick" :key="index"/> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Button from './Button.vue'; | ||
export default { | ||
props: ['buttons', 'classes'], | ||
components: { Button } | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import VrWrapper from '../../vrwrapper'; | ||
|
||
import ButtonGroupComponent from './ButtonGroup.vue'; | ||
class ButtonGroupWrapper extends VrWrapper { | ||
get component() { return ButtonGroupComponent } | ||
constructor(props) { | ||
super(); | ||
this.props = props; | ||
} | ||
} | ||
|
||
import ButtonComponent from './Button.vue'; | ||
class ButtonWrapper extends VrWrapper { | ||
get component() { return ButtonComponent } | ||
constructor(props) { | ||
super(); | ||
this.props = props; | ||
} | ||
} | ||
|
||
export default class { | ||
static Button(props) { | ||
return new ButtonWrapper(props); | ||
} | ||
|
||
static ButtonGroup(props) { | ||
return new ButtonGroupWrapper(props); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters