Creating TagPlaceholder to be used while Tags are loading.

This commit is contained in:
Roland 2023-09-07 20:39:35 -06:00
parent 619a88c429
commit 6713b9e4c9
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
2 changed files with 17 additions and 1 deletions

View file

@ -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) {

View file

@ -47,3 +47,9 @@ export function TextPlaceholder() {
<PlaceholderLine/>
</Placeholder>
}
export function TagPlaceholder() {
return <Placeholder style={{height: 30, width: 80}}>
<PlaceholderImage/>
</Placeholder>
}