Skip to content

Commit d6592e7

Browse files
Disable fullscreen button until file is uploaded + styling fixes
1 parent f53d0cf commit d6592e7

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/app/page.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ export default function Home() {
114114

115115
return (
116116
<div ref={fullscreenRef} className={`flex flex-col ${darkMode == true ? "dark bg-background" : "bg-foreground/10"}`}>
117-
<nav className={`flex z-50 flex-row justify-between items-center px-5 py-3 ${isFullscreen ? "absolute top-1 left-1 w-full rounded-lg bg-foreground/40 md:w-1/4" : "bg-foreground"}`}>
117+
<nav className={`flex z-50 flex-row justify-between items-center px-5 py-3 ${isFullscreen ? "absolute top-1 left-1 w-full rounded-lg bg-foreground/40 lg:w-1/3 xl:w-1/4" : "bg-foreground"}`}>
118118
<div className="flex relative justify-center items-center">
119-
<div onClick={() => setAboutMenuOpen(!aboutMenuOpen)} className="inline-flex space-x-2 group hover:cursor-pointer">
119+
<div onClick={() => setAboutMenuOpen(!aboutMenuOpen)} className="inline-flex items-center space-x-2 group hover:cursor-pointer">
120120
<Image
121-
className={`${isFullscreen ? "opacity-70" : ""}`}
121+
className={`h-min ${isFullscreen ? "opacity-70" : ""}`}
122122
src="/logo-icon.png"
123123
alt="Logo"
124124
width={22}
@@ -148,7 +148,7 @@ export default function Home() {
148148
<IconButton onClick={handleSetToggleDarkMode}>
149149
{darkMode ? <SunIcon className="w-5 h-5"></SunIcon> : <MoonIcon className="w-5 h-5"></MoonIcon>}
150150
</IconButton>
151-
<IconButton onClick={toggleFullscreen}>
151+
<IconButton disabled={fileIsValid !== true} onClick={toggleFullscreen}>
152152
{isFullscreen ? <ExitFullScreenIcon className="w-5 h-5"></ExitFullScreenIcon> : <EnterFullScreenIcon className="w-5 h-5"></EnterFullScreenIcon>}
153153
</IconButton>
154154
</div>

src/components/IconButton.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

2-
export default function IconButton({ children, onClick }) {
2+
export default function IconButton({ children, disabled, onClick }) {
33
return (
4-
<button onClick={onClick} className="p-0.5 transition-colors duration-300 ease-in-out text-gray hover:text-white">
4+
<button onClick={onClick} disabled={disabled} className={`p-0.5 transition-colors duration-300 ease-in-out ${disabled ? "text-gray/50" : "text-gray hover:text-white"}`}>
55
{children}
66
</button>
77
);

0 commit comments

Comments
 (0)