Skip to content

Commit d79726c

Browse files
committed
chore: renamed variables, small styling, and added/removed props
1 parent c8e4a2e commit d79726c

3 files changed

Lines changed: 28 additions & 49 deletions

File tree

apps/site/src/app/(home)/sections/About/About.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ const About = () => {
2222
return (
2323
<section className={styles.about}>
2424
<div className={styles.content}>
25-
<RetroWindow title="What is ZotHacks?" useChildBackground>
26-
<p className={styles.aboutWindowText} style={{ backgroundColor: "white" }}>
25+
<RetroWindow title="What is ZotHacks?">
26+
<p className={styles.aboutWindowText}>
2727
ZotHacks is a 12-hour hackathon designed for beginners where students
2828
with minimal computer science experience will learn to build their
2929
first CS project. Through ZotHacks, we introduce these students to the

apps/site/src/components/RetroWindow/RetroWindow.module.scss

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@use "zothacks-theme" as theme;
22

33
$window-gray: #e2e2e0;
4-
$child-border: #ababad;
54

65
.root {
76
width: 100%;
@@ -19,7 +18,7 @@ $child-border: #ababad;
1918
align-items: center;
2019
justify-content: space-between;
2120
gap: 0.75rem;
22-
padding: 0.35rem 0.5rem;
21+
padding: 0.45rem 0.5rem;
2322
background: linear-gradient(90deg, #03036d 0%, #487db5 100%);
2423
}
2524

@@ -44,7 +43,7 @@ $control-size: 20px;
4443
.controls {
4544
display: flex;
4645
flex-shrink: 0;
47-
gap: 2px;
46+
gap: 0.65rem;
4847
}
4948

5049
.windowControl {
@@ -144,16 +143,14 @@ $control-size: 20px;
144143
gap: 0.35rem;
145144
}
146145

147-
.childPanel {
148-
border: 2.52px solid $child-border;
149-
background: transparent;
150-
overflow: hidden;
146+
.toolbar {
147+
padding: 0 0.25rem;
151148
}
152149

153-
.childContent {
150+
.content {
154151
padding: 0.25rem 0.5rem;
155152
}
156153

157-
.secondChild {
154+
.footer {
158155
padding: 0 0.25rem;
159156
}

apps/site/src/components/RetroWindow/RetroWindow.tsx

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,28 @@ import React, { PropsWithChildren } from "react";
44
import styles from "./RetroWindow.module.scss";
55

66
/**
7-
* Retro window shell: title bar, optional menu bar, main body, optional footer row.
7+
* Retro window shell: title bar, optional menu bar, optional toolbar,
8+
* main body, and optional footer row.
89
*
910
* `children` (from `PropsWithChildren`) is the main body content.
1011
*/
1112
export interface RetroWindowProps extends PropsWithChildren {
1213
/** When true, shows the “File Edit Insert” menu bar (visual only). */
13-
isEdit?: boolean;
14+
showEditBar?: boolean;
1415
/** Text shown in the blue gradient title bar. */
1516
title: string;
16-
/**
17-
* When true, wraps the main `children` in the bordered panel; the child sets its
18-
* own background (e.g. white). When false, children sit on the default gray (#E2E2E0).
19-
*/
20-
useChildBackground?: boolean;
21-
/**
22-
* Optional row below the main child (e.g. toolbar), on the window gray unless
23-
* `useChild2Background` is true.
24-
*/
25-
secondChild?: React.ReactNode;
26-
/**
27-
* When true with `secondChild`, applies the same bordered panel treatment as
28-
* `useChildBackground` for the second row (rare; e.g. home background picker).
29-
*/
30-
useChild2Background?: boolean;
17+
/** Optional row above the main content, e.g. tabs, filters, or tools. */
18+
toolbar?: React.ReactNode;
19+
/** Optional row below the main content, e.g. status text or actions. */
20+
footer?: React.ReactNode;
3121
}
3222

3323
const RetroWindow = ({
3424
title,
3525
children,
36-
isEdit = false,
37-
useChildBackground = false,
38-
secondChild,
39-
useChild2Background = false,
26+
showEditBar = false,
27+
toolbar,
28+
footer,
4029
}: RetroWindowProps) => {
4130
return (
4231
<div className={styles.root}>
@@ -67,8 +56,8 @@ const RetroWindow = ({
6756
</div>
6857
</div>
6958

70-
<div className={clsx(styles.body, isEdit && styles.bodyWithMenu)}>
71-
{isEdit && (
59+
<div className={clsx(styles.body, showEditBar && styles.bodyWithMenu)}>
60+
{showEditBar && (
7261
<nav className={styles.editMenu} aria-hidden>
7362
<span>
7463
<span className={styles.menuKey}>F</span>ile
@@ -81,22 +70,15 @@ const RetroWindow = ({
8170
</span>
8271
</nav>
8372
)}
84-
<div
85-
className={clsx(
86-
useChildBackground ? styles.childPanel : styles.childContent,
87-
)}
88-
>
89-
{children}
90-
</div>
9173

92-
{secondChild != null && (
93-
<div
94-
className={clsx(
95-
useChild2Background ? styles.childPanel : styles.secondChild,
96-
)}
97-
>
98-
{secondChild}
99-
</div>
74+
{toolbar != null && (
75+
<div className={styles.toolbar}>{toolbar}</div>
76+
)}
77+
78+
<div className={styles.content}>{children}</div>
79+
80+
{footer != null && (
81+
<div className={styles.footer}>{footer}</div>
10082
)}
10183
</div>
10284
</div>

0 commit comments

Comments
 (0)