Skip to content

Commit 2c5074b

Browse files
format
1 parent b667f7a commit 2c5074b

File tree

8 files changed

+117
-109
lines changed

8 files changed

+117
-109
lines changed

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.1.4/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.4.6/schema.json",
33
"formatter": {
44
"enabled": true,
55
"indentStyle": "tab"

src/components/lspInfoDialog/index.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -634,22 +634,24 @@ function showLspInfoDialog() {
634634
</div>
635635
</div>
636636
<div className="lsp-logs-container">
637-
{logs.length === 0
638-
? <div className="lsp-logs-empty">No logs yet</div>
639-
: logs.slice(-50).map((log) => {
640-
const time = log.timestamp.toLocaleTimeString("en-US", {
641-
hour12: false,
642-
hour: "2-digit",
643-
minute: "2-digit",
644-
second: "2-digit",
645-
});
646-
return (
647-
<div className={`lsp-log ${log.level}`}>
648-
<span className="lsp-log-time">{time}</span>
649-
<span className="lsp-log-text">{log.message}</span>
650-
</div>
651-
);
652-
})}
637+
{logs.length === 0 ? (
638+
<div className="lsp-logs-empty">No logs yet</div>
639+
) : (
640+
logs.slice(-50).map((log) => {
641+
const time = log.timestamp.toLocaleTimeString("en-US", {
642+
hour12: false,
643+
hour: "2-digit",
644+
minute: "2-digit",
645+
second: "2-digit",
646+
});
647+
return (
648+
<div className={`lsp-log ${log.level}`}>
649+
<span className="lsp-log-time">{time}</span>
650+
<span className="lsp-log-text">{log.message}</span>
651+
</div>
652+
);
653+
})
654+
)}
653655
</div>
654656
</div>
655657
);

src/components/settingsPage.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,9 @@ function createTrailingValueDisplay(item) {
435435
return (
436436
<div className={`setting-value-display ${item.select ? "is-select" : ""}`}>
437437
{$trailingValueText}
438-
{item.select
439-
? <span className="icon keyboard_arrow_down setting-value-icon"></span>
440-
: null}
438+
{item.select ? (
439+
<span className="icon keyboard_arrow_down setting-value-icon"></span>
440+
) : null}
441441
</div>
442442
);
443443
}
@@ -491,9 +491,9 @@ function buildListContent(renderedItems, options) {
491491

492492
function createSectionElements(category) {
493493
const shouldShowLabel = category !== "__default__";
494-
const $label = shouldShowLabel
495-
? <div className="settings-section-label">{category}</div>
496-
: null;
494+
const $label = shouldShowLabel ? (
495+
<div className="settings-section-label">{category}</div>
496+
) : null;
497497
const $card = <div className="settings-section-card"></div>;
498498
return {
499499
$card,

src/components/toast/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ export default function toast(message, duration = 0, bgColor, color) {
1919
style={{ backgroundColor: bgColor, color }}
2020
>
2121
<span className="message">{message}</span>
22-
{duration === false
23-
? <button
24-
className="icon clearclose"
25-
onclick={() => $toast.hide()}
26-
></button>
27-
: ""}
22+
{duration === false ? (
23+
<button
24+
className="icon clearclose"
25+
onclick={() => $toast.hide()}
26+
></button>
27+
) : (
28+
""
29+
)}
2830
</div>
2931
);
3032

src/dialogs/select.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ function select(title, items, options = {}) {
4848
const $list = tag("ul", {
4949
className: `scroll${!textTransform ? " no-text-transform" : ""}`,
5050
});
51-
const $titleSpan = title
52-
? <strong className="title">{title}</strong>
53-
: null;
51+
const $titleSpan = title ? (
52+
<strong className="title">{title}</strong>
53+
) : null;
5454
const $select = (
5555
<div className="prompt select">
5656
{$titleSpan ? [$titleSpan, $list] : $list}

src/pages/fontManager/fontManager.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -307,20 +307,20 @@ export default function fontManager() {
307307
<div className="text">{name}</div>
308308
<small className="value">{subtitle}</small>
309309
</div>
310-
{isCurrent || !isDefault
311-
? <div className="setting-tail">
312-
{isCurrent
313-
? <span className="font-manager-current">Current</span>
314-
: null}
315-
{!isDefault
316-
? <span
317-
className="icon delete font-manager-action"
318-
data-action="delete"
319-
title="Delete font"
320-
></span>
321-
: null}
322-
</div>
323-
: null}
310+
{isCurrent || !isDefault ? (
311+
<div className="setting-tail">
312+
{isCurrent ? (
313+
<span className="font-manager-current">Current</span>
314+
) : null}
315+
{!isDefault ? (
316+
<span
317+
className="icon delete font-manager-action"
318+
data-action="delete"
319+
title="Delete font"
320+
></span>
321+
) : null}
322+
</div>
323+
) : null}
324324
</div>
325325
);
326326

src/pages/plugin/plugin.view.js

Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ export default (props) => {
100100
<div className="plugin-info">
101101
<div className="title-wrapper">
102102
<h1 className="plugin-name">{name}</h1>
103-
{repository
104-
? <a href={repository} className="source-indicator">
105-
<i className="icon github"></i>
106-
<span>{strings.open_source}</span>
107-
</a>
108-
: null}
103+
{repository ? (
104+
<a href={repository} className="source-indicator">
105+
<i className="icon github"></i>
106+
<span>{strings.open_source}</span>
107+
</a>
108+
) : null}
109109
</div>
110110
<div className="plugin-meta">
111111
<span className="meta-item">
@@ -121,14 +121,16 @@ export default (props) => {
121121
<a href={`https://github.com/${authorGithub}`} className="">
122122
{author}
123123
</a>
124-
{authorVerified
125-
? <i
126-
on:click={() => {
127-
toast(strings["verified publisher"]);
128-
}}
129-
className="licons verified verified-tick"
130-
></i>
131-
: ""}
124+
{authorVerified ? (
125+
<i
126+
on:click={() => {
127+
toast(strings["verified publisher"]);
128+
}}
129+
className="licons verified verified-tick"
130+
></i>
131+
) : (
132+
""
133+
)}
132134
</span>
133135
<span className="meta-item">
134136
<span
@@ -138,44 +140,44 @@ export default (props) => {
138140
{license || "Unknown"}
139141
</span>
140142
</div>
141-
{votesUp !== undefined
142-
? <div className="metrics-row">
143-
<div className="metric">
144-
<span className="icon save_alt"></span>
145-
<span className="metric-value">
146-
{helpers.formatDownloadCount(
147-
typeof downloads === "string"
148-
? Number.parseInt(downloads)
149-
: downloads,
150-
)}
151-
</span>
152-
<span>{strings.downloads}</span>
153-
</div>
154-
<div className="metric">
155-
<i className="icon favorite"></i>
156-
<span
157-
className={`rating-value ${rating === "unrated" ? "" : rating.replace("%", "") >= 80 ? "rating-high" : rating.replace("%", "") >= 50 ? "rating-medium" : "rating-low"}`}
158-
>
159-
{rating}
160-
</span>
161-
</div>
162-
<div
163-
className="metric"
164-
onclick={showReviews.bind(null, id, author)}
143+
{votesUp !== undefined ? (
144+
<div className="metrics-row">
145+
<div className="metric">
146+
<span className="icon save_alt"></span>
147+
<span className="metric-value">
148+
{helpers.formatDownloadCount(
149+
typeof downloads === "string"
150+
? Number.parseInt(downloads)
151+
: downloads,
152+
)}
153+
</span>
154+
<span>{strings.downloads}</span>
155+
</div>
156+
<div className="metric">
157+
<i className="icon favorite"></i>
158+
<span
159+
className={`rating-value ${rating === "unrated" ? "" : rating.replace("%", "") >= 80 ? "rating-high" : rating.replace("%", "") >= 50 ? "rating-medium" : "rating-low"}`}
165160
>
166-
<i className="icon chat_bubble"></i>
167-
<span className="metric-value">{commentCount}</span>
168-
<span>{strings.reviews}</span>
169-
</div>
161+
{rating}
162+
</span>
170163
</div>
171-
: null}
172-
{Array.isArray(keywords) && keywords.length
173-
? <div className="keywords">
174-
{keywords.map((keyword) => (
175-
<span className="keyword">{keyword}</span>
176-
))}
164+
<div
165+
className="metric"
166+
onclick={showReviews.bind(null, id, author)}
167+
>
168+
<i className="icon chat_bubble"></i>
169+
<span className="metric-value">{commentCount}</span>
170+
<span>{strings.reviews}</span>
177171
</div>
178-
: null}
172+
</div>
173+
) : null}
174+
{Array.isArray(keywords) && keywords.length ? (
175+
<div className="keywords">
176+
{keywords.map((keyword) => (
177+
<span className="keyword">{keyword}</span>
178+
))}
179+
</div>
180+
) : null}
179181
</div>
180182
<div className="action-buttons">
181183
<Buttons {...props} />

src/sidebarApps/extensions/index.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -726,20 +726,22 @@ function ListItem({ icon, name, id, version, downloads, installed, source }) {
726726
>
727727
{name}
728728
</span>
729-
{installed
730-
? <>
731-
{source
732-
? <span className="icon replay" data-action="rebuild-plugin" />
733-
: null}
734-
<span className="icon more_vert" data-action="more-plugin-action" />
735-
</>
736-
: <button
737-
type="button"
738-
className="install-btn"
739-
data-action="install-plugin"
740-
>
741-
<span className="icon file_downloadget_app" />
742-
</button>}
729+
{installed ? (
730+
<>
731+
{source ? (
732+
<span className="icon replay" data-action="rebuild-plugin" />
733+
) : null}
734+
<span className="icon more_vert" data-action="more-plugin-action" />
735+
</>
736+
) : (
737+
<button
738+
type="button"
739+
className="install-btn"
740+
data-action="install-plugin"
741+
>
742+
<span className="icon file_downloadget_app" />
743+
</button>
744+
)}
743745
</div>
744746
);
745747

0 commit comments

Comments
 (0)