Skip to content

Commit

Permalink
feat: adding readme link to details of template and plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Sonis <[email protected]>
  • Loading branch information
tonysnowboardunderthebridge committed Jan 8, 2024
1 parent dbd56b7 commit 9d03e2b
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 14 deletions.
12 changes: 9 additions & 3 deletions src/renderer/src/components/plugins/Plugin.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Button, ModalDirectional } from '@platformatic/ui-components'
import { useState } from 'react'
import PluginDetail from './PluginDetail'

function Plugin ({ name, onClickCardPlugin, isSelected, description, tags, author }) {
function Plugin ({ name, onClickCardPlugin, isSelected, description, tags, author, homepage }) {
const [showModalDetail, setShowModalDetail] = useState(false)
let className = `${commonStyles.smallFlexBlock} ${styles.container} `
className += isSelected ? styles.selected : styles.unSelected
Expand Down Expand Up @@ -58,6 +58,7 @@ function Plugin ({ name, onClickCardPlugin, isSelected, description, tags, autho
description={description}
tags={tags}
author={author}
homepage={homepage}
onClickSelectPlugin={() => handleClickSelectPluginDetail()}
/>
</ModalDirectional>
Expand Down Expand Up @@ -86,7 +87,11 @@ Plugin.propTypes = {
/**
* author
*/
author: PropTypes.string
author: PropTypes.string,
/**
* homepage
*/
homepage: PropTypes.string

}

Expand All @@ -95,7 +100,8 @@ Plugin.defaultProps = {
isSelected: false,
description: '',
tags: [],
author: ''
author: '',
homepage: ''
}

export default Plugin
21 changes: 18 additions & 3 deletions src/renderer/src/components/plugins/PluginDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import typographyStyles from '~/styles/Typography.module.css'
import commonStyles from '~/styles/CommonStyles.module.css'
import styles from './PluginDetail.module.css'
import Title from '~/components/ui/Title'
import { Button, HorizontalSeparator, Icons, Tag } from '@platformatic/ui-components'
import { MARGIN_0, OPACITY_30, RICH_BLACK, SMALL, WHITE } from '@platformatic/ui-components/src/components/constants'
import { Button, HorizontalSeparator, Icons, Tag, VerticalSeparator } from '@platformatic/ui-components'
import { MARGIN_0, OPACITY_30, RICH_BLACK, SMALL, TERTIARY_BLUE, WHITE } from '@platformatic/ui-components/src/components/constants'

function PluginDetail ({ name, description, tags, author, onClickSelectPlugin }) {
function PluginDetail ({ name, description, tags, author, homepage, onClickSelectPlugin }) {
return (
<div className={styles.container}>
<div className={`${commonStyles.largeFlexBlock} ${commonStyles.fullWidth}`}>
Expand All @@ -24,6 +24,16 @@ function PluginDetail ({ name, description, tags, author, onClickSelectPlugin })
<Icons.UserComputerIcon color={WHITE} size={SMALL} />
<span className={`${typographyStyles.desktopBodyLarge} ${typographyStyles.textWhite} ${typographyStyles.opacity70}`}>{author}</span>
</div>

{homepage && (
<>
<VerticalSeparator color={WHITE} backgroundColorOpacity={OPACITY_30} />
<a className={`${commonStyles.smallFlexRow} ${commonStyles.itemsCenter} ${styles.link}`} href={homepage} target='_blank' rel='noreferrer'>
<span className={`${typographyStyles.desktopBodyLarge} ${typographyStyles.textTertiaryBlue}`}>README File</span>
<Icons.ExpandIcon color={TERTIARY_BLUE} size={SMALL} />
</a>
</>
)}
</div>
</div>

Expand Down Expand Up @@ -78,6 +88,10 @@ PluginDetail.propTypes = {
* author
*/
author: PropTypes.string,
/**
* homepage
*/
homepage: PropTypes.string,
/**
* onClickSelectPlugin
*/
Expand All @@ -88,6 +102,7 @@ PluginDetail.defaultProps = {
description: '',
tags: [],
author: '',
homepage: '',
onClickSelectPlugin: () => {}
}

Expand Down
3 changes: 3 additions & 0 deletions src/renderer/src/components/plugins/PluginDetail.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.container {
@apply flex flex-col justify-between h-full w-full
}
.link {
@apply no-underline
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@apply lg:min-h-[29.9rem] lg:max-h-[29.5rem] h-full w-full relative
}
.select {
@apply basis-1/3
@apply basis-1/3
}
.selectUl {
@apply min-w-[150%]
Expand Down
13 changes: 10 additions & 3 deletions src/renderer/src/components/templates/Template.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ import { Button, Logo, ModalDirectional } from '@platformatic/ui-components'
function Template ({
platformaticService,
name,
onClickCardTemplate,
isSelected,
description,
tags,
author
author,
homepage,
onClickCardTemplate
}) {
const [showModalDetail, setShowModalDetail] = useState(false)
let className = `${commonStyles.smallFlexBlock} ${styles.container} `
Expand Down Expand Up @@ -65,6 +66,7 @@ function Template ({
description={description}
tags={tags}
author={author}
homepage={homepage}
onClickSelectTemplate={() => handleClickSelectTemplateDetail()}
/>
</ModalDirectional>
Expand Down Expand Up @@ -102,7 +104,11 @@ Template.propTypes = {
/**
* author
*/
author: PropTypes.string
author: PropTypes.string,
/**
* homepage
*/
homepage: PropTypes.string
}

Template.defaultProps = {
Expand All @@ -112,6 +118,7 @@ Template.defaultProps = {
onClickCardTemplate: () => {},
description: '',
author: '',
homepage: '',
tags: []
}

Expand Down
23 changes: 19 additions & 4 deletions src/renderer/src/components/templates/TemplateDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import typographyStyles from '~/styles/Typography.module.css'
import commonStyles from '~/styles/CommonStyles.module.css'
import styles from './TemplateDetail.module.css'
import Title from '~/components/ui/Title'
import { Button, HorizontalSeparator, Icons, Tag } from '@platformatic/ui-components'
import { MARGIN_0, OPACITY_30, RICH_BLACK, SMALL, WHITE } from '@platformatic/ui-components/src/components/constants'
import { Button, HorizontalSeparator, Icons, Tag, VerticalSeparator } from '@platformatic/ui-components'
import { MARGIN_0, OPACITY_30, RICH_BLACK, SMALL, TERTIARY_BLUE, WHITE } from '@platformatic/ui-components/src/components/constants'

function TemplateDetail ({ name, description, tags, author, onClickSelectTemplate }) {
function TemplateDetail ({ name, description, tags, author, homepage, onClickSelectTemplate }) {
return (
<div className={styles.container}>
<div className={`${commonStyles.largeFlexBlock} ${commonStyles.fullWidth}`}>
Expand All @@ -24,6 +24,16 @@ function TemplateDetail ({ name, description, tags, author, onClickSelectTemplat
<Icons.UserComputerIcon color={WHITE} size={SMALL} />
<span className={`${typographyStyles.desktopBodyLarge} ${typographyStyles.textWhite} ${typographyStyles.opacity70}`}>{author}</span>
</div>

{homepage && (
<>
<VerticalSeparator color={WHITE} backgroundColorOpacity={OPACITY_30} />
<a className={`${commonStyles.smallFlexRow} ${commonStyles.itemsCenter} ${styles.link}`} href={homepage} target='_blank' rel='noreferrer'>
<span className={`${typographyStyles.desktopBodyLarge} ${typographyStyles.textTertiaryBlue}`}>README File</span>
<Icons.ExpandIcon color={TERTIARY_BLUE} size={SMALL} />
</a>
</>
)}
</div>
</div>

Expand Down Expand Up @@ -80,13 +90,18 @@ TemplateDetail.propTypes = {
/**
* onClickSelectTemplate
*/
onClickSelectTemplate: PropTypes.func
onClickSelectTemplate: PropTypes.func,
/**
* homepage
*/
homepage: PropTypes.string
}

TemplateDetail.defaultProps = {
description: '',
tags: [],
author: '',
homepage: '',
onClickSelectTemplate: () => {}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.container {
@apply flex flex-col justify-between h-full w-full
}
.link {
@apply no-underline
}
3 changes: 3 additions & 0 deletions src/renderer/src/styles/Typography.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
.textErrorRed {
@apply text-error-red;
}
.textTertiaryBlue {
@apply text-tertiary-blue;
}
.textCenter {
@apply text-center;
}
Expand Down

0 comments on commit 9d03e2b

Please sign in to comment.