Skip to content

Commit

Permalink
make active filter in mobile visible
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStreek committed Jan 12, 2024
1 parent cbf4fa0 commit d7111e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/live-chart/TextInputForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function TextInputForm(): React.ReactElement {
<div className="d-flex w-full">
<div className="flex-grow-1">{`${remainingTextInput} / ${MAX_LENGTH}`}</div>
<div>
<Button type="submit" variant="primary" className="mt-1">
<Button type="submit" variant="secondary" className="mt-1 text-white">
<FormattedMessage
id="live.text.button.submit"
defaultMessage="Add Text"
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/shared/components/AdminOptionToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface AdminOptionToolbarProps {
id: string | undefined
adminId: string | undefined
language?: string | undefined
filterFromServer?: string[] | undefined
filterFromServer?: string[]
setWordFilter?: ((wordFilter: string[]) => void) | undefined
setColorThemeGrey?: () => void
setColorThemeFancy?: () => void
Expand Down Expand Up @@ -79,8 +79,12 @@ export function AdminOptionToolbar({ id, adminId, language, filterFromServer, se
}

const createCategoryFiltersForSmScreens = (): React.ReactNode[] => {
if (filterFromServer === undefined) return [<Dropdown.Item key={'filter-empty'}></Dropdown.Item>]

const normalizedFilterList = filterFromServer !== null && filterFromServer.length > 0 ? filterFromServer : ['all']

return ['all', ...ALL_CATEGORIES].map((categoryName: string, index: number) => {
return (<Dropdown.Item key={`filter-sm-category-id-${index}`} variant="" onClick={(event) => handleFilterClick(categoryName)}>
return (<Dropdown.Item key={`filter-sm-category-id-${index}`} active={normalizedFilterList.includes(categoryName)} variant="" onClick={(event) => handleFilterClick(categoryName)}>
<FormattedMessage
id={`toolbar.buttons.dropdown.filter.${categoryName}`}
defaultMessage={categoryName}
Expand Down

0 comments on commit d7111e8

Please sign in to comment.