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

Add app categories (#2)

add app categories
This commit is contained in:
François Darveau 2021-06-26 15:06:47 -04:00 committed by François Darveau
parent 74e3cbc7e2
commit 2530f2d089
5 changed files with 43 additions and 40 deletions

View file

@ -1,5 +1,5 @@
import { App, Category } from '../../../interfaces';
import { iconParser, urlParser } from '../../../utility';
import { iconParser, searchConfig, urlParser } from '../../../utility';
import Icon from '../../UI/Icons/Icon/Icon';
import classes from './AppCard.module.css';
@ -45,7 +45,7 @@ const AppCard = (props: ComponentProps): JSX.Element => {
return (
<a
href={redirectUrl}
target='_blank'
target={searchConfig('appsSameTab', false) ? '' : '_blank'}
rel='noreferrer'
key={`app-${app.id}`}>
<div className={classes.AppCardIcon}>{iconEl}</div>

View file

@ -25,7 +25,7 @@ interface ComponentProps {
export enum ContentType {
category,
app,
app
}
const Apps = (props: ComponentProps): JSX.Element => {
@ -34,26 +34,24 @@ const Apps = (props: ComponentProps): JSX.Element => {
const [modalIsOpen, setModalIsOpen] = useState(false);
const [formContentType, setFormContentType] = useState(ContentType.category);
const [isInEdit, setIsInEdit] = useState(false);
const [tableContentType, setTableContentType] = useState(
ContentType.category
);
const [tableContentType, setTableContentType] = useState(ContentType.category);
const [isInUpdate, setIsInUpdate] = useState(false);
const [categoryInUpdate, setCategoryInUpdate] = useState<Category>({
name: "",
name: '',
id: -1,
isPinned: false,
orderId: 0,
type: "apps",
type: 'apps',
apps: [],
bookmarks: [],
createdAt: new Date(),
updatedAt: new Date(),
});
updatedAt: new Date()
})
const [appInUpdate, setAppInUpdate] = useState<App>({
name: "string",
url: "string",
name: 'string',
url: 'string',
categoryId: -1,
icon: "string",
icon: 'string',
isPinned: false,
orderId: 0,
id: 0,