Skip to content

Commit

Permalink
use grid layout
Browse files Browse the repository at this point in the history
  • Loading branch information
pompurin404 committed Aug 11, 2024
1 parent fbd52a4 commit a8e886b
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 20 deletions.
13 changes: 5 additions & 8 deletions src/renderer/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 />
Expand All @@ -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>
Expand All @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/sider/conn-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/sider/dns-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/sider/log-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/sider/mihomo-core-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/sider/override-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/sider/profile-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/sider/proxy-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/sider/resource-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/sider/rule-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/sider/sniff-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/sider/sysproxy-switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/sider/tun-switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
>
Expand Down

0 comments on commit a8e886b

Please sign in to comment.