generated from EyeSeeTea/dhis2-app-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more UI components, improve Selector, MultipleSelector and RadioB…
…uttons and add debounced to SearchInput
- Loading branch information
Showing
8 changed files
with
130 additions
and
68 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,22 @@ | ||
import { Backdrop, CircularProgress } from "@material-ui/core"; | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
|
||
export const Loader: React.FC = () => ( | ||
<StyledBackdrop open={true}> | ||
<StyledLoaderContainer> | ||
<CircularProgress color="inherit" size={50} /> | ||
</StyledLoaderContainer> | ||
</StyledBackdrop> | ||
); | ||
|
||
const StyledLoaderContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
`; | ||
|
||
const StyledBackdrop = styled(Backdrop)` | ||
color: ${props => props.theme.palette.common.white}; | ||
z-index: 1; | ||
`; |
115 changes: 70 additions & 45 deletions
115
src/webapp/components/radio-buttons-group/RadioButtonsGroup.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
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 |
---|---|---|
@@ -1,12 +1,8 @@ | ||
export type SelectorOption<Value extends string = string> = { | ||
value: Value; | ||
label: string; | ||
disabled?: boolean; | ||
}; | ||
import { Option } from "../../utils/option"; | ||
|
||
export function getLabelFromValue<Value extends string = string>( | ||
value: Value, | ||
options: SelectorOption<Value>[] | ||
options: Option<Value>[] | ||
) { | ||
return options.find(option => option.value === value)?.label; | ||
} |
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,5 @@ | ||
export type Option<Value extends string = string> = { | ||
value: Value; | ||
label: string; | ||
disabled?: boolean; | ||
}; |