Skip to content

Commit

Permalink
Merge branch 'dev' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeSlain committed Nov 27, 2024
2 parents ceebb1f + dd2fc5e commit b23080a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/components/Meeting/MeetingQuestionInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export function MeetingQuestionInput({
context={context}
setContext={setContext}
showError={showError}
isNewChat={isNewChat}
/>
)}
<div className="flex justify-between">
Expand Down Expand Up @@ -182,23 +183,27 @@ function NewQuestionMeetingAdditionalInput({
context,
setContext,
showError,
isNewChat,
}: {
context: MeetingInputContext
setContext: React.Dispatch<React.SetStateAction<MeetingInputContext>>
showError: boolean
isNewChat: boolean
}) {
const handleSetTag = (tag, fieldName) => {
setContext((prevContext) => ({
...prevContext,
[fieldName]: [...prevContext[fieldName], tag],
}))
}
console.log(isNewChat, ' tchaaat')

return (
<div className="fr-mt-2w fr-grid-row gap-8">
{inputFields.map((field, index) => (
<div className="fr-col-5 fr-mb-2w" key={index}>
<ThemesAndAdminsInput
isDisabled={!isNewChat}
field={field}
onTagSelect={(tag) => handleSetTag(tag, field.name)}
themes={context.themes}
Expand Down
5 changes: 4 additions & 1 deletion src/components/Meeting/ThemesAndAdminsInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ export function ThemesAndAdminsInput({
themes,
administrations,
showError,
isDisabled,
}: {
field: any
themes: string[] | null
administrations: string[] | null
onTagSelect: (tag, fieldName) => void
showError: boolean
isDisabled: boolean
}) {
const [searchResults, setSearchResults] = useState([])
const [selectedValue, setSelectedValue] = useState('')
Expand Down Expand Up @@ -101,11 +103,12 @@ export function ThemesAndAdminsInput({
field.name === 'themes'
? !themes || themes.length === 0
: !administrations || administrations.length === 0
console.log(isDisabled, ' isNewChat')

return (
<div>
<Input
disabled={messages.length > 0}
disabled={messages.length > 0 || isDisabled}
label={`${field.label} *`}
className="fr-mb-1w"
nativeInputProps={{
Expand Down

0 comments on commit b23080a

Please sign in to comment.