Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
pompurin404 committed Oct 22, 2024
1 parent cd0a9dd commit 6e4a87f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/renderer/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import { driver } from 'driver.js'
import 'driver.js/dist/driver.css'

let navigate: NavigateFunction
const narrowWidth = platform === 'darwin' ? 70 : 60

const App: React.FC = () => {
const { appConfig, patchAppConfig } = useAppConfig()
Expand All @@ -62,6 +61,7 @@ const App: React.FC = () => {
'substore'
]
} = appConfig || {}
const narrowWidth = platform === 'darwin' ? 70 : 60
const [order, setOrder] = useState(siderOrder)
const [siderWidthValue, setSiderWidthValue] = useState(siderWidth)
const siderWidthValueRef = useRef(siderWidthValue)
Expand Down Expand Up @@ -200,6 +200,7 @@ const App: React.FC = () => {
{platform !== 'darwin' && (
<MihomoIcon className="h-[32px] leading-[32px] text-lg mx-[1px]" />
)}
<UpdaterButton iconOnly={true} />
</div>
<div className="h-[calc(100%-110px)] overflow-y-auto no-scrollbar">
<div className="h-full w-full flex flex-col gap-2">
Expand Down
43 changes: 32 additions & 11 deletions src/renderer/src/components/updater/updater-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ import React, { useState } from 'react'
import useSWR from 'swr'
import UpdaterModal from './updater-modal'
import { platform } from '@renderer/utils/init'
import { MdNewReleases } from 'react-icons/md'

const UpdaterButton: React.FC = () => {
interface Props {
iconOnly?: boolean
}

const UpdaterButton: React.FC<Props> = (props) => {
const { appConfig } = useAppConfig()
const { iconOnly } = props
const { autoCheckUpdate, useWindowFrame = false } = appConfig || {}
const [openModal, setOpenModal] = useState(false)
const { data: latest } = useSWR(
Expand All @@ -30,16 +36,31 @@ const UpdaterButton: React.FC = () => {
}}
/>
)}
<Button
className={`fixed left-[85px] app-nodrag ${!useWindowFrame && platform === 'darwin' ? 'ml-[60px]' : ''}`}
color="danger"
size="sm"
onPress={() => {
setOpenModal(true)
}}
>
v{latest.version}
</Button>
{iconOnly ? (
<Button
isIconOnly
variant="flat"
className={`fixed rounded-full app-nodrag`}
color="danger"
size="md"
onPress={() => {
setOpenModal(true)
}}
>
<MdNewReleases className="text-[35px]" />
</Button>
) : (
<Button
className={`fixed left-[85px] app-nodrag ${!useWindowFrame && platform === 'darwin' ? 'ml-[60px]' : ''}`}
color="danger"
size="sm"
onPress={() => {
setOpenModal(true)
}}
>
v{latest.version}
</Button>
)}
</>
)
}
Expand Down

0 comments on commit 6e4a87f

Please sign in to comment.