Skip to content

Commit 5752824

Browse files
author
ArchKing
committed
feat: added gallery window
1 parent 10cfc81 commit 5752824

File tree

3 files changed

+67
-1
lines changed

3 files changed

+67
-1
lines changed

src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
Text,
1111
Image,
1212
Contact,
13+
Photos,
1314
} from '#windows';
1415

1516
gsap.registerPlugin(Draggable);
@@ -29,6 +30,7 @@ const App = () => {
2930
<Image />
3031
<Contact />
3132

33+
<Photos />
3234
<Home />
3335
</main>
3436
);

src/windows/Photos.tsx

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import { Mail, Search } from 'lucide-react';
2+
3+
import { WindowControls } from '#components';
4+
import WindowWrapper from '#hoc/WindowWrapper';
5+
import useWindowStore from '#store/window';
6+
import { GALLERY, PHOTOS_LINKS } from '#constants';
7+
8+
const Photos = () => {
9+
const { openWindow } = useWindowStore();
10+
11+
return (
12+
<>
13+
<div id="window-header">
14+
<WindowControls target="photos" />
15+
16+
<div className="w-full flex justify-end items-center gap-3 text-gray-500">
17+
<Mail className="icon" />
18+
<Search className="icon" />
19+
</div>
20+
</div>
21+
22+
<div className="flex w-full">
23+
<div className="sidebar">
24+
<h2>Photos</h2>
25+
26+
<ul>
27+
{PHOTOS_LINKS.map(({ id, icon, title }) => (
28+
<li key={id}>
29+
<img src={icon} alt={title} />
30+
<p>{title}</p>
31+
</li>
32+
))}
33+
</ul>
34+
</div>
35+
36+
<div className="gallery">
37+
<ul>
38+
{GALLERY.map(({ id, img }) => (
39+
<li
40+
key={id}
41+
onClick={() =>
42+
openWindow('imgfile', {
43+
id,
44+
name: 'Gallery image',
45+
icon: '/images/image.png',
46+
kind: 'file',
47+
fileType: 'img',
48+
imageUrl: img,
49+
})
50+
}
51+
>
52+
<img src={img} alt={`Gallery image ${id}`} />
53+
</li>
54+
))}
55+
</ul>
56+
</div>
57+
</div>
58+
</>
59+
);
60+
};
61+
62+
const PhotosWindow = WindowWrapper(Photos, 'photos');
63+
export default PhotosWindow;

src/windows/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ import Finder from '#windows/Finder';
55
import Text from '#windows/Text';
66
import Image from './Image';
77
import Contact from './Contact';
8+
import Photos from './Photos';
89

9-
export { Terminal, Safari, Resume, Finder, Text, Image, Contact };
10+
export { Terminal, Safari, Resume, Finder, Text, Image, Contact, Photos };

0 commit comments

Comments
 (0)