1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-28 15:19:36 +02:00

fix integrations

This commit is contained in:
François Darveau 2021-12-08 17:33:30 -05:00
parent e5154576b4
commit e7cd4d7705
21 changed files with 125 additions and 63 deletions

View file

@ -42,7 +42,7 @@ export const AppCard = (props: Props): JSX.Element => {
<div className={classes.Apps}>
{category.apps.map((app: App) => {
const redirectUrl = urlParser(app.url)[1];
const [displayUrl, redirectUrl] = urlParser(app.url);
let iconEl: JSX.Element = <Fragment></Fragment>;
@ -89,8 +89,11 @@ export const AppCard = (props: Props): JSX.Element => {
rel="noreferrer"
key={`app-${app.id}`}
>
{app.icon && iconEl}
{app.name}
{app.icon && iconEl}
<div className={classes.AppCardDetails}>
<h5>{app.name}</h5>
<span>{displayUrl}</span>
</div>
</a>
);
})}

View file

@ -1,6 +1,8 @@
import { useSelector } from 'react-redux';
import { Link } from 'react-router-dom';
import { Category } from '../../../interfaces';
import { State } from '../../../store/reducers';
import { Message } from '../../UI';
import { AppCard } from '../AppCard/AppCard';
import classes from './AppGrid.module.css';
@ -20,6 +22,10 @@ export const AppGrid = (props: Props): JSX.Element => {
fromHomepage = false,
} = props;
const {
config: { config }
} = useSelector((state: State) => state);
let apps: JSX.Element;
if (categories.length) {
@ -28,7 +34,7 @@ export const AppGrid = (props: Props): JSX.Element => {
} else {
apps = (
<div className={classes.AppGrid}>
{categories.map(
{categories.filter((category : Category) => !config.hideEmptyCategories || category.apps.length > 0).map(
(category: Category): JSX.Element => (
<AppCard
category={category}

View file

@ -30,16 +30,9 @@ export const Apps = (props: Props): JSX.Element => {
// Get Redux action creators
const dispatch = useDispatch();
const { getCategories, setEditCategory, setEditApp } =
const { setEditCategory, setEditApp } =
bindActionCreators(actionCreators, dispatch);
// Load categories if array is empty
useEffect(() => {
if (!categories.length) {
getCategories();
}
}, []);
// Form
const [modalIsOpen, setModalIsOpen] = useState(false);
const [formContentType, setFormContentType] = useState(ContentType.category);