Skip to content
Extraits de code Groupes Projets
Valider aef30a38 rédigé par mohamedlemine.telmoudy's avatar mohamedlemine.telmoudy
Parcourir les fichiers

Add default render inputs

parent 7f06545c
1 requête de fusion!26"feature/HIR-10" : Gestion des Evénement | Interfaces
Pipeline #4173 réussi avec l'étape
in 4 minutes et 24 secondes
...@@ -66,7 +66,7 @@ export function CreateCampaign({ onClose, onCreate }: CreateCampaignProps) { ...@@ -66,7 +66,7 @@ export function CreateCampaign({ onClose, onCreate }: CreateCampaignProps) {
<TextField <TextField
label="Nom" label="Nom"
variant="outlined" variant="outlined"
value={name} value={name || `Titre du Campagne !!`}
onChange={(e) => setName(e.target.value)} onChange={(e) => setName(e.target.value)}
/> />
{errors.name && <FormHelperText>Ce champ est requis</FormHelperText>} {errors.name && <FormHelperText>Ce champ est requis</FormHelperText>}
...@@ -78,7 +78,7 @@ export function CreateCampaign({ onClose, onCreate }: CreateCampaignProps) { ...@@ -78,7 +78,7 @@ export function CreateCampaign({ onClose, onCreate }: CreateCampaignProps) {
type="date" type="date"
InputLabelProps={{ shrink: true }} InputLabelProps={{ shrink: true }}
variant="outlined" variant="outlined"
value={startDate} value={startDate }
onChange={(e) => setStartDate(e.target.value)} onChange={(e) => setStartDate(e.target.value)}
/> />
{errors.startDate && <FormHelperText>Ce champ est requis</FormHelperText>} {errors.startDate && <FormHelperText>Ce champ est requis</FormHelperText>}
...@@ -90,21 +90,13 @@ export function CreateCampaign({ onClose, onCreate }: CreateCampaignProps) { ...@@ -90,21 +90,13 @@ export function CreateCampaign({ onClose, onCreate }: CreateCampaignProps) {
type="date" type="date"
InputLabelProps={{ shrink: true }} InputLabelProps={{ shrink: true }}
variant="outlined" variant="outlined"
value={endDate} value={endDate }
onChange={(e) => setEndDate(e.target.value)} onChange={(e) => setEndDate(e.target.value)}
/> />
{errors.endDate && <FormHelperText>Ce champ est requis</FormHelperText>} {errors.endDate && <FormHelperText>Ce champ est requis</FormHelperText>}
</FormControl> </FormControl>
<FormControl error={errors.coverImage} fullWidth>
<TextField
label="Image de couverture"
variant="outlined"
value={coverImage}
onChange={(e) => setCoverImage(e.target.value)}
/>
{errors.coverImage && <FormHelperText>Ce champ est requis</FormHelperText>}
</FormControl>
<FormControl error={errors.shortDescription} fullWidth> <FormControl error={errors.shortDescription} fullWidth>
<TextField <TextField
...@@ -112,7 +104,7 @@ export function CreateCampaign({ onClose, onCreate }: CreateCampaignProps) { ...@@ -112,7 +104,7 @@ export function CreateCampaign({ onClose, onCreate }: CreateCampaignProps) {
variant="outlined" variant="outlined"
multiline multiline
rows={3} rows={3}
value={shortDescription} value={shortDescription || `Description..`}
onChange={(e) => setShortDescription(e.target.value)} onChange={(e) => setShortDescription(e.target.value)}
/> />
{errors.shortDescription && <FormHelperText>Ce champ est requis</FormHelperText>} {errors.shortDescription && <FormHelperText>Ce champ est requis</FormHelperText>}
...@@ -122,7 +114,7 @@ export function CreateCampaign({ onClose, onCreate }: CreateCampaignProps) { ...@@ -122,7 +114,7 @@ export function CreateCampaign({ onClose, onCreate }: CreateCampaignProps) {
<TextField <TextField
label="Durée" label="Durée"
variant="outlined" variant="outlined"
value={duration} value={duration || `Durée en jours..`}
onChange={(e) => setDuration(e.target.value)} onChange={(e) => setDuration(e.target.value)}
/> />
{errors.duration && <FormHelperText>Ce champ est requis</FormHelperText>} {errors.duration && <FormHelperText>Ce champ est requis</FormHelperText>}
...@@ -132,7 +124,7 @@ export function CreateCampaign({ onClose, onCreate }: CreateCampaignProps) { ...@@ -132,7 +124,7 @@ export function CreateCampaign({ onClose, onCreate }: CreateCampaignProps) {
<TextField <TextField
label="Activités" label="Activités"
variant="outlined" variant="outlined"
value={activities} value={activities || `Activités.. !!`}
onChange={(e) => setActivities(e.target.value)} onChange={(e) => setActivities(e.target.value)}
/> />
{errors.activities && <FormHelperText>Ce champ est requis</FormHelperText>} {errors.activities && <FormHelperText>Ce champ est requis</FormHelperText>}
......
...@@ -67,8 +67,8 @@ export function CreateHackathon({ onClose, onCreate }: CreateHackathonProps) { ...@@ -67,8 +67,8 @@ export function CreateHackathon({ onClose, onCreate }: CreateHackathonProps) {
<TextField <TextField
label="Nom" label="Nom"
variant="outlined" variant="outlined"
value={name} value={name || `Titre du Hackathon !!`}
onChange={(e) => setName(e.target.value)} onChange={(e) => setName(e.target.value)}
/> />
{errors.name && <FormHelperText>Ce champ est requis</FormHelperText>} {errors.name && <FormHelperText>Ce champ est requis</FormHelperText>}
</FormControl> </FormControl>
...@@ -79,7 +79,7 @@ export function CreateHackathon({ onClose, onCreate }: CreateHackathonProps) { ...@@ -79,7 +79,7 @@ export function CreateHackathon({ onClose, onCreate }: CreateHackathonProps) {
type="date" type="date"
InputLabelProps={{ shrink: true }} InputLabelProps={{ shrink: true }}
variant="outlined" variant="outlined"
value={startDate} value={startDate }
onChange={(e) => setStartDate(e.target.value)} onChange={(e) => setStartDate(e.target.value)}
/> />
{errors.startDate && <FormHelperText>Ce champ est requis</FormHelperText>} {errors.startDate && <FormHelperText>Ce champ est requis</FormHelperText>}
...@@ -91,29 +91,20 @@ export function CreateHackathon({ onClose, onCreate }: CreateHackathonProps) { ...@@ -91,29 +91,20 @@ export function CreateHackathon({ onClose, onCreate }: CreateHackathonProps) {
type="date" type="date"
InputLabelProps={{ shrink: true }} InputLabelProps={{ shrink: true }}
variant="outlined" variant="outlined"
value={endDate} value={endDate }
onChange={(e) => setEndDate(e.target.value)} onChange={(e) => setEndDate(e.target.value)}
/> />
{errors.endDate && <FormHelperText>Ce champ est requis</FormHelperText>} {errors.endDate && <FormHelperText>Ce champ est requis</FormHelperText>}
</FormControl> </FormControl>
<FormControl error={errors.coverImage} fullWidth>
<TextField
label="Image de couverture"
variant="outlined"
value={coverImage}
onChange={(e) => setCoverImage(e.target.value)}
/>
{errors.coverImage && <FormHelperText>Ce champ est requis</FormHelperText>}
</FormControl>
<FormControl error={errors.shortDescription} fullWidth> <FormControl error={errors.shortDescription} fullWidth>
<TextField <TextField
label="Description courte" label="Description courte"
variant="outlined" variant="outlined"
multiline multiline
rows={3} rows={3}
value={shortDescription} value={shortDescription || `Description..`}
onChange={(e) => setShortDescription(e.target.value)} onChange={(e) => setShortDescription(e.target.value)}
/> />
{errors.shortDescription && <FormHelperText>Ce champ est requis</FormHelperText>} {errors.shortDescription && <FormHelperText>Ce champ est requis</FormHelperText>}
...@@ -123,7 +114,7 @@ export function CreateHackathon({ onClose, onCreate }: CreateHackathonProps) { ...@@ -123,7 +114,7 @@ export function CreateHackathon({ onClose, onCreate }: CreateHackathonProps) {
<TextField <TextField
label="Durée" label="Durée"
variant="outlined" variant="outlined"
value={duration} value={duration || `une seule Journée`}
onChange={(e) => setDuration(e.target.value)} onChange={(e) => setDuration(e.target.value)}
/> />
{errors.duration && <FormHelperText>Ce champ est requis</FormHelperText>} {errors.duration && <FormHelperText>Ce champ est requis</FormHelperText>}
...@@ -133,7 +124,7 @@ export function CreateHackathon({ onClose, onCreate }: CreateHackathonProps) { ...@@ -133,7 +124,7 @@ export function CreateHackathon({ onClose, onCreate }: CreateHackathonProps) {
<TextField <TextField
label="Activités" label="Activités"
variant="outlined" variant="outlined"
value={activities} value={activities || `Activités.. !!`}
onChange={(e) => setActivities(e.target.value)} onChange={(e) => setActivities(e.target.value)}
/> />
{errors.activities && <FormHelperText>Ce champ est requis</FormHelperText>} {errors.activities && <FormHelperText>Ce champ est requis</FormHelperText>}
......
0% ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter