fix(codebase): optimize layout paddings for code editor feel
This commit is contained in:
@@ -50,26 +50,21 @@ export default function CodeTab() {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
minHeight: "100vh",
|
||||
height: "100vh",
|
||||
background: THEME.canvasGradient,
|
||||
fontFamily: THEME.font,
|
||||
padding: "24px",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
maxWidth: "100%",
|
||||
margin: "0 auto",
|
||||
height: "calc(100vh - 48px)",
|
||||
padding: "16px",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
padding={0}
|
||||
style={{
|
||||
overflow: "hidden",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
height: "100%",
|
||||
flex: 1,
|
||||
minHeight: 0,
|
||||
}}
|
||||
>
|
||||
<div style={grid}>
|
||||
@@ -111,9 +106,7 @@ export default function CodeTab() {
|
||||
{/* Code Files */}
|
||||
<RailGroup
|
||||
title={
|
||||
codebases?.length === 1
|
||||
? codebases[0].label
|
||||
: "Code files"
|
||||
codebases?.length === 1 ? codebases[0].label : "Code files"
|
||||
}
|
||||
count={codebases?.length ?? 0}
|
||||
>
|
||||
@@ -150,7 +143,7 @@ export default function CodeTab() {
|
||||
<div
|
||||
style={{
|
||||
...tileHeader,
|
||||
padding: "20px 24px 12px",
|
||||
padding: "16px 20px 8px",
|
||||
}}
|
||||
>
|
||||
<span style={chevronCell}>
|
||||
@@ -173,9 +166,7 @@ export default function CodeTab() {
|
||||
>
|
||||
{cb.label}
|
||||
</div>
|
||||
{cb.hint && (
|
||||
<div style={tileHint}>{cb.hint}</div>
|
||||
)}
|
||||
{cb.hint && <div style={tileHint}>{cb.hint}</div>}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
@@ -183,8 +174,8 @@ export default function CodeTab() {
|
||||
style={{
|
||||
padding:
|
||||
codebases.length > 1
|
||||
? "0 10px 24px 10px"
|
||||
: "10px 10px 24px 10px",
|
||||
? "0 8px 16px 8px"
|
||||
: "12px 8px 16px 8px",
|
||||
}}
|
||||
>
|
||||
<GiteaFileTree
|
||||
@@ -223,10 +214,7 @@ export default function CodeTab() {
|
||||
}}
|
||||
>
|
||||
{selection?.type === "file" && (
|
||||
<GiteaFileViewer
|
||||
projectId={projectId}
|
||||
path={selection.path}
|
||||
/>
|
||||
<GiteaFileViewer projectId={projectId} path={selection.path} />
|
||||
)}
|
||||
{!selection && (
|
||||
<div
|
||||
@@ -249,7 +237,6 @@ export default function CodeTab() {
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -390,9 +377,7 @@ const leftCol: React.CSSProperties = {
|
||||
minWidth: 0,
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
gap: 24,
|
||||
borderRight: `1px solid ${THEME.borderSoft}`,
|
||||
padding: "20px",
|
||||
overflowY: "auto",
|
||||
};
|
||||
|
||||
|
||||
@@ -144,10 +144,6 @@ export function GiteaFileViewer({ projectId, path }: GiteaFileViewerProps) {
|
||||
minHeight: 0,
|
||||
position: "relative",
|
||||
background: THEME.cardBg,
|
||||
border: `1px solid ${THEME.border}`,
|
||||
borderRadius: THEME.radiusSm,
|
||||
boxShadow: THEME.shadow,
|
||||
overflow: "hidden",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
@@ -155,20 +151,19 @@ export function GiteaFileViewer({ projectId, path }: GiteaFileViewerProps) {
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
padding: "8px 12px",
|
||||
padding: "10px 16px",
|
||||
background: THEME.subtleBg,
|
||||
borderBottom: `1px solid ${THEME.borderSoft}`,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
fontSize: "0.8rem",
|
||||
fontSize: "0.85rem",
|
||||
color: THEME.mid,
|
||||
fontFamily: "ui-monospace, monospace",
|
||||
fontWeight: 500,
|
||||
}}
|
||||
>
|
||||
{basename(path)}
|
||||
{path}
|
||||
</div>
|
||||
{!isImage && (
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user