diff --git a/webui/src/components/banner.tsx b/webui/src/components/banner.tsx index f6696caf5..a83457f1b 100644 --- a/webui/src/components/banner.tsx +++ b/webui/src/components/banner.tsx @@ -14,46 +14,44 @@ import { Paper, Grid, Button, Collapse } from '@mui/material'; export const Banner: FunctionComponent> = props => { const cardColor = props.theme === 'dark' ? '#fff' : '#000'; const cardBackground = `${props.color}.${props.theme}`; - return <> - - + + - - - {props.children} - - { - props.showDismissButton && - - - - } + + {props.children} - - - ; + { + props.showDismissButton && + + + + } + + + ; }; interface BannerProps { diff --git a/webui/src/pages/admin-dashboard/extension-version-container.tsx b/webui/src/pages/admin-dashboard/extension-version-container.tsx index 8cf307b15..6e1951d26 100644 --- a/webui/src/pages/admin-dashboard/extension-version-container.tsx +++ b/webui/src/pages/admin-dashboard/extension-version-container.tsx @@ -97,94 +97,92 @@ export const ExtensionVersionContainer: FunctionComponent - - - { - icon ? - - - - : '' - } - - - - - {extension.displayName || extension.name} - - - { extension.deprecated && - - - - - -  This extension has been deprecated. - + return + + { + icon ? + + + + : '' + } + + + + + {extension.displayName || extension.name} + + + {extension.deprecated && + + + + + +  This extension has been deprecated. - } - - {extension.namespace}.{extension.name} - - - {extension.description} + } + + {extension.namespace}.{extension.name} + + + {extension.description} - - - - - - { - targetPlatformVersions.map((targetPlatformVersion, index) => { - let label: string; - let indent: number; - if (targetPlatformVersion.version === WILDCARD && targetPlatformVersion.targetPlatform === WILDCARD) { - label = 'All Versions'; - indent = 0; - } else if (targetPlatformVersion.targetPlatform === WILDCARD) { - label = targetPlatformVersion.version; - indent = 4; - } else { - label = getTargetPlatformDisplayName(targetPlatformVersion.targetPlatform); - indent = 8; - } - - const name = `${targetPlatformVersion.targetPlatform}/${targetPlatformVersion.version}`; - return } - label={label} />; - }) - } - - - + + + + + + + { + targetPlatformVersions.map((targetPlatformVersion, index) => { + let label: string; + let indent: number; + if (targetPlatformVersion.version === WILDCARD && targetPlatformVersion.targetPlatform === WILDCARD) { + label = 'All Versions'; + indent = 0; + } else if (targetPlatformVersion.targetPlatform === WILDCARD) { + label = targetPlatformVersion.version; + indent = 4; + } else { + label = getTargetPlatformDisplayName(targetPlatformVersion.targetPlatform); + indent = 8; + } + + const name = `${targetPlatformVersion.targetPlatform}/${targetPlatformVersion.version}`; + return } + label={label} />; + }) + } + + - - - - - targetPlatformVersion.checked)} /> - + + + + + + targetPlatformVersion.checked)} /> - ; + ; }; export interface ExtensionVersionContainerProps { diff --git a/webui/src/pages/admin-dashboard/search-list-container.tsx b/webui/src/pages/admin-dashboard/search-list-container.tsx index 6e31ef131..c7543ec96 100644 --- a/webui/src/pages/admin-dashboard/search-list-container.tsx +++ b/webui/src/pages/admin-dashboard/search-list-container.tsx @@ -13,25 +13,23 @@ import { Grid } from '@mui/material'; import { DelayedLoadIndicator } from '../../components/delayed-load-indicator'; export const SearchListContainer: FunctionComponent = props => { - return (<> - - - {props.searchContainer.map((searchField, key) => { - return - - {searchField} - - ; - })} - - - - - {props.listContainer} - + return + + {props.searchContainer.map((searchField, key) => { + return + + {searchField} + + ; + })} + + + + + {props.listContainer} - ); + ; }; export interface SearchListContainerProps { diff --git a/webui/src/pages/admin-dashboard/welcome.tsx b/webui/src/pages/admin-dashboard/welcome.tsx index d100eefd7..1ab0d42ed 100644 --- a/webui/src/pages/admin-dashboard/welcome.tsx +++ b/webui/src/pages/admin-dashboard/welcome.tsx @@ -15,24 +15,22 @@ import { Link } from 'react-router-dom'; import { AdminDashboardRoutes } from './admin-dashboard'; export const Welcome: FunctionComponent = props => { - return <> - - - - Welcome to the Admin Dashboard! - You can switch pages in the sidepanel menu on the left side. - - Choose between administration for - - - - - - - - + return + + + Welcome to the Admin Dashboard! + You can switch pages in the sidepanel menu on the left side. + + Choose between administration for + + + + + + + - ; + ; }; const StyledLink = styled(Link)(({ theme }: { theme: Theme }) => ({ @@ -44,18 +42,16 @@ const StyledLink = styled(Link)(({ theme }: { theme: Theme }) => ({ })); const WelcomeLinkItem: FunctionComponent<{ route: string, label: string, description: string }> = props => { - return <> - - - - - {props.label} - - - - - {props.description} - + return + + + + {props.label} + + + + + {props.description} - ; + ; }; \ No newline at end of file diff --git a/webui/src/pages/extension-detail/extension-detail-changes.tsx b/webui/src/pages/extension-detail/extension-detail-changes.tsx index 620e2787a..4967f9bc8 100644 --- a/webui/src/pages/extension-detail/extension-detail-changes.tsx +++ b/webui/src/pages/extension-detail/extension-detail-changes.tsx @@ -78,25 +78,23 @@ export const ExtensionDetailChanges: FunctionComponent ; } - return <> - - - - + return + + - ; + ; }; export interface ExtensionDetailChangesProps { diff --git a/webui/src/pages/extension-detail/extension-detail-overview.tsx b/webui/src/pages/extension-detail/extension-detail-overview.tsx index eca5efef6..17b952e04 100644 --- a/webui/src/pages/extension-detail/extension-detail-overview.tsx +++ b/webui/src/pages/extension-detail/extension-detail-overview.tsx @@ -71,17 +71,17 @@ export const ExtensionDetailOverview: FunctionComponentVersion { allVersions.length === 1 ? - {allVersions[0]} - : - props.selectVersion(event.target.value)} - inputProps={{ 'aria-label': 'Version' }} > - { - allVersions.map(version => ) - } - + {allVersions[0]} + : + props.selectVersion(event.target.value)} + inputProps={{ 'aria-label': 'Version' }} > + { + allVersions.map(version => ) + } + } { extension.preRelease ? @@ -90,10 +90,10 @@ export const ExtensionDetailOverview: FunctionComponent - Published - - : null + + Published + + : null } ; }; @@ -150,8 +150,8 @@ export const ExtensionDetailOverview: FunctionComponent { const route = addQuery(ExtensionListRoutes.MAIN, [{ key: kind, value: buttonLabel }]); @@ -163,7 +163,7 @@ export const ExtensionDetailOverview: FunctionComponent; }; - const renderWorksWithList = (downloads: {[targetPlatform: string]: UrlString}): ReactNode => { + const renderWorksWithList = (downloads: { [targetPlatform: string]: UrlString }): ReactNode => { return Object.keys(downloads).map((targetPlatform, index) => { const displayName = getTargetPlatformDisplayName(targetPlatform); return displayName ? {index > 0 ? ', ' : ''}{displayName} : null; @@ -238,60 +238,59 @@ export const ExtensionDetailOverview: FunctionComponent extension.versionAlias.indexOf(version) < 0 && VERSION_ALIASES.indexOf(version) >= 0); // filter internal tags const tags = extension.tags?.filter(t => !t.startsWith('__')); - return <> + return + + + - - - - - - - {renderVersionSection()} - - { - (otherAliases.length || extension.versionAlias.length) ? {renderAliasesSection(otherAliases, tagButton)} : '' - } + + + {renderVersionSection()} - - { - extension.categories && extension.categories.length > 0 ? + { + (otherAliases.length || extension.versionAlias.length) ? {renderAliasesSection(otherAliases, tagButton)} : '' + } + + + { + extension.categories && extension.categories.length > 0 ? {renderButtonList('category', 'Categories', extension.categories, tagButton)} : null - } - { - tags && tags.length > 0 ? + } + { + tags && tags.length > 0 ? {renderButtonList('search', 'Tags', tags, tagButton)} : null - } - - { - extension.downloads ? + } + + { + extension.downloads ? Works With @@ -299,55 +298,54 @@ export const ExtensionDetailOverview: FunctionComponent : null - } - - - Resources - {renderResourceLink('Homepage', resourceLink, extension.homepage)} - {renderResourceLink('Repository', resourceLink, extension.repository)} - {renderResourceLink('Bugs', resourceLink, extension.bugs)} - {renderResourceLink('Q\'n\'A', resourceLink, extension.qna)} - { - extension.downloadable && extension.downloads && Object.keys(extension.downloads).length > 1 ? - + } + + + Resources + {renderResourceLink('Homepage', resourceLink, extension.homepage)} + {renderResourceLink('Repository', resourceLink, extension.repository)} + {renderResourceLink('Bugs', resourceLink, extension.bugs)} + {renderResourceLink('Q\'n\'A', resourceLink, extension.qna)} + { + extension.downloadable && extension.downloads && Object.keys(extension.downloads).length > 1 ? + : extension.downloadable && extension.downloads && Object.keys(extension.downloads).length == 1 ? - - : null - } - { - DownloadTerms && extension.downloadable && extension.downloads && Object.keys(extension.downloads).length > 0 - ? - : null - } - + + : null + } { - extension.bundledExtensions !== undefined && extension.bundledExtensions.length > 0 ? + DownloadTerms && extension.downloadable && extension.downloads && Object.keys(extension.downloads).length > 0 + ? + : null + } + + { + extension.bundledExtensions !== undefined && extension.bundledExtensions.length > 0 ? Bundled Extensions {extension.bundledExtensions!.map(ref => renderExtensionRef(ref))} : null - } - { - extension.dependencies !== undefined && extension.dependencies.length > 0 ? + } + { + extension.dependencies !== undefined && extension.dependencies.length > 0 ? Dependencies {extension.dependencies!.map(ref => renderExtensionRef(ref))} : null - } - - {ClaimNamespace ? : ''} - {ReportAbuse ? : ''} - + } + + {ClaimNamespace ? : ''} + {ReportAbuse ? : ''} - ; + ; }; export interface ExtensionDetailOverviewProps { diff --git a/webui/src/pages/extension-detail/extension-rating-star-setter.tsx b/webui/src/pages/extension-detail/extension-rating-star-setter.tsx index 7da9f20d1..ea95fb484 100644 --- a/webui/src/pages/extension-detail/extension-rating-star-setter.tsx +++ b/webui/src/pages/extension-detail/extension-rating-star-setter.tsx @@ -36,11 +36,7 @@ export const ExtensionRatingStarSetter: FunctionComponent - - {renderStars()} - - ; + return {renderStars()}; }; export interface ExtensionRatingStarSetterProps { diff --git a/webui/src/pages/extension-list/extension-list-header.tsx b/webui/src/pages/extension-list/extension-list-header.tsx index 2c475d41a..670d75305 100644 --- a/webui/src/pages/extension-list/extension-list-header.tsx +++ b/webui/src/pages/extension-list/extension-list-header.tsx @@ -80,121 +80,119 @@ export const ExtensionListHeader: FunctionComponent = }; const SearchHeader = context.pageSettings.elements.searchHeader; - return <> - - - {SearchHeader ? : ''} + return + + {SearchHeader ? : ''} + - - - + + + + + + + {`${props.resultNumber} Result${props.resultNumber !== 1 ? 's' : ''}`} + + + Sort by - - - - {`${props.resultNumber} Result${props.resultNumber !== 1 ? 's' : ''}`} - - - Sort by - - - { - if (e.key === 'Enter') { - e.preventDefault(); - handleSortOrderChange(); + }, + '& .MuiOutlinedInput-notchedOutline': { + border: 0 } }} - onClick={handleSortOrderChange}> - { - sortOrder === 'asc' - ? - : + IconComponent={() => } + value={sortBy} + onChange={handleSortByChange} + > + Relevance + Date + Downloads + Rating + + + { + if (e.key === 'Enter') { + e.preventDefault(); + handleSortOrderChange(); } - + }} + onClick={handleSortOrderChange}> + { + sortOrder === 'asc' + ? + : + } - - ; + + ; }; export interface ExtensionListHeaderProps { diff --git a/webui/src/pages/extension-list/extension-list-item.tsx b/webui/src/pages/extension-list/extension-list-item.tsx index 5382a93f5..5daf8a03f 100644 --- a/webui/src/pages/extension-list/extension-list-item.tsx +++ b/webui/src/pages/extension-list/extension-list-item.tsx @@ -53,55 +53,53 @@ export const ExtensionListItem: FunctionComponent = prop const route = createRoute([ExtensionDetailRoutes.ROOT, extension.namespace, extension.name]); const numberFormat = new Intl.NumberFormat(undefined, { notation: 'compact', compactDisplay: 'short' } as any); const downloadCountFormatted = numberFormat.format(extension.downloadCount || 0); - return <> - - - - *': { - '&:not(:last-child)': { - marginBottom: '.5rem', - } - }, - opacity: extension.deprecated ? 0.5 : undefined, - filter: extension.deprecated ? 'grayscale(100%)' : undefined - }} - > - - - - - - {extension.displayName || extension.name} - - - - - {extension.namespace} - - - {extension.version} - - - - -   - {downloadCountFormatted != "0" && <> {downloadCountFormatted}} - - - - - - ; + return + + + *': { + '&:not(:last-child)': { + marginBottom: '.5rem', + } + }, + opacity: extension.deprecated ? 0.5 : undefined, + filter: extension.deprecated ? 'grayscale(100%)' : undefined + }} + > + + + + + + {extension.displayName || extension.name} + + + + + {extension.namespace} + + + {extension.version} + + + + +   + {downloadCountFormatted != "0" && <> {downloadCountFormatted}} + + + + + ; }; export interface ExtensionListItemProps { diff --git a/webui/src/pages/extension-list/extension-list-searchfield.tsx b/webui/src/pages/extension-list/extension-list-searchfield.tsx index a959d6e01..d80ad2cb6 100644 --- a/webui/src/pages/extension-list/extension-list-searchfield.tsx +++ b/webui/src/pages/extension-list/extension-list-searchfield.tsx @@ -38,56 +38,54 @@ export const ExtensionListSearchfield: FunctionComponent - + { + if (e.key === 'Enter' && props.onSearchSubmit) { + props.onSearchSubmit(props.searchQuery || ''); + } }} - > - { - if (e.key === 'Enter' && props.onSearchSubmit) { - props.onSearchSubmit(props.searchQuery || ''); - } - }} - /> - - { - props.hideIconButton ? '' : - - - - } - - ); + /> + + { + props.hideIconButton ? '' : + + + + } + ; }; \ No newline at end of file