mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-28 07:09:36 +02:00
Added auto-refresh for greeting and date. Fixed multiple React warnings
This commit is contained in:
parent
d257fbf9a3
commit
f137498e7e
16 changed files with 121 additions and 59 deletions
|
@ -13,7 +13,12 @@ const AppCard = (props: ComponentProps): JSX.Element => {
|
|||
const [displayUrl, redirectUrl] = urlParser(props.app.url);
|
||||
|
||||
return (
|
||||
<a href={redirectUrl} target='_blank' className={classes.AppCard}>
|
||||
<a
|
||||
href={redirectUrl}
|
||||
target='_blank'
|
||||
rel='noreferrer'
|
||||
className={classes.AppCard}
|
||||
>
|
||||
<div className={classes.AppCardIcon}>
|
||||
<Icon icon={iconParser(props.app.icon)} />
|
||||
</div>
|
||||
|
|
|
@ -98,7 +98,15 @@ const AppForm = (props: ComponentProps): JSX.Element => {
|
|||
value={formData.url}
|
||||
onChange={(e) => inputChangeHandler(e)}
|
||||
/>
|
||||
<span>Only urls without http[s]:// are supported</span>
|
||||
<span>
|
||||
<a
|
||||
href='https://github.com/pawelmalak/flame#supported-URL-formats-for-applications-and-bookmarks'
|
||||
target='_blank'
|
||||
rel='noreferrer'
|
||||
>
|
||||
{' '}Check supported URL formats
|
||||
</a>
|
||||
</span>
|
||||
</InputGroup>
|
||||
<InputGroup>
|
||||
<label htmlFor='icon'>App Icon</label>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Fragment, useEffect, useState } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
// Redux
|
||||
|
@ -30,6 +30,12 @@ interface ComponentProps {
|
|||
}
|
||||
|
||||
const Apps = (props: ComponentProps): JSX.Element => {
|
||||
const {
|
||||
getApps,
|
||||
apps,
|
||||
loading
|
||||
} = props;
|
||||
|
||||
const [modalIsOpen, setModalIsOpen] = useState(false);
|
||||
const [isInEdit, setIsInEdit] = useState(false);
|
||||
const [isInUpdate, setIsInUpdate] = useState(false);
|
||||
|
@ -44,10 +50,10 @@ const Apps = (props: ComponentProps): JSX.Element => {
|
|||
})
|
||||
|
||||
useEffect(() => {
|
||||
if (props.apps.length === 0) {
|
||||
props.getApps();
|
||||
if (apps.length === 0) {
|
||||
getApps();
|
||||
}
|
||||
}, [props.getApps]);
|
||||
}, [getApps, apps]);
|
||||
|
||||
const toggleModal = (): void => {
|
||||
setModalIsOpen(!modalIsOpen);
|
||||
|
@ -93,10 +99,10 @@ const Apps = (props: ComponentProps): JSX.Element => {
|
|||
</div>
|
||||
|
||||
<div className={classes.Apps}>
|
||||
{props.loading
|
||||
{loading
|
||||
? <Spinner />
|
||||
: (!isInEdit
|
||||
? <AppGrid apps={props.apps} />
|
||||
? <AppGrid apps={apps} />
|
||||
: <AppTable updateAppHandler={toggleUpdate} />)
|
||||
}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue