diff --git a/.env b/.env index 8971d1f..0946db5 100644 --- a/.env +++ b/.env @@ -3,4 +3,6 @@ DATABASE_URL="postgresql://admin:adminpassword@192.168.1.25:5432/afrohub_dev?schema=public" # Exemple avec Supabase ou Neon (si base distante) -# DATABASE_URL="postgresql://postgres:[MOT_DE_PASSE]@db.[ID_PROJET].supabase.co:5432/postgres" \ No newline at end of file +# DATABASE_URL="postgresql://postgres:[MOT_DE_PASSE]@db.[ID_PROJET].supabase.co:5432/postgres" +# Environnement : "development" = accents rouges, "production" = accents normaux +NEXT_PUBLIC_APP_ENV=development \ No newline at end of file diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml deleted file mode 100644 index 294eee5..0000000 --- a/.gitea/workflows/deploy.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Build and Push App -on: - push: - branches: [ "main" ] - -jobs: - build: - runs-on: ubuntu-latest - # FORCE l'image ici pour être sûr d'avoir l'outil Docker - container: - image: catthehacker/ubuntu:act-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Login to Gitea Registry - run: | - echo "${{ secrets.TOKEN }}" | docker login git.home.arrondeau.fr -u ${{ gitea.actor }} --password-stdin - - - name: Build and Push Docker Images - run: | - # Build and Push FRONT - docker build -t git.home.arrondeau.fr/${{ gitea.repository }}:latest . - docker push git.home.arrondeau.fr/${{ gitea.repository }}:latest - - # Build and Push ADMIN - docker build -t git.home.arrondeau.fr/${{ gitea.repository }}-admin:latest ./admin - docker push git.home.arrondeau.fr/${{ gitea.repository }}-admin:latest \ No newline at end of file diff --git a/admin/package.json b/admin/package.json index 3c3fcdb..fe1bb42 100644 --- a/admin/package.json +++ b/admin/package.json @@ -13,6 +13,7 @@ "@prisma/client": "6.19.3", "@prisma/config": "6.19.3", "@types/bcryptjs": "^2.4.6", + "afrohub": "file:..", "bcryptjs": "^3.0.3", "dotenv": "^17.4.1", "lucide-react": "^1.8.0", diff --git a/app/HomeClient.tsx b/app/HomeClient.tsx index a967cbb..6ba4b83 100644 --- a/app/HomeClient.tsx +++ b/app/HomeClient.tsx @@ -19,6 +19,7 @@ const HomeClient = ({ initialFeatured, initialPosts, initialCategories }: Props) const router = useRouter(); const { user, settings } = useUser(); const [searchTerm, setSearchTerm] = useState(''); + const [locationTerm, setLocationTerm] = useState(''); const [featuredBusinesses, setFeaturedBusinesses] = useState(initialFeatured); const [posts, setPosts] = useState(initialPosts); const [categories, setCategories] = useState(initialCategories); @@ -27,7 +28,10 @@ const HomeClient = ({ initialFeatured, initialPosts, initialCategories }: Props) const handleSearch = (e: React.FormEvent) => { e.preventDefault(); - router.push(`/annuaire?q=${searchTerm}`); + const params = new URLSearchParams(); + if (searchTerm) params.append('q', searchTerm); + if (locationTerm) params.append('location', locationTerm); + router.push(`/annuaire?${params.toString()}`); }; return ( @@ -59,7 +63,13 @@ const HomeClient = ({ initialFeatured, initialPosts, initialCategories }: Props)
- + setLocationTerm(e.target.value)} + />
+ ))} + + + {userRating ? "Merci pour votre note !" : "Cliquez sur une étoile pour voter"} + + + )} + + + {!isOwner && ( +
+

Laissez un commentaire

+
+