Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifications Page de contribution #3

Closed
wants to merge 13 commits into from
Closed

Modifications Page de contribution #3

wants to merge 13 commits into from

Conversation

dmd99
Copy link

@dmd99 dmd99 commented Aug 16, 2023

1. Config:

nous avous modifié config/pages.tsx pour y ajouter un objet contribute qui va sotcker les variables title et subtitle de
notre page contribute


2. constants:

Nous avons créer et typé plusieurs variables dans lib/constants.ts , leurs types sonts enregistrés dans le nouveau fichier types/donations.ts . Ces variables nous seront utiles tout au long de la construction de notre travail et leur déclaraation centralisé nous facilitera la tache an cas de modifications


3. Core modifs:

un seul fichier core a été modifier: components/Navbar/NavigationDrawer/DonationCard.tsx afin de rendre fonctionnel le button avec next-link


4. Nous avons creer le sous-répertoire suivant dans le répertoire app

📦contribute
 ┣ 📂components
 ┃ ┣ 📂contribution
 ┃ ┃ ┣ 📜DonationFrequency.tsx
 ┃ ┃ ┣ 📜DonationTile.tsx
 ┃ ┃ ┣ 📜DonationType.tsx
 ┃ ┃ ┗ 📜PaymentOptions.tsx
 ┃ ┣ 📂contributor _(vide pour le moment)_
 ┃ ┗ 📂core
 ┃ ┃ ┣ 📜QuestionCard.tsx
 ┃ ┃ ┗ 📜TitleTile.tsx
 ┗ 📜page.tsx

Dans le tout il n'y a que des composantsn front de bases qui ne perturberons pas le fonstionnement de l'application

@Linzo99 Linzo99 marked this pull request as ready for review August 16, 2023 20:55
Copy link
Member

@Linzo99 Linzo99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Utiliser les composants shadcn/ui

S'assurer d'utiliser les composants shadcn/ui dès possible afin d'éviter de récréer la roue.

Lint, Format et Typecheck

S'assurer que le code est bien formatter.
Avant chaque PR executer ces commandes

npm run lint:fix
npm run format:write
npm run typecheck

NB: Bien gérer la responsivité

Pour le nom de la page donation fera l'affaire

handleDonationType: (value: string) => void
}

const DonationTypes = ({handleDonationType}:TypeProps) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Serait préférable d'utiliser des Tabs, tu peux voir sur shadcn/ui

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si on a deux tabs on aura quasi le même contenu dans les deux tabs, raison pour laquelle j'ai évité les tabs de la library shadcn-ui

console.log(frequency);

return (
<form>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pour le formulaire, utiliser les Form shadcn/ui

app/contribute/components/contribution/PaymentOptions.tsx Outdated Show resolved Hide resolved
subtitle: string
}

const TitleTile = ({ title, subtitle }: Props) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu pouvais utiliser le component Card de @/components/ui/card

app/contribute/page.tsx Outdated Show resolved Hide resolved
@dmd99
Copy link
Author

dmd99 commented Aug 17, 2023

Vos reviews seront pris en compte pour le prochain PR. Merci

@vercel
Copy link

vercel bot commented Aug 21, 2023

@dmd99 is attempting to deploy a commit to the codif Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@Linzo99 Linzo99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Du très bon travail, j'apprécie beaucoup le temps et l'effort dispensé.

Je t'encourage à visiter ce code pour voir un exemple d'utilisation du component Form. Cela peut aider à améliorer le code:
https://github.com/Tariha/xassida.sn-fontend/blob/feature/audio/app/(admin)/dashboard/audios/components/AudioModalForm/AudioForm.tsx

config/pages.ts Outdated
subtitle: "<strong>Tout don que vous ferez par charité vous sera remplacé par votre Seigneur,\
title: "Donation",
subtitle:
"<strong>Tout don que vous ferez par charité vous sera remplacé par votre Seigneur,\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Un moyen de ne pas utiliser du HTML dans le texte ? C'est préférable

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je vais me pencher sur la question pour voir la soltion qui sera la plus adaptée

@@ -33,3 +35,16 @@ export function copyText(text: string[]) {
return clipboardCopy(toCopy)
}
}

export function extractZodValuesForTypes() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est pas plus facile d'énumérer les Types, vu qu'il y en a juste 2 ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Le type string[] n'est pas assignable au type cible [string, ...string[]]. Par conséquent la source founit ne correspondra pas à l'élement requis à la position [0] de la cible raison pour laquelle j'ai contourné le problème de cette façon.

app/contribute/components/contribution/DonationType.tsx Outdated Show resolved Hide resolved
} from "@/components/ui/dropdown-menu"

interface FrequencyProps {
frequencies: IDonationFrequency[]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Importer les fréquences au lieu de le passer en props. Cela permettrait de rendre le component un peu plus indépendant

@dmd99
Copy link
Author

dmd99 commented Aug 22, 2023

Je suis ravi que mon assistance vous soit utile. Votre retour est très apprécié.

Je prends note de votre suggestion concernant le composant Form et j'irai certainement jeter un coup d'œil pour comprendre comment il est utilisé dans le code. De base je suis en front j'utilise Vuejs/Nuxt, donc contribuer à ce projet me permet de m'ameliorer sur cette technologie avec des exemples concret et des fonctionnalités avancées ainsi c'est à moi de vous remercier. N'hésitez donc surtout pas à me faire part de la moindre remarque.

@Linzo99 Linzo99 closed this Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants