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 className="m-2">
<div className="grid grid-cols-2 gap-2 mx-2">
<OutboundModeSwitcher />
</div>
{/* <div className="grid">
<SysproxySwitcher />
<TunSwitcher />
<ProfileCard />
@ -66,10 +63,10 @@ const App: React.FC = () => {
<SniffCard />
<LogCard />
<RuleCard />
<TestCard />
<ResourceCard />
<OverrideCard />
</div> */}
<div className="flex justify-between mx-2 mb-2">
</div>
{/* <div className="flex justify-between mx-2 mb-2">
<SysproxySwitcher />
<TunSwitcher />
</div>
@ -91,7 +88,7 @@ const App: React.FC = () => {
<div className="flex justify-between mx-2">
<ResourceCard />
<OverrideCard />
</div>
</div> */}
</div>
<Divider orientation="vertical" />
<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 (
<Card
fullWidth
className={`mb-2 ${match ? 'bg-primary' : ''}`}
className={`col-span-2 ${match ? 'bg-primary' : ''}`}
isPressable
onPress={() => navigate('/connections')}
>

View File

@ -20,7 +20,7 @@ const DNSCard: React.FC = () => {
return (
<Card
className={`w-[50%] mr-1 mb-2 ${match ? 'bg-primary' : ''}`}
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
isPressable
onPress={() => navigate('/dns')}
>

View File

@ -8,7 +8,7 @@ const LogCard: React.FC = () => {
const match = location.pathname.includes('/logs')
return (
<Card
className={`w-[50%] mr-1 mb-2 ${match ? 'bg-primary' : ''}`}
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
isPressable
onPress={() => navigate('/logs')}
>

View File

@ -35,7 +35,7 @@ const MihomoCoreCard: React.FC = () => {
fullWidth
isPressable
onPress={() => navigate('/mihomo')}
className={`mb-2 ${match ? 'bg-primary' : ''}`}
className={`col-span-2 ${match ? 'bg-primary' : ''}`}
>
<CardBody>
<div className="flex justify-between h-[32px]">

View File

@ -22,6 +22,7 @@ const OutboundModeSwitcher: React.FC = () => {
<Tabs
fullWidth
color="primary"
className="col-span-2"
selectedKey={mode}
onSelectionChange={(key: Key) => onChangeMode(key as OutboundMode)}
>

View File

@ -12,7 +12,7 @@ const OverrideCard: React.FC = () => {
return (
<Card
className={`w-[50%] ml-1 mb-2 ${match ? 'bg-primary' : ''}`}
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
isPressable
onPress={() => navigate('/override')}
>

View File

@ -36,7 +36,7 @@ const ProfileCard: React.FC = () => {
{showRuntimeConfig && <ConfigViewer onClose={() => setShowRuntimeConfig(false)} />}
<Card
fullWidth
className={`mb-2 ${match ? 'bg-primary' : ''}`}
className={`col-span-2 ${match ? 'bg-primary' : ''}`}
isPressable
onPress={() => navigate('/profiles')}
>

View File

@ -18,7 +18,7 @@ const ProxyCard: React.FC = () => {
return (
<Card
fullWidth
className={`mb-2 ${match ? 'bg-primary' : ''}`}
className={`col-span-2 ${match ? 'bg-primary' : ''}`}
isPressable
onPress={() => navigate('/proxies')}
>

View File

@ -10,7 +10,7 @@ const ResourceCard: React.FC = () => {
return (
<Card
className={`w-[50%] mr-1 mb-2 ${match ? 'bg-primary' : ''}`}
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
isPressable
onPress={() => navigate('/resources')}
>

View File

@ -14,7 +14,7 @@ const RuleCard: React.FC = () => {
return (
<Card
className={`w-[50%] ml-1 mb-2 ${match ? 'bg-primary' : ''}`}
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
isPressable
onPress={() => navigate('/rules')}
>

View File

@ -20,7 +20,7 @@ const SniffCard: React.FC = () => {
return (
<Card
className={`w-[50%] ml-1 mb-2 ${match ? 'bg-primary' : ''}`}
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
isPressable
onPress={() => navigate('/sniffer')}
>

View File

@ -25,7 +25,7 @@ const SysproxySwitcher: React.FC = () => {
return (
<Card
className={`w-[50%] mr-1 ${match ? 'bg-primary' : ''}`}
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
isPressable
onPress={() => navigate('/sysproxy')}
>

View File

@ -52,7 +52,7 @@ const TunSwitcher: React.FC = () => {
/>
)}
<Card
className={`w-[50%] ml-1 ${match ? 'bg-primary' : ''}`}
className={`col-span-1 ${match ? 'bg-primary' : ''}`}
isPressable
onPress={() => navigate('/tun')}
>