From b5abf024535324fc1ded2e9ea267526e52865724 Mon Sep 17 00:00:00 2001 From: ashkano Date: Tue, 3 Dec 2024 11:44:47 +0330 Subject: [PATCH 1/3] join and community pages --- Dockerfile | 11 ----- components/Footer.jsx | 1 + data/community.js | 58 +++++++++++++++++++++++++++ i18n/en.js | 6 +++ i18n/fa.js | 7 ++++ pages/community.jsx | 93 +++++++++++++++++++------------------------ pages/join.jsx | 67 +++++++++++++++++++++++++++++++ 7 files changed, 179 insertions(+), 64 deletions(-) delete mode 100644 Dockerfile create mode 100644 data/community.js create mode 100644 pages/join.jsx diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 9713eda..0000000 --- a/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM node:20.10.0 - -WORKDIR /app -COPY . . - -RUN npm install --force -RUN npm run build - -EXPOSE 6080 - -CMD ["npm", "run", "start"] diff --git a/components/Footer.jsx b/components/Footer.jsx index 4a08441..4a1a721 100644 --- a/components/Footer.jsx +++ b/components/Footer.jsx @@ -13,6 +13,7 @@ export function Footer() { {t('navigation.features')} {t('navigation.download')} {t('navigation.community')} + {t('navigation.join')} {t('navigation.blog')} {t('navigation.team')} {t('footer.privacyPolicy')} diff --git a/data/community.js b/data/community.js new file mode 100644 index 0000000..3bed1f7 --- /dev/null +++ b/data/community.js @@ -0,0 +1,58 @@ +const category = { + develop: { + en: 'Develop', + fa: 'توسعه' + }, + communication: { + en: 'Communication', + fa: 'ارتباطات' + }, + multimedia: { + en: 'Multimedia', + fa: 'چندرسانه‌ای' + }, +} + +const communityData = { + categories: Object.values(category), + apps: [ + { + name: { + en: 'Neovim', + fa: 'نئوویم', + }, + desc: { + en: 'Powerful and extendable text editor', + fa: 'ویرایشگر متن قدرتمند و قابل تمدید', + }, + cat: category.develop, + href: '#' + }, + { + name: { + en: 'Discord', + fa: 'دیسکورد', + }, + desc: { + en: 'Voice & text chat application', + fa: 'اپلیکیشن چت صوتی و متنی', + }, + cat: category.communication, + href: '#' + }, + { + name: { + en: 'OBS Studio', + fa: 'OBS استودیو', + }, + desc: { + en: 'Screen recorder and streaming software', + fa: 'نرم‌افزار ضبط صفحه نمایش و پخش زنده', + }, + cat: category.multimedia, + href: '#' + }, + ] +} + +export default communityData; diff --git a/i18n/en.js b/i18n/en.js index 253cb2f..e92b6e6 100644 --- a/i18n/en.js +++ b/i18n/en.js @@ -17,6 +17,7 @@ export default { navigation: { blog: 'Blog', community: 'Community', + join: 'Join', download: 'Download', features: 'Features', team: 'Team', @@ -34,6 +35,11 @@ export default { }, community: { + title: 'Parch Linux Community Software', + search: 'Search apps...' + }, + + join: { title: 'Join Our Community', caption: { forum: 'Forums', diff --git a/i18n/fa.js b/i18n/fa.js index a4cf57e..e7634bf 100644 --- a/i18n/fa.js +++ b/i18n/fa.js @@ -17,6 +17,7 @@ export default { navigation: { blog: 'بلاگ', community: 'جامعه', + join: 'پیوستن', download: 'دانلود', features: 'امکانات', team: 'تیم', @@ -34,6 +35,12 @@ export default { }, community: { + title: 'برنامه‌های جامعه پارچ لینوکس', + search: 'جستجوی برنامه‌ها...' + }, + + + join: { title: 'به جامعهٔ ما بپیوندید', caption: { forum: 'فروم', diff --git a/pages/community.jsx b/pages/community.jsx index ab7a073..c28270b 100644 --- a/pages/community.jsx +++ b/pages/community.jsx @@ -1,65 +1,52 @@ -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" -import { useTranslation } from "@/utils/translation" -import { Users, Book, MessageCircle, Code, ArrowLeftCircle, ArrowRightCircle } from 'lucide-react' -import { Button } from "@/components/ui/button" -import Link from "next/link" -import { SiBluesky, SiDiscord, SiMastodon, SiTelegram, SiX } from "@icons-pack/react-simple-icons"; +import { Button } from "@/components/ui/button"; +import { Card, CardHeader } from "@/components/ui/card"; +import { SiGitlab } from "@icons-pack/react-simple-icons"; +import { useTranslation } from "@/utils/translation"; -const CommunityCard = ({ icon: Icon, caption, link, text, url, arrow: Arrow }) => ( - - -
- - - {caption} - - -
-
- {text} -
-) +import communityData from "@/data/community"; +import { useCallback, useEffect, useState } from "react"; export default function Community() { const { t, lang } = useTranslation(); + const [apps, setApps] = useState(communityData.apps); - const arrow = lang == 'fa' ? ArrowLeftCircle : ArrowRightCircle + const search = q => { + setApps(communityData.apps.filter(app => JSON.stringify(app).toLowerCase().includes(q))) + } return (
-

{t('community.title')}

-
- - - - +

+ {t("community.title")} +

+
+ search(e.target.value.trim().toLowerCase())} /> +
+
+ {apps.map(app => ( + + +
+
+

{app.name[lang]}

+

{app.desc[lang]}

+

{app.cat[lang]}

+
+
+ +
+
+
+
+ ))}
diff --git a/pages/join.jsx b/pages/join.jsx new file mode 100644 index 0000000..4c5d2cb --- /dev/null +++ b/pages/join.jsx @@ -0,0 +1,67 @@ +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { useTranslation } from "@/utils/translation" +import { Users, Book, MessageCircle, Code, ArrowLeftCircle, ArrowRightCircle } from 'lucide-react' +import { Button } from "@/components/ui/button" +import Link from "next/link" +import { SiBluesky, SiDiscord, SiMastodon, SiTelegram, SiX } from "@icons-pack/react-simple-icons"; + +const JoinCard = ({ icon: Icon, caption, link, text, url, arrow: Arrow }) => ( + + +
+ + + {caption} + + +
+
+ {text} +
+) + +export default function Join() { + const { t, lang } = useTranslation(); + + const arrow = lang == 'fa' ? ArrowLeftCircle : ArrowRightCircle + + return ( +
+
+

{t('join.title')}

+
+ + + + +
+
+
+ ) +} From fb1d39ee9bb9ac132c118685fa2d5529d137dc99 Mon Sep 17 00:00:00 2001 From: ashkano Date: Tue, 3 Dec 2024 11:49:03 +0330 Subject: [PATCH 2/3] minor fixes --- components/Navbar.jsx | 8 +++----- pages/community.jsx | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/components/Navbar.jsx b/components/Navbar.jsx index bbce7ba..623854c 100644 --- a/components/Navbar.jsx +++ b/components/Navbar.jsx @@ -9,12 +9,10 @@ export function Navbar() { return (
-
+ Parch Logo - - {t('home.title')} - -
+ {t('home.title')} +
-
+
{apps.map(app => ( From f632a43d5938baf901f158fd33c8641e88ad028d Mon Sep 17 00:00:00 2001 From: ashkano Date: Tue, 3 Dec 2024 12:10:50 +0330 Subject: [PATCH 3/3] animation --- pages/community.jsx | 12 ++++++++---- pages/download/index.jsx | 2 +- pages/features.jsx | 2 +- pages/join.jsx | 2 +- pages/team.jsx | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pages/community.jsx b/pages/community.jsx index 9705840..e0a161f 100644 --- a/pages/community.jsx +++ b/pages/community.jsx @@ -2,16 +2,20 @@ import { Button } from "@/components/ui/button"; import { Card, CardHeader } from "@/components/ui/card"; import { SiGitlab } from "@icons-pack/react-simple-icons"; import { useTranslation } from "@/utils/translation"; +import { useState } from "react"; import communityData from "@/data/community"; -import { useCallback, useEffect, useState } from "react"; export default function Community() { const { t, lang } = useTranslation(); const [apps, setApps] = useState(communityData.apps); const search = q => { - setApps(communityData.apps.filter(app => JSON.stringify(app).toLowerCase().includes(q))) + setApps(communityData.apps.filter(app => ( + app.name[lang].toLowerCase().includes(q) || + app.desc[lang].toLowerCase().includes(q) || + app.cat[lang].toLowerCase().includes(q) + ))) } return ( @@ -22,13 +26,13 @@ export default function Community() {
search(e.target.value.trim().toLowerCase())} />
{apps.map(app => ( - +
diff --git a/pages/download/index.jsx b/pages/download/index.jsx index 5ef3376..0948631 100644 --- a/pages/download/index.jsx +++ b/pages/download/index.jsx @@ -22,7 +22,7 @@ export default function DownloadPage() {
{category.links.map(link => ( - +
{link.text[lang]} diff --git a/pages/features.jsx b/pages/features.jsx index bdff942..fd149b5 100644 --- a/pages/features.jsx +++ b/pages/features.jsx @@ -15,7 +15,7 @@ export default function Features() {
{ features.map(({ title, desc, icon: Icon }) => ( - +

{title[lang]}

diff --git a/pages/join.jsx b/pages/join.jsx index 4c5d2cb..0066341 100644 --- a/pages/join.jsx +++ b/pages/join.jsx @@ -6,7 +6,7 @@ import Link from "next/link" import { SiBluesky, SiDiscord, SiMastodon, SiTelegram, SiX } from "@icons-pack/react-simple-icons"; const JoinCard = ({ icon: Icon, caption, link, text, url, arrow: Arrow }) => ( - +
diff --git a/pages/team.jsx b/pages/team.jsx index be3d216..dd77de8 100644 --- a/pages/team.jsx +++ b/pages/team.jsx @@ -17,7 +17,7 @@ export default function Team() {
{team.map(member => ( - +