stopped invoking btn class
This commit is contained in:
parent
036f76d878
commit
284662fe36
|
@ -3,6 +3,7 @@ import style from "./styles/buttons8831.scss"
|
||||||
|
|
||||||
// Import the JSON data
|
// Import the JSON data
|
||||||
import buttonsData from "./buttons.json"
|
import buttonsData from "./buttons.json"
|
||||||
|
import { List } from "mdast-util-to-hast/lib/handlers/list"
|
||||||
|
|
||||||
export default (() => {
|
export default (() => {
|
||||||
// Define the component
|
// Define the component
|
||||||
|
@ -40,14 +41,14 @@ export default (() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to group buttons by type
|
// Function to group buttons by type
|
||||||
function groupButtonsByType(buttons) {
|
function groupButtonsByType(buttons: any[]) {
|
||||||
const groups = {
|
const groups: { [key: string]: any[] } = {
|
||||||
misc: [],
|
misc: [],
|
||||||
friend: [],
|
friend: [],
|
||||||
standard: [],
|
standard: [],
|
||||||
}
|
}
|
||||||
|
|
||||||
buttons.forEach((button) => {
|
buttons.forEach((button: any) => {
|
||||||
let type = button.type?.toLowerCase() || "standard"
|
let type = button.type?.toLowerCase() || "standard"
|
||||||
if (type === "fren") type = "friend"
|
if (type === "fren") type = "friend"
|
||||||
if (!groups[type]) type = "standard" // Default to 'standard' if type is unrecognized
|
if (!groups[type]) type = "standard" // Default to 'standard' if type is unrecognized
|
||||||
|
@ -58,7 +59,7 @@ export default (() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to render button content based on contentType
|
// Function to render button content based on contentType
|
||||||
function renderButtonContent(button) {
|
function renderButtonContent(button: any): preact.VNode | null {
|
||||||
const contentType = button.contentType || "image" // Default to 'image'
|
const contentType = button.contentType || "image" // Default to 'image'
|
||||||
|
|
||||||
if (contentType === "image") {
|
if (contentType === "image") {
|
||||||
|
@ -80,4 +81,4 @@ export default (() => {
|
||||||
Btn8831.css = style
|
Btn8831.css = style
|
||||||
|
|
||||||
return Btn8831
|
return Btn8831
|
||||||
})() satisfies QuartzComponentConstructor
|
}) satisfies QuartzComponentConstructor
|
||||||
|
|
Loading…
Reference in a new issue