Skip to content

Commit

Permalink
Modify button to disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Zelzahn committed Jul 24, 2024
1 parent c61375e commit c0ea0b4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions loama/src/components/LoButton.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<button :class="classList">
<button :class="classList" :disabled="disabled">
<component :v-if="leftIcon" :is="leftIcon" :size="24" />
<span>
<slot></slot>
Expand All @@ -23,7 +23,11 @@ const props = withDefaults(defineProps<{
/**
* The variant of the button; defaults to primary.
*/
variant?: "primary" | "secondary"
variant?: "primary" | "secondary",
/**
* If the button is disabled or not.
*/
disabled?: boolean
}>(), {
variant: "primary"
})
Expand Down Expand Up @@ -60,6 +64,13 @@ button:hover {
color: var(--off-white);
}
button:disabled {
background-color: color-mix(in srgb, var(--off-black) 60%, transparent);
border: none;
color: var(--off-white);
cursor: not-allowed;
}
.primary {
background-color: var(--solid-purple);
border-color: var(--solid-purple);
Expand Down
4 changes: 2 additions & 2 deletions loama/src/components/header/HeaderBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</div>
<nav>
<slot></slot>
<LoButton :rightIcon="PhShareFat" class="share">Share access</LoButton>
<LoButton :rightIcon="PhShareFat" class="share" disabled>Share access</LoButton>
</nav>
<img :src="pfpSrc" alt="User profile picture" @click="toggleContextMenu" />
<Suspense>
Expand Down Expand Up @@ -115,4 +115,4 @@ img:hover {
max-width: 25vw;
max-height: 50vw;
}
</style>
</style>

0 comments on commit c0ea0b4

Please sign in to comment.