Skip to content

Commit

Permalink
fix: unify setting tab icon color, fix #303
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Sep 9, 2024
1 parent 6c60dd2 commit 33a049a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions icons/mgc/power.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions src/renderer/src/modules/settings/title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ export const SettingsTitle = ({
className?: string
loader?: () => SettingPageConfig
}) => {
const { iconName, name: title } = (useLoaderData() ||
loader?.() ||
{}) as SettingPageConfig
const {
iconName,
name: title,
headerIcon,
} = (useLoaderData() || loader?.() || {}) as SettingPageConfig

if (!title) {
return null
Expand All @@ -52,7 +54,7 @@ export const SettingsTitle = ({
className,
)}
>
<i className={iconName} />
<i className={headerIcon || iconName} />
<span>{title}</span>
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/modules/settings/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export interface SettingPageConfig {
iconName: string
name: string
priority: number

headerIcon?: string
}
export const defineSettingPage = (config: SettingPageConfig) => () => ({
...config,
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/pages/settings/(settings)/wallet.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { SettingWallet } from "@renderer/modules/settings/tabs/wallet"
import { defineSettingPage } from "@renderer/modules/settings/utils"

const iconName = "i-mgc-power"
const iconName = `i-mgc-power-outline`
const name = "Power"
const priority = 1050

export const loader = defineSettingPage({
iconName,
name,
priority,
headerIcon: `i-mgc-power text-accent`,
})

export function Component() {
Expand Down

0 comments on commit 33a049a

Please sign in to comment.