Skip to content

Commit 7c43a0d

Browse files
filiptronicekamvanbaren
authored andcommitted
Enhance claim namespace experience
1 parent 81b274c commit 7c43a0d

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

website/src/page-settings.tsx

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import Adopters from './adopters';
2424
import Members from './members';
2525

2626
//---------- HEAD TAGS
27-
const HeadTags: FunctionComponent<{title?: string, description?: string, keywords?: string, url?: string, imageUrl?: string, type?: string}> = (props) => {
27+
const HeadTags: FunctionComponent<{ title?: string, description?: string, keywords?: string, url?: string, imageUrl?: string, type?: string }> = (props) => {
2828
const handleChangeClientState = (newState: any, addedTags: HelmetTags, removedTags: HelmetTags): void => {
2929
if (addedTags.metaTags) {
3030
addedTags.metaTags.forEach((value: HTMLMetaElement) => {
@@ -41,38 +41,38 @@ const HeadTags: FunctionComponent<{title?: string, description?: string, keyword
4141
<title>{props.title}</title>
4242

4343
{/* SEO Meta Tags */}
44-
<meta name='description' content={props.description}/>
45-
<meta name='keywords' content={props.keywords}/>
46-
<meta property='og:url' content={props.url}/>
47-
<meta property='og:type' content={type}/>
48-
<meta property='og:title' content={props.title}/>
49-
<meta property='og:description' content={props.description}/>
50-
<meta property='og:image' content={props.imageUrl}/>
44+
<meta name='description' content={props.description} />
45+
<meta name='keywords' content={props.keywords} />
46+
<meta property='og:url' content={props.url} />
47+
<meta property='og:type' content={type} />
48+
<meta property='og:title' content={props.title} />
49+
<meta property='og:description' content={props.description} />
50+
<meta property='og:image' content={props.imageUrl} />
5151

5252
{/* Google Meta Tags */}
53-
<meta itemProp='name' content={props.title}/>
54-
<meta itemProp='description' content={props.description}/>
55-
<meta itemProp='image' content={props.imageUrl}/>
53+
<meta itemProp='name' content={props.title} />
54+
<meta itemProp='description' content={props.description} />
55+
<meta itemProp='image' content={props.imageUrl} />
5656

5757
{/* Twitter Meta Tags */}
58-
<meta name='twitter:card' content={twitterCard}/>
59-
<meta name='twitter:title' content={props.title}/>
60-
<meta name='twitter:description' content={props.description}/>
61-
<meta name='twitter:image' content={props.imageUrl}/>
58+
<meta name='twitter:card' content={twitterCard} />
59+
<meta name='twitter:title' content={props.title} />
60+
<meta name='twitter:description' content={props.description} />
61+
<meta name='twitter:image' content={props.imageUrl} />
6262
</Helmet>;
6363
};
6464

65-
const MainHeadTags: FunctionComponent<{pageSettings: PageSettings}> = (props) => {
65+
const MainHeadTags: FunctionComponent<{ pageSettings: PageSettings }> = (props) => {
6666
const title = props.pageSettings.pageTitle;
6767
const description = 'Open VSX is an Eclipse open-source project and alternative to the Visual Studio Marketplace. It is deployed by the Eclipse Foundation at open-vsx.org.';
6868
const keywords = 'eclipse,ide,open source,development environment,development,vs code,visual studio code,extension,plugin,plug-in,registry,theia';
6969
const url = `${location.protocol}//${location.host}`;
7070
const imageUrl = url + '/openvsx-preview.png';
7171

72-
return (<HeadTags title={title} description={description} keywords={keywords} url={url} imageUrl={imageUrl}/>);
72+
return (<HeadTags title={title} description={description} keywords={keywords} url={url} imageUrl={imageUrl} />);
7373
};
7474

75-
const ExtensionHeadTags: FunctionComponent<{extension?: Extension, pageSettings: PageSettings}> = (props) => {
75+
const ExtensionHeadTags: FunctionComponent<{ extension?: Extension, pageSettings: PageSettings }> = (props) => {
7676
const { name, namespace } = useParams();
7777
let title = ` – ${props.pageSettings.pageTitle}`;
7878
let url = `${location.protocol}//${location.host}/extension/`;
@@ -96,19 +96,19 @@ const ExtensionHeadTags: FunctionComponent<{extension?: Extension, pageSettings:
9696
url += `${namespace}/${name}`;
9797
}
9898

99-
return(<HeadTags title={title} url={url} description={description} keywords={keywords}/>)
99+
return (<HeadTags title={title} url={url} description={description} keywords={keywords} />)
100100
};
101101

102-
const NamespaceHeadTags: FunctionComponent<{namespaceDetails?: NamespaceDetails, pageSettings: PageSettings}> = (props) => {
102+
const NamespaceHeadTags: FunctionComponent<{ namespaceDetails?: NamespaceDetails, pageSettings: PageSettings }> = (props) => {
103103
const { name } = useParams();
104104
const namespaceName = props.namespaceDetails?.displayName ?? props.namespaceDetails?.name ?? name
105105
const title = `${namespaceName}${props.pageSettings.pageTitle}`;
106106
const url = `${location.protocol}//${location.host}/namespace/${namespaceName}`;
107107
const description = props.namespaceDetails?.description
108-
return(<HeadTags title={title} url={url} description={description}/>)
108+
return (<HeadTags title={title} url={url} description={description} />)
109109
};
110110

111-
export default function createPageSettings(theme: Theme, prefersDarkMode: boolean, serverVersionPromise: Promise<string>): PageSettings {
111+
export default function createPageSettings(theme: Theme, prefersDarkMode: boolean, serverVersionPromise: Promise<string>): PageSettings {
112112

113113
//---------- SERVER VERSION
114114
const ServerVersion = lazy(async () => {
@@ -123,7 +123,7 @@ export default function createPageSettings(theme: Theme, prefersDarkMode: boolea
123123
<OpenVSXLogo width='auto' height='40px' marginTop='8px' prefersDarkMode={prefersDarkMode} />
124124
</RouteLink>
125125
<Suspense>
126-
<ServerVersion/>
126+
<ServerVersion />
127127
</Suspense>
128128
</>;
129129

@@ -146,14 +146,14 @@ export default function createPageSettings(theme: Theme, prefersDarkMode: boolea
146146

147147
//---------- DOWNLOAD TERMS
148148
const downloadTerms: FunctionComponent = () =>
149-
<Box mt={1}>
150-
<Typography variant='body2'>
151-
By clicking download, you accept this website&apos;s&nbsp;
152-
<Link color='secondary' underline='hover' href='https://open-vsx.org/terms-of-use'>
153-
Terms of Use
154-
</Link>.
155-
</Typography>
156-
</Box>;
149+
<Box mt={1}>
150+
<Typography variant='body2'>
151+
By clicking download, you accept this website&apos;s&nbsp;
152+
<Link color='secondary' underline='hover' href='https://open-vsx.org/terms-of-use'>
153+
Terms of Use
154+
</Link>.
155+
</Typography>
156+
</Box>;
157157

158158
//---------- ADDITIONAL PAGES
159159
const additionalRoutes: ReactNode = <>
@@ -176,11 +176,11 @@ export default function createPageSettings(theme: Theme, prefersDarkMode: boolea
176176
};
177177

178178
//---------- CLAIM NAMESPACE LINK
179-
const claimNamespace: FunctionComponent<{ extension: Extension, sx: SxProps<Theme> }> = ({ sx }) => <Link
180-
href='https://github.com/EclipseFdn/open-vsx.org/issues/new/choose'
181-
target='_blank' variant='body2' color='secondary' underline='hover' sx={sx} >
182-
Claim Ownership
183-
</Link>;
179+
const claimNamespace: FunctionComponent<{ extension: Extension, sx: SxProps<Theme> }> = ({ sx, extension }) => <Link
180+
href={`https://github.com/EclipseFdn/open-vsx.org/issues/new?labels=namespace&template=claim-namespace-ownership.md&title=${encodeURIComponent(`Claiming namespace \`${extension.namespace}\``)}`}
181+
target='_blank' variant='body2' color='secondary' underline='hover' sx={sx} >
182+
Claim Ownership
183+
</Link>;
184184

185185

186186
return {

0 commit comments

Comments
 (0)