use grid layout

This commit is contained in:
pompurin404 2024-08-11 13:31:16 +08:00
parent fbd52a40f6
commit a8e886b9bb
No known key found for this signature in database
14 changed files with 18 additions and 20 deletions

View File

@ -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>

View File

@ -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')}
> >

View File

@ -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')}
> >

View File

@ -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')}
> >

View File

@ -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]">

View File

@ -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)}
> >

View File

@ -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')}
> >

View File

@ -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')}
> >

View File

@ -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')}
> >

View File

@ -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')}
> >

View File

@ -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')}
> >

View File

@ -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')}
> >

View File

@ -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')}
> >

View File

@ -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')}
> >