-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #641 from lexicongovernance/develop
v2.5.5
- Loading branch information
Showing
143 changed files
with
1,131 additions
and
4,285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { GetGroupCategoriesResponse } from './types'; | ||
|
||
async function fetchEventGroupCategories( | ||
eventId: string, | ||
): Promise<GetGroupCategoriesResponse | null> { | ||
try { | ||
const response = await fetch( | ||
`${import.meta.env.VITE_SERVER_URL}/api/events/${eventId}/group-categories`, | ||
{ | ||
credentials: 'include', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
}, | ||
); | ||
|
||
if (!response.ok) { | ||
throw new Error(`HTTP Error! Status: ${response.status}`); | ||
} | ||
|
||
const groupCategories = (await response.json()) as { data: GetGroupCategoriesResponse }; | ||
return groupCategories.data; | ||
} catch (error) { | ||
console.error('Error fetching cycles:', error); | ||
return null; | ||
} | ||
} | ||
|
||
export default fetchEventGroupCategories; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 3 additions & 9 deletions
12
packages/berlin/src/components/event-card/EventCard.styled.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { FieldValues, Path, UseFormReturn } from 'react-hook-form'; | ||
import { SelectInput } from './SelectInput'; | ||
import { TextAreaInput } from './TextAreaInput'; | ||
import { TextInput } from './TextInput'; | ||
import { NumberInput } from './NumberInput'; | ||
|
||
export function FormInput<T extends FieldValues>(props: { | ||
form: UseFormReturn<T>; | ||
name: Path<T>; | ||
label: string; | ||
options?: { name: string; value: string }[]; | ||
required: boolean | null; | ||
type: string; | ||
}) { | ||
switch (props.type) { | ||
case 'TEXT': | ||
return ( | ||
<TextInput | ||
form={props.form} | ||
name={props.name} | ||
label={props.label} | ||
required={props.required} | ||
/> | ||
); | ||
case 'TEXTAREA': | ||
return ( | ||
<TextAreaInput | ||
form={props.form} | ||
name={props.name} | ||
label={props.label} | ||
required={props.required} | ||
/> | ||
); | ||
case 'SELECT': | ||
return ( | ||
<SelectInput | ||
form={props.form} | ||
name={props.name} | ||
label={props.label} | ||
required={props.required} | ||
options={props.options ?? []} | ||
/> | ||
); | ||
case 'NUMBER': | ||
return ( | ||
<NumberInput | ||
form={props.form} | ||
name={props.name} | ||
label={props.label} | ||
required={props.required} | ||
/> | ||
); | ||
default: | ||
return <></>; | ||
} | ||
} |
Oops, something went wrong.