add configure button to source card

This commit is contained in:
Aria Moradi
2021-07-31 05:06:46 +04:30
parent f2bd5b8149
commit 75f635a28b
2 changed files with 3 additions and 1 deletions
@@ -48,7 +48,7 @@ interface IProps {
export default function SourceCard(props: IProps) { export default function SourceCard(props: IProps) {
const { const {
source: { source: {
id, name, lang, iconUrl, supportsLatest, id, name, lang, iconUrl, supportsLatest, isConfigurable,
}, },
} = props; } = props;
@@ -76,6 +76,7 @@ export default function SourceCard(props: IProps) {
</div> </div>
</div> </div>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{isConfigurable && <Button variant="outlined" style={{ marginLeft: 20 }} onClick={() => { window.location.href = `/sources/${id}/latest/`; }}>Configure</Button>}
<Button variant="outlined" style={{ marginLeft: 20 }} onClick={() => { window.location.href = `/sources/${id}/search/`; }}>Search</Button> <Button variant="outlined" style={{ marginLeft: 20 }} onClick={() => { window.location.href = `/sources/${id}/search/`; }}>Search</Button>
{supportsLatest && <Button variant="outlined" style={{ marginLeft: 20 }} onClick={() => { window.location.href = `/sources/${id}/latest/`; }}>Latest</Button>} {supportsLatest && <Button variant="outlined" style={{ marginLeft: 20 }} onClick={() => { window.location.href = `/sources/${id}/latest/`; }}>Latest</Button>}
<Button variant="outlined" style={{ marginLeft: 20 }} onClick={() => { window.location.href = `/sources/${id}/popular/`; }}>Browse</Button> <Button variant="outlined" style={{ marginLeft: 20 }} onClick={() => { window.location.href = `/sources/${id}/popular/`; }}>Browse</Button>
+1
View File
@@ -26,6 +26,7 @@ interface ISource {
iconUrl: string iconUrl: string
supportsLatest: boolean supportsLatest: boolean
history: any history: any
isConfigurable: boolean
} }
interface IMangaCard { interface IMangaCard {