Skip to content

Commit

Permalink
fix: update CSS to correctly match default nova styles (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBeltran authored Mar 8, 2024
1 parent 649ff17 commit 67424e7
Show file tree
Hide file tree
Showing 5 changed files with 387 additions and 32 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-vue": "^9.1.1",
"laravel-mix": "^6.0.49",
"laravel-nova-ui": "^0.4.12",
"luxon": "^3.4.4",
"postcss": "^8.4.14",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3",
"semantic-release": "^21.0.2",
"vue-loader": "^17.1.1"
},
"dependencies": {
"luxon": "^3.3.0"
}
"dependencies": {}
}
4 changes: 2 additions & 2 deletions resources/js/components/CreateTokenModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
list="name-list"
type="text"
placeholder="Name"
class="w-full form-control form-input form-input-bordered"
class="w-full form-control form-input form-control-bordered"
required
/>
</div>
Expand All @@ -38,7 +38,7 @@
v-model="tokenAbilities"
type="text"
:placeholder="options.defaultAbilities"
class="w-full form-control form-input form-input-bordered"
class="w-full form-control form-input form-control-bordered"
/>
<p>
{{ __("Comma separated list of abilities to apply to token.") }}
Expand Down
44 changes: 22 additions & 22 deletions resources/js/components/CreatedTokenModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
<ModalContent>
<div class="flex flex-col">
<div class="flex flex-col space-y-2">
<div class="text-lg bg-gray-100 rounded p-4">
<button
v-tooltip="__('Copy to clipboard')"
type="button"
class="flex items-center justify-between w-full hover:bg-gray-50 dark:hover:bg-gray-900 text-gray-500 dark:text-gray-400 hover:text-gray-500 active:text-gray-600 rounded-lg px-1 -mx-1"
@click.prevent.stop="copyValueToClipboard(newToken)"
>
<span ref="theFieldValue">
{{ newToken }}
</span>

<Icon
class="text-gray-500 dark:text-gray-400 ml-1"
:solid="true"
type="clipboard"
width="14"
/>
</button>
<div class="flex items-center justify-between space-x-2">
<input
readonly
class="w-full form-control form-input"
type="text"
:value="newToken"
data-disabled
/>
<IconButton
v-tooltip="{
content: __('Copied to clipboard'),
triggers: ['click'],
placement: 'right',
autoHide: true,
}"
icon-type="clipboard"
@click.prevent.stop="copyValueToClipboard"
/>
</div>
<HelpText class="mt-2 help-text-error">
{{
Expand Down Expand Up @@ -64,19 +64,19 @@ export default {
handleConfirmed() {
this.$emit("confirmed");
},
copyValueToClipboard(value) {
copyValueToClipboard() {
if (navigator.clipboard) {
navigator.clipboard.writeText(value);
navigator.clipboard.writeText(this.newToken);
} else if (window.clipboardData) {
window.clipboardData.setData("Text", value);
window.clipboardData.setData("Text", this.newToken);
} else {
const input = document.createElement("input");
const [scrollTop, scrollLeft] = [
document.documentElement.scrollTop,
document.documentElement.scrollLeft,
];
document.body.appendChild(input);
input.value = value;
input.value = this.newToken;
input.focus();
input.select();
document.documentElement.scrollTop = scrollTop;
Expand Down
13 changes: 11 additions & 2 deletions resources/js/components/DeleteTokenModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,26 @@
>
{{ __("Cancel") }}
</LinkButton>
<DangerButton type="button" @click.prevent="handleConfirmed">
<NovaButton
type="submit"
state="danger"
@click.prevent="handleConfirmed"
>
{{ __("Revoke Token") }}
</DangerButton>
</NovaButton>
</div>
</ModalFooter>
</div>
</Modal>
</template>

<script>
import { Button as NovaButton } from "laravel-nova-ui";
export default {
components: {
NovaButton,
},
props: {
tokenName: {
required: true,
Expand Down
Loading

0 comments on commit 67424e7

Please sign in to comment.