11import { css , type Component } from "dreamland/core" ;
22import type { Tab } from "../Tab" ;
33import type { IconifyIcon } from "@iconify/types" ;
4+ import { versionInfo } from "@mercuryworkshop/scramjet" ;
45import { Icon } from "../components/Icon" ;
56import { browser } from "../Browser" ;
67import { Checkbox } from "../components/Checkbox" ;
@@ -15,15 +16,10 @@ import {
1516 iconAbout ,
1617} from "../icons" ;
1718
18- export const SettingsPage : Component <
19- {
20- tab : Tab ;
21- } ,
22- {
23- selected : string ;
24- searchQuery : string ;
25- }
26- > = function ( ) {
19+ export function SettingsPage (
20+ this : { selected : string ; searchQuery : string } ,
21+ props : { tab : Tab }
22+ ) {
2723 this . selected = "general" ;
2824 this . searchQuery = "" ;
2925
@@ -137,7 +133,9 @@ export const SettingsPage: Component<
137133 id = "startup-new-tab"
138134 name = "startupPage"
139135 value = "new-tab"
140- checked = { browser . settings . startupPage === "new-tab" }
136+ checked = { use ( browser . settings . startupPage ) . map (
137+ ( v ) => v === "new-tab"
138+ ) }
141139 on :change = { ( ) => {
142140 browser . settings . startupPage = "new-tab" ;
143141 } }
@@ -150,9 +148,9 @@ export const SettingsPage: Component<
150148 id = "startup-continue"
151149 name = "startupPage"
152150 value = "continue"
153- checked = {
154- browser . settings . startupPage === "continue"
155- }
151+ checked = { use ( browser . settings . startupPage ) . map (
152+ ( v ) => v === "continue"
153+ ) }
156154 on :change = { ( ) => {
157155 browser . settings . startupPage = "continue" ;
158156 } }
@@ -175,9 +173,6 @@ export const SettingsPage: Component<
175173 < div class = "checkbox-option" >
176174 < Checkbox
177175 value = { use ( browser . settings . showBookmarksBar ) }
178- on :change = { ( checked ) => {
179- browser . settings . showBookmarksBar = checked ;
180- } }
181176 />
182177 < label for = "show-bookmarks-bar" >
183178 Always show bookmarks bar
@@ -206,12 +201,7 @@ export const SettingsPage: Component<
206201 < div class = "setting-group" >
207202 < select
208203 class = "select-input"
209- value = { browser . settings . defaultSearchEngine }
210- on :change = { ( e : Event ) => {
211- browser . settings . defaultSearchEngine = (
212- e . target as HTMLSelectElement
213- ) . value as any ;
214- } }
204+ value = { use ( browser . settings . defaultSearchEngine ) }
215205 >
216206 < option value = "google" > Google</ option >
217207 < option value = "bing" > Bing</ option >
@@ -233,9 +223,6 @@ export const SettingsPage: Component<
233223 < div class = "checkbox-option" >
234224 < Checkbox
235225 value = { use ( browser . settings . searchSuggestionsEnabled ) }
236- on :change = { ( checked ) => {
237- browser . settings . searchSuggestionsEnabled = checked ;
238- } }
239226 />
240227 < label for = "search-suggestions" >
241228 Show search and site suggestions in the address bar
@@ -262,24 +249,14 @@ export const SettingsPage: Component<
262249 < div class = "section-content" >
263250 < div class = "setting-group" >
264251 < div class = "checkbox-option" >
265- < Checkbox
266- value = { use ( browser . settings . blockTrackers ) }
267- on :change = { ( value ) => {
268- browser . settings . blockTrackers = value ;
269- } }
270- />
252+ < Checkbox value = { use ( browser . settings . blockTrackers ) } />
271253 < label for = "block-trackers" >
272254 Block third-party trackers
273255 </ label >
274256 </ div >
275257
276258 < div class = "checkbox-option" >
277- < Checkbox
278- value = { use ( browser . settings . doNotTrack ) }
279- on :change = { ( checked ) => {
280- browser . settings . doNotTrack = checked ;
281- } }
282- />
259+ < Checkbox value = { use ( browser . settings . doNotTrack ) } />
283260 < label for = "do-not-track" >
284261 Send 'Do Not Track' with browsing requests
285262 </ label >
@@ -299,9 +276,6 @@ export const SettingsPage: Component<
299276 < div class = "checkbox-option" >
300277 < Checkbox
301278 value = { use ( browser . settings . clearHistoryOnExit ) }
302- on :change = { ( checked ) => {
303- browser . settings . clearHistoryOnExit = checked ;
304- } }
305279 />
306280 < label for = "clear-history" >
307281 Clear history when browser closes
@@ -351,9 +325,6 @@ export const SettingsPage: Component<
351325 < div class = "checkbox-option" >
352326 < Checkbox
353327 value = { use ( browser . settings . extensionsDevMode ) }
354- on :change = { ( checked ) => {
355- browser . settings . extensionsDevMode = checked ;
356- } }
357328 />
358329 < label for = "dev-mode" > Enable developer mode</ label >
359330 </ div >
@@ -387,7 +358,10 @@ export const SettingsPage: Component<
387358 />
388359 < div class = "browser-info" >
389360 < h3 > Browser.js</ h3 >
390- { /* <p>Scramjet Version: {$scramjetVersion.build} {$scramjetVersion.version}</p> */ }
361+ < p >
362+ Scramjet Version: { versionInfo . version } (
363+ { versionInfo . build } )
364+ </ p >
391365 < p > © 2025 Puter Technologies</ p >
392366 </ div >
393367 </ div >
@@ -418,7 +392,7 @@ export const SettingsPage: Component<
418392 </ div >
419393 </ div >
420394 ) ;
421- } ;
395+ }
422396
423397SettingsPage . style = css `
424398 : scope {
0 commit comments