refactor: centralize access-denied card styles into shared mixin (#2515)
* refactor: centralize access-denied card styles into shared mixin * fix: use bracket notation for bookType index signature access
This commit is contained in:
@@ -62,7 +62,7 @@ export class BookRuleEvaluatorService {
|
|||||||
case 'readStatus':
|
case 'readStatus':
|
||||||
return [String(book.readStatus ?? 'UNSET').toLowerCase()];
|
return [String(book.readStatus ?? 'UNSET').toLowerCase()];
|
||||||
case 'fileType':
|
case 'fileType':
|
||||||
return [String(book.bookType ?? '').toLowerCase()];
|
return [String(book['bookType'] ?? '').toLowerCase()];
|
||||||
case 'library':
|
case 'library':
|
||||||
return [String(book.libraryId)];
|
return [String(book.libraryId)];
|
||||||
case 'shelf':
|
case 'shelf':
|
||||||
@@ -238,7 +238,7 @@ export class BookRuleEvaluatorService {
|
|||||||
case 'readStatus':
|
case 'readStatus':
|
||||||
return book.readStatus ?? 'UNSET';
|
return book.readStatus ?? 'UNSET';
|
||||||
case 'fileType':
|
case 'fileType':
|
||||||
return book.bookType?.toLowerCase() ?? null;
|
return (book['bookType'] as string)?.toLowerCase() ?? null;
|
||||||
case 'fileSize':
|
case 'fileSize':
|
||||||
return book.fileSizeKb;
|
return book.fileSizeKb;
|
||||||
case 'metadataScore':
|
case 'metadataScore':
|
||||||
|
|||||||
+2
-33
@@ -143,40 +143,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.access-denied-card {
|
.access-denied-card {
|
||||||
display: flex;
|
@include settings.settings-access-denied-card;
|
||||||
align-items: center;
|
|
||||||
gap: 1rem;
|
|
||||||
padding: 1rem;
|
|
||||||
border-radius: settings.$settings-card-border-radius;
|
|
||||||
background: rgba(220, 38, 38, 0.1);
|
|
||||||
border: 1px solid rgba(220, 38, 38, 0.3);
|
|
||||||
color: var(--p-red-400);
|
|
||||||
max-width: 500px;
|
|
||||||
margin: 0 1rem;
|
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pi {
|
|
||||||
font-size: 1.25rem;
|
|
||||||
flex-shrink: 0;
|
|
||||||
color: var(--p-red-300);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.access-denied-content {
|
.access-denied-content {
|
||||||
h3 {
|
@include settings.settings-access-denied-content;
|
||||||
margin: 0 0 0.5rem 0;
|
|
||||||
font-size: 1rem;
|
|
||||||
font-weight: settings.$settings-section-title-weight;
|
|
||||||
color: var(--p-red-300);
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin: 0;
|
|
||||||
font-size: settings.$settings-section-description-size;
|
|
||||||
line-height: 1.5;
|
|
||||||
color: var(--p-red-400);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-28
@@ -150,33 +150,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.access-denied-card {
|
.access-denied-card {
|
||||||
display: flex;
|
@include settings.settings-access-denied-card;
|
||||||
align-items: center;
|
}
|
||||||
gap: 1rem;
|
|
||||||
padding: 1rem;
|
|
||||||
border-radius: settings.$settings-card-border-radius;
|
|
||||||
background: rgba(220, 38, 38, 0.1);
|
|
||||||
border: 1px solid rgba(220, 38, 38, 0.3);
|
|
||||||
color: var(--p-red-400);
|
|
||||||
max-width: 500px;
|
|
||||||
|
|
||||||
.pi {
|
.access-denied-content {
|
||||||
font-size: 1.25rem;
|
@include settings.settings-access-denied-content;
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.access-denied-content {
|
|
||||||
h3 {
|
|
||||||
margin: 0 0 0.5rem 0;
|
|
||||||
font-size: 1rem;
|
|
||||||
font-weight: settings.$settings-section-title-weight;
|
|
||||||
color: var(--p-red-300);
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin: 0;
|
|
||||||
font-size: settings.$settings-section-description-size;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-28
@@ -160,33 +160,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.access-denied-card {
|
.access-denied-card {
|
||||||
display: flex;
|
@include settings.settings-access-denied-card;
|
||||||
align-items: center;
|
}
|
||||||
gap: 1rem;
|
|
||||||
padding: 1rem;
|
|
||||||
border-radius: settings.$settings-card-border-radius;
|
|
||||||
background: rgba(220, 38, 38, 0.1);
|
|
||||||
border: 1px solid rgba(220, 38, 38, 0.3);
|
|
||||||
color: var(--p-red-400);
|
|
||||||
max-width: 500px;
|
|
||||||
|
|
||||||
.pi {
|
.access-denied-content {
|
||||||
font-size: 1.25rem;
|
@include settings.settings-access-denied-content;
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.access-denied-content {
|
|
||||||
h3 {
|
|
||||||
margin: 0 0 0.5rem 0;
|
|
||||||
font-size: 1rem;
|
|
||||||
font-weight: settings.$settings-section-title-weight;
|
|
||||||
color: var(--p-red-300);
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin: 0;
|
|
||||||
font-size: settings.$settings-section-description-size;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -444,6 +444,49 @@ $settings-item-border-left-width: 3px;
|
|||||||
font-size: $settings-section-description-size;
|
font-size: $settings-section-description-size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// ACCESS DENIED CARD MIXIN
|
||||||
|
// For restricted access sections
|
||||||
|
// ============================================================================
|
||||||
|
@mixin settings-access-denied-card {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1rem;
|
||||||
|
padding: 1rem;
|
||||||
|
border-radius: $settings-card-border-radius;
|
||||||
|
background: rgba(220, 38, 38, 0.1);
|
||||||
|
border: 1px solid rgba(220, 38, 38, 0.3);
|
||||||
|
color: var(--p-red-400);
|
||||||
|
max-width: 500px;
|
||||||
|
margin: 0 1rem;
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pi {
|
||||||
|
font-size: 1.25rem;
|
||||||
|
flex-shrink: 0;
|
||||||
|
color: var(--p-red-300);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin settings-access-denied-content {
|
||||||
|
h3 {
|
||||||
|
margin: 0 0 0.5rem 0;
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: $settings-section-title-weight;
|
||||||
|
color: var(--p-red-300);
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: $settings-section-description-size;
|
||||||
|
line-height: 1.5;
|
||||||
|
color: var(--p-red-400);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// BUTTON GROUP MIXIN
|
// BUTTON GROUP MIXIN
|
||||||
// For toggle button selections
|
// For toggle button selections
|
||||||
|
|||||||
Reference in New Issue
Block a user