mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-26 01:46:18 -05:00
Creating TagPlaceholder to be used while Tags are loading.
This commit is contained in:
parent
619a88c429
commit
6713b9e4c9
2 changed files with 17 additions and 1 deletions
|
|
@ -5,6 +5,8 @@ import {
|
|||
Divider,
|
||||
Form,
|
||||
Grid,
|
||||
GridColumn,
|
||||
GridRow,
|
||||
Label,
|
||||
LabelGroup,
|
||||
TableBody,
|
||||
|
|
@ -31,6 +33,7 @@ import {HexColorPicker} from "react-colorful";
|
|||
import {useRecurringTimeout} from "./hooks/customHooks";
|
||||
import {Media, ThemeContext} from "./contexts/contexts";
|
||||
import {Link, useNavigate} from "react-router-dom";
|
||||
import {TagPlaceholder} from "./components/Placeholder";
|
||||
|
||||
export const TagsContext = React.createContext({
|
||||
NameToTagLabel: null,
|
||||
|
|
@ -419,7 +422,14 @@ export const TagsSelector = ({
|
|||
export const TagsDashboard = () => {
|
||||
const {tagNames, TagsLinkGroup} = React.useContext(TagsContext);
|
||||
|
||||
let availableTagsGroup = <Loader active inline/>;
|
||||
const tagPlaceholder = <GridColumn style={{width: 100}}><TagPlaceholder/></GridColumn>;
|
||||
let availableTagsGroup = <Grid columns={3}>
|
||||
<GridRow>
|
||||
{tagPlaceholder}
|
||||
{tagPlaceholder}
|
||||
{tagPlaceholder}
|
||||
</GridRow>
|
||||
</Grid>;
|
||||
if (tagNames && tagNames.length >= 1) {
|
||||
availableTagsGroup = <TagsLinkGroup tagNames={tagNames} style={{marginTop: '0.5em'}}/>;
|
||||
} else if (tagNames === undefined) {
|
||||
|
|
|
|||
|
|
@ -47,3 +47,9 @@ export function TextPlaceholder() {
|
|||
<PlaceholderLine/>
|
||||
</Placeholder>
|
||||
}
|
||||
|
||||
export function TagPlaceholder() {
|
||||
return <Placeholder style={{height: 30, width: 80}}>
|
||||
<PlaceholderImage/>
|
||||
</Placeholder>
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue