Skip to content

Commit 189a316

Browse files
authored
Merge pull request abue-ammar#6 from abue-ammar/ui-migration
UI migration
2 parents 111f218 + 1001c5d commit 189a316

20 files changed

Lines changed: 1308 additions & 290 deletions

package-lock.json

Lines changed: 684 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"format": "prettier --write ."
1212
},
1313
"dependencies": {
14+
"@radix-ui/react-dropdown-menu": "^2.1.15",
1415
"@radix-ui/react-slot": "^1.2.3",
1516
"class-variance-authority": "^0.7.1",
1617
"clsx": "^2.1.1",

src/App.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
import Footer from "./components/Footer";
2-
import Header from "./components/Header";
3-
import MainContent from "./components/MainContent";
1+
import Footer from "./components/footer";
2+
import Header from "./components/header";
3+
import ImageCompressor from "./components/image-compressor";
4+
import { ThemeProvider } from "./components/theme-provider";
45

56
function App() {
67
return (
7-
<div className="relative flex min-h-screen flex-col">
8-
<Header />
9-
<main className="flex-1">
10-
<MainContent />
11-
</main>
12-
<Footer />
13-
</div>
8+
<ThemeProvider defaultTheme="dark" storageKey="vite-ui-theme">
9+
<div className="relative flex min-h-screen flex-col">
10+
<Header />
11+
<main className="flex-1">
12+
<ImageCompressor />
13+
</main>
14+
<Footer />
15+
</div>
16+
</ThemeProvider>
1417
);
1518
}
1619

src/components/Header.tsx

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/components/ImageInfoCard.tsx

Lines changed: 0 additions & 102 deletions
This file was deleted.

src/components/LoadingSpinner.tsx

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/components/ProgressBar.tsx

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
const Footer = () => {
22
return (
3-
<footer className="container mx-auto flex items-center justify-center px-4 py-2 text-center text-black">
3+
<footer className="bg-background text-foreground container mx-auto flex items-center justify-center px-4 py-2 text-center">
44
<span className="inline-flex gap-x-1">
55
Built with{" "}
66
<span>
77
<svg
88
xmlns="http://www.w3.org/2000/svg"
99
viewBox="0 0 24 24"
1010
fill="currentColor"
11-
className="h-5 w-5"
11+
className="text-primary h-5 w-5"
1212
>
1313
<path d="m11.645 20.91-.007-.003-.022-.012a15.247 15.247 0 0 1-.383-.218 25.18 25.18 0 0 1-4.244-3.17C4.688 15.36 2.25 12.174 2.25 8.25 2.25 5.322 4.714 3 7.688 3A5.5 5.5 0 0 1 12 5.052 5.5 5.5 0 0 1 16.313 3c2.973 0 5.437 2.322 5.437 5.25 0 3.925-2.438 7.111-4.739 9.256a25.175 25.175 0 0 1-4.244 3.17 15.247 15.247 0 0 1-.383.219l-.022.012-.007.004-.003.001a.752.752 0 0 1-.704 0l-.003-.001Z" />
1414
</svg>
@@ -17,7 +17,7 @@ const Footer = () => {
1717
<a
1818
target="_blank"
1919
href="https://github.com/abue-ammar"
20-
className="text-black underline"
20+
className="text-primary hover:text-primary-foreground underline transition-colors"
2121
>
2222
Abue Ammar.
2323
</a>

src/components/header.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { ThemeToggle } from "./mode-toggle";
2+
3+
const Header = () => {
4+
return (
5+
<header className="bg-background text-foreground border-border sticky top-0 z-50 w-full border-b">
6+
<div className="container mx-auto flex h-14 items-center px-4">
7+
<div className="flex w-full items-center justify-between">
8+
<div className="mr-4">
9+
<a className="mr-6 flex items-center space-x-2" href="/">
10+
<svg
11+
xmlns="http://www.w3.org/2000/svg"
12+
className="text-primary size-8"
13+
viewBox="0 0 24 24"
14+
strokeWidth={1.8}
15+
stroke="currentColor"
16+
fill="none"
17+
strokeLinecap="round"
18+
strokeLinejoin="round"
19+
>
20+
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
21+
<path d="M15 8h.01" />
22+
<path d="M11 21h-5a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v5.5" />
23+
<path d="M3 16l5 -5c.928 -.893 2.072 -.893 3 0l2 2" />
24+
<path d="M17.8 20.817l-2.172 1.138a.392 .392 0 0 1 -.568 -.41l.415 -2.411l-1.757 -1.707a.389 .389 0 0 1 .217 -.665l2.428 -.352l1.086 -2.193a.392 .392 0 0 1 .702 0l1.086 2.193l2.428 .352a.39 .39 0 0 1 .217 .665l-1.757 1.707l.414 2.41a.39 .39 0 0 1 -.567 .411l-2.172 -1.138z" />
25+
</svg>
26+
<span className="text-foreground text-lg font-semibold sm:inline-block">
27+
Image Compressor
28+
</span>
29+
</a>
30+
</div>
31+
<ThemeToggle />
32+
</div>
33+
</div>
34+
</header>
35+
);
36+
};
37+
38+
export default Header;

0 commit comments

Comments
 (0)