classNames usage

This commit is contained in:
saberzero1 2024-10-03 19:19:32 +02:00
parent 60aae863a3
commit ad1a7d7c91
No known key found for this signature in database
GPG Key ID: 41AEE99107640F10
2 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import script from "./scripts/explorer.inline"
import { ExplorerNode, FileNode, Options } from "./ExplorerNode" import { ExplorerNode, FileNode, Options } from "./ExplorerNode"
import { QuartzPluginData } from "../plugins/vfile" import { QuartzPluginData } from "../plugins/vfile"
import { i18n } from "../i18n" import { i18n } from "../i18n"
import { classNames } from "../util/lang"
// Options interface defined in `ExplorerNode` to avoid circular dependency // Options interface defined in `ExplorerNode` to avoid circular dependency
const defaultOptions = { const defaultOptions = {
@ -88,7 +89,7 @@ export default ((userOpts?: Partial<Options>) => {
} }
return ( return (
<div class="explorer-container"> <div class="explorer-container">
<div class={`explorer ${displayClass ?? ""}`}> <div class={classNames(displayClass, "explorer")}>
<button <button
type="button" type="button"
id="mobile-explorer" id="mobile-explorer"

View File

@ -2,6 +2,7 @@ import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } fro
import style from "./styles/footer.scss" import style from "./styles/footer.scss"
import { version } from "../../package.json" import { version } from "../../package.json"
import { i18n } from "../i18n" import { i18n } from "../i18n"
import { classNames } from "../util/lang"
interface Options { interface Options {
links: Record<string, string> links: Record<string, string>
@ -12,7 +13,7 @@ export default ((opts?: Options) => {
const year = new Date().getFullYear() const year = new Date().getFullYear()
const links = opts?.links ?? [] const links = opts?.links ?? []
return ( return (
<footer class={`${displayClass ?? ""}`}> <footer class={classNames(displayClass)}>
<p> <p>
{i18n(cfg.locale).components.footer.createdWith}{" "} {i18n(cfg.locale).components.footer.createdWith}{" "}
<a href="https://quartz.jzhao.xyz/">Quartz v{version}</a> © {year} <a href="https://quartz.jzhao.xyz/">Quartz v{version}</a> © {year}