Skip to content

Commit 37a0304

Browse files
committed
move common dialogs
1 parent e82b606 commit 37a0304

File tree

12 files changed

+511
-560
lines changed

12 files changed

+511
-560
lines changed

app/db/query.sql.go

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/db/sql/query.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ DELETE FROM texture WHERE texture.id = :id;
125125
-- name: SelectModsByGbId :many
126126
SELECT * FROM mod WHERE mod.gb_id = :gbId;
127127

128+
-- name: UpdateTagName :exec
129+
UPDATE tag SET
130+
tag_name = :updatedName
131+
WHERE mod_id = :id AND tag_name = :oldName;
132+
128133
-- name: UpdateModEnabledById :exec
129134
UPDATE mod SET
130135
selected = :selected

app/frontend/src/App.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } f
1414
import { GetAppUpdate, DismissUpdate } from "wailsjs/go/main/App"
1515
import { types } from "wailsjs/go/models";
1616
import { BrowserOpenURL } from "wailsjs/runtime/runtime";
17+
import AppDialogHost from "./components/appdialog";
1718

1819
function App() {
1920

@@ -32,20 +33,22 @@ function App() {
3233
<SidebarInset className="overflow-hidden">
3334
<DownloadOverlay />
3435
<AppUpdateDialog />
35-
<ScrollProvider provideRef={scrollAreaRef}>
36-
<div
37-
id="main"
38-
ref={scrollAreaRef}
39-
className={cn(
40-
!expanded && queued > 0
41-
? "max-h-[calc(100vh-30px)]"
42-
: "max-h-[calc(100vh)]",
43-
"overflow-y-auto overflow-x-hidden"
44-
)}
45-
>
46-
<Outlet />
47-
</div>
48-
</ScrollProvider>
36+
<AppDialogHost>
37+
<ScrollProvider provideRef={scrollAreaRef}>
38+
<div
39+
id="main"
40+
ref={scrollAreaRef}
41+
className={cn(
42+
!expanded && queued > 0
43+
? "max-h-[calc(100vh-30px)]"
44+
: "max-h-[calc(100vh)]",
45+
"overflow-y-auto overflow-x-hidden"
46+
)}
47+
>
48+
<Outlet />
49+
</div>
50+
</ScrollProvider>
51+
</AppDialogHost>
4952
</SidebarInset>
5053
</SidebarProvider>
5154
</div>

app/frontend/src/components/CharacterInfoCard.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ export function ModActionsDropDown(props: {
321321
onView: () => void;
322322
onEnable: () => void;
323323
onKeymapEdit?: () => void;
324+
addTag: () => void;
324325
}) {
325326
const [isOpen, setOpen] = useState(false);
326327

@@ -372,6 +373,11 @@ export function ModActionsDropDown(props: {
372373
<span className="w-full">Toggle</span>
373374
<DropdownMenuShortcut>⇧t</DropdownMenuShortcut>
374375
</DropdownMenuItem>
376+
<DropdownMenuItem onClick={props.addTag}>
377+
<CheckCheckIcon className="mr-2 h-4 w-4" />
378+
<span className="w-full">Add Tag</span>
379+
<DropdownMenuShortcut>⇧a</DropdownMenuShortcut>
380+
</DropdownMenuItem>
375381
{props.onKeymapEdit ? (
376382
<DropdownMenuItem onClick={props.onKeymapEdit}>
377383
<CheckCheckIcon className="mr-2 h-4 w-4" />

app/frontend/src/components/NameDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function NameDialogContent(props: {
7474
<Input
7575
value={inputValue}
7676
onChange={handleChange}
77-
defaultValue="Playlist"
77+
defaultValue=""
7878
/>
7979
</div>
8080
</div>

0 commit comments

Comments
 (0)