Skip to content

Commit d8ca62e

Browse files
authored
Merge pull request #84 from K97i/v2-modal-clickless
Add modals with no expanded content (and fix stuff from prev prs lol)
2 parents 10fb128 + 2454ded commit d8ca62e

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

new/apps/web/src/lib/common/ModalWidget.svelte

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,27 @@
2020
let moreInfoExpanded = $state(false);
2121
</script>
2222

23-
<button
24-
onclick={() => {
25-
modalExpanded = true;
26-
}}
27-
class="_widget">
28-
<h1>{title}</h1>
29-
<div class="widget-values">
30-
{@render widgetContents()}
23+
{#if modalContents}
24+
<button
25+
onclick={() => {
26+
modalExpanded = true;
27+
}}
28+
class="_widget">
29+
<h1>{title}</h1>
30+
<div class="widget-values">
31+
{@render widgetContents()}
32+
</div>
33+
</button>
34+
{:else}
35+
<div class="_widget">
36+
<h1>{title}</h1>
37+
<div class="widget-values">
38+
{@render widgetContents()}
39+
</div>
3140
</div>
32-
</button>
41+
{/if}
3342

34-
{#if modalExpanded}
43+
{#if modalContents && modalExpanded}
3544
<span class="backdrop" onclick={() => {modalExpanded = false}} role="none">
3645
</span>
3746
<div class="_modal">

new/apps/web/src/lib/components/Widgets.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
</script>
2020

2121
<div class="widgets">
22-
<Cpu cpu={report.Hardware.Cpu} />
22+
<Cpu cpu={report.Hardware.Cpu} cpuMoreInfo={cpuMoreInfo}/>
2323
<Motherboard
2424
tpm={report.Security.Tpm}
2525
motherboard={report.Hardware.Motherboard}
2626
bios={report.Hardware.BiosInfo}
2727
/>
2828
<Ram ram={report.Hardware.Ram} pagefile={report.System.PageFile}/>
2929
<Gpu gpus={report.Hardware.Gpu} monitors={report.Hardware.Monitors} />
30-
<Nic nic={report.Network.Adapters} />
30+
<Nic nics={report.Network.Adapters} />
3131
<!--
3232
<OS securityData={rawJSON.Security} basicinfoData={rawJSON.BasicInfo} />
3333
-->

new/apps/web/src/routes/+page.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async function cpuLookup(cpu: CpuInfo): Response {
4444

4545
if (!response) {
4646
response = await (
47-
await fetch(`https://spec-ifygoon.com/api/cpus/?name=${encodeURIComponent(cpu.Name)}`, {
47+
await fetch(`https://spec-ify.com/api/cpus/?name=${encodeURIComponent(cpu.Name)}`, {
4848
method: 'GET',
4949
mode: 'cors'
5050
})

0 commit comments

Comments
 (0)