mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
use grid layout
This commit is contained in:
parent
fbd52a40f6
commit
a8e886b9bb
@ -51,11 +51,8 @@ const App: React.FC = () => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="grid grid-cols-2 gap-2 mx-2">
|
||||||
<div className="m-2">
|
|
||||||
<OutboundModeSwitcher />
|
<OutboundModeSwitcher />
|
||||||
</div>
|
|
||||||
{/* <div className="grid">
|
|
||||||
<SysproxySwitcher />
|
<SysproxySwitcher />
|
||||||
<TunSwitcher />
|
<TunSwitcher />
|
||||||
<ProfileCard />
|
<ProfileCard />
|
||||||
@ -66,10 +63,10 @@ const App: React.FC = () => {
|
|||||||
<SniffCard />
|
<SniffCard />
|
||||||
<LogCard />
|
<LogCard />
|
||||||
<RuleCard />
|
<RuleCard />
|
||||||
<TestCard />
|
<ResourceCard />
|
||||||
<OverrideCard />
|
<OverrideCard />
|
||||||
</div> */}
|
</div>
|
||||||
<div className="flex justify-between mx-2 mb-2">
|
{/* <div className="flex justify-between mx-2 mb-2">
|
||||||
<SysproxySwitcher />
|
<SysproxySwitcher />
|
||||||
<TunSwitcher />
|
<TunSwitcher />
|
||||||
</div>
|
</div>
|
||||||
@ -91,7 +88,7 @@ const App: React.FC = () => {
|
|||||||
<div className="flex justify-between mx-2">
|
<div className="flex justify-between mx-2">
|
||||||
<ResourceCard />
|
<ResourceCard />
|
||||||
<OverrideCard />
|
<OverrideCard />
|
||||||
</div>
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
<Divider orientation="vertical" />
|
<Divider orientation="vertical" />
|
||||||
<div className="main w-[calc(100%-251px)] h-full overflow-y-auto">{page}</div>
|
<div className="main w-[calc(100%-251px)] h-full overflow-y-auto">{page}</div>
|
||||||
|
|||||||
@ -26,7 +26,7 @@ const ConnCard: React.FC = () => {
|
|||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
fullWidth
|
fullWidth
|
||||||
className={`mb-2 ${match ? 'bg-primary' : ''}`}
|
className={`col-span-2 ${match ? 'bg-primary' : ''}`}
|
||||||
isPressable
|
isPressable
|
||||||
onPress={() => navigate('/connections')}
|
onPress={() => navigate('/connections')}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -20,7 +20,7 @@ const DNSCard: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
className={`w-[50%] mr-1 mb-2 ${match ? 'bg-primary' : ''}`}
|
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
|
||||||
isPressable
|
isPressable
|
||||||
onPress={() => navigate('/dns')}
|
onPress={() => navigate('/dns')}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -8,7 +8,7 @@ const LogCard: React.FC = () => {
|
|||||||
const match = location.pathname.includes('/logs')
|
const match = location.pathname.includes('/logs')
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
className={`w-[50%] mr-1 mb-2 ${match ? 'bg-primary' : ''}`}
|
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
|
||||||
isPressable
|
isPressable
|
||||||
onPress={() => navigate('/logs')}
|
onPress={() => navigate('/logs')}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -35,7 +35,7 @@ const MihomoCoreCard: React.FC = () => {
|
|||||||
fullWidth
|
fullWidth
|
||||||
isPressable
|
isPressable
|
||||||
onPress={() => navigate('/mihomo')}
|
onPress={() => navigate('/mihomo')}
|
||||||
className={`mb-2 ${match ? 'bg-primary' : ''}`}
|
className={`col-span-2 ${match ? 'bg-primary' : ''}`}
|
||||||
>
|
>
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<div className="flex justify-between h-[32px]">
|
<div className="flex justify-between h-[32px]">
|
||||||
|
|||||||
@ -22,6 +22,7 @@ const OutboundModeSwitcher: React.FC = () => {
|
|||||||
<Tabs
|
<Tabs
|
||||||
fullWidth
|
fullWidth
|
||||||
color="primary"
|
color="primary"
|
||||||
|
className="col-span-2"
|
||||||
selectedKey={mode}
|
selectedKey={mode}
|
||||||
onSelectionChange={(key: Key) => onChangeMode(key as OutboundMode)}
|
onSelectionChange={(key: Key) => onChangeMode(key as OutboundMode)}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -12,7 +12,7 @@ const OverrideCard: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
className={`w-[50%] ml-1 mb-2 ${match ? 'bg-primary' : ''}`}
|
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
|
||||||
isPressable
|
isPressable
|
||||||
onPress={() => navigate('/override')}
|
onPress={() => navigate('/override')}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -36,7 +36,7 @@ const ProfileCard: React.FC = () => {
|
|||||||
{showRuntimeConfig && <ConfigViewer onClose={() => setShowRuntimeConfig(false)} />}
|
{showRuntimeConfig && <ConfigViewer onClose={() => setShowRuntimeConfig(false)} />}
|
||||||
<Card
|
<Card
|
||||||
fullWidth
|
fullWidth
|
||||||
className={`mb-2 ${match ? 'bg-primary' : ''}`}
|
className={`col-span-2 ${match ? 'bg-primary' : ''}`}
|
||||||
isPressable
|
isPressable
|
||||||
onPress={() => navigate('/profiles')}
|
onPress={() => navigate('/profiles')}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -18,7 +18,7 @@ const ProxyCard: React.FC = () => {
|
|||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
fullWidth
|
fullWidth
|
||||||
className={`mb-2 ${match ? 'bg-primary' : ''}`}
|
className={`col-span-2 ${match ? 'bg-primary' : ''}`}
|
||||||
isPressable
|
isPressable
|
||||||
onPress={() => navigate('/proxies')}
|
onPress={() => navigate('/proxies')}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -10,7 +10,7 @@ const ResourceCard: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
className={`w-[50%] mr-1 mb-2 ${match ? 'bg-primary' : ''}`}
|
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
|
||||||
isPressable
|
isPressable
|
||||||
onPress={() => navigate('/resources')}
|
onPress={() => navigate('/resources')}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -14,7 +14,7 @@ const RuleCard: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
className={`w-[50%] ml-1 mb-2 ${match ? 'bg-primary' : ''}`}
|
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
|
||||||
isPressable
|
isPressable
|
||||||
onPress={() => navigate('/rules')}
|
onPress={() => navigate('/rules')}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -20,7 +20,7 @@ const SniffCard: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
className={`w-[50%] ml-1 mb-2 ${match ? 'bg-primary' : ''}`}
|
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
|
||||||
isPressable
|
isPressable
|
||||||
onPress={() => navigate('/sniffer')}
|
onPress={() => navigate('/sniffer')}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -25,7 +25,7 @@ const SysproxySwitcher: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
className={`w-[50%] mr-1 ${match ? 'bg-primary' : ''}`}
|
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
|
||||||
isPressable
|
isPressable
|
||||||
onPress={() => navigate('/sysproxy')}
|
onPress={() => navigate('/sysproxy')}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -52,7 +52,7 @@ const TunSwitcher: React.FC = () => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Card
|
<Card
|
||||||
className={`w-[50%] ml-1 ${match ? 'bg-primary' : ''}`}
|
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
|
||||||
isPressable
|
isPressable
|
||||||
onPress={() => navigate('/tun')}
|
onPress={() => navigate('/tun')}
|
||||||
>
|
>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user